Skip to content

Commit 9e6d322

Browse files
committed
Setting version to 1.8.0. Updating documentation.
1 parent 9ae840f commit 9e6d322

File tree

5 files changed

+38
-4
lines changed

5 files changed

+38
-4
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NsDepCop Change Log
22

33
## v1.8.0
4-
(06/2018)
4+
(07/2018)
55

66
- [x] Enhancements in launching the out-of-process service host (configurable retry intervals, allow access for any user).
77
- [x] MaxIssueCountSeverity - enables breaking the build when a threshold number of dependency violations has been reached.

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ What is this [**dependency control**](doc/DependencyControl.md) anyway?
1111
## Getting Started
1212

1313
1. Add the **NsDepCop NuGet package** to your C# projects: [![NuGet Package](https://img.shields.io/nuget/v/NsDepCop.svg)](https://nuget.org/packages/NsDepCop)
14-
* If you have v1.7.0 then you should update to v1.7.1 because that's much faster.
1514
1. A file called **config.nsdepcop** is automatically added to your project. Edit it and describe [**dependency rules**](doc/Help.md#dependency-rules).
1615
* If your project doesn't use the packages.config package manager format then you'll have to [add config.nsdepcop manually](doc/Troubleshooting.md#item4).
1716
1. When you **build** the project, dependency violations will be reported in the build output just like compiler errors/warnings.

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ image: Visual Studio 2017
22

33
environment:
44
shortversion: '1.8.0'
5-
informationalversion: '1.8.0-beta2'
5+
informationalversion: '1.8.0'
66

77
version: '$(shortversion).{build}'
88

doc/Help.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* [Supported project types](#supported-project-types)
44
* [Dependency rules](#dependency-rules)
55
* [Config inheritance](#config-inheritance)
6+
* [Dealing with a high number of dependency issues](#dealing-with-a-high-number-of-dependency-issues)
67
* [Controlling verbosity](#controlling-verbosity)
78
* [Config XML schema](#config-xml-schema)
89
* [Config XML schema support in Visual Studio](#config-xml-schema-support-in-visual-studio)
@@ -44,7 +45,9 @@ Attribute | Values | Description
4445
**CodeIssueKind** | Info, **Warning**, Error | Dependency violations are reported at this severity level.
4546
**ChildCanDependOnParentImplicitly** | true, **false** | If set to true then all child namespaces can depend on any of their parents without an explicit allowing rule. The recommended value is **true**. (False is default for backward compatibility.)
4647
**InfoImportance** | Low, **Normal**, High | Info messages are reported to MSBuild at this level. This setting and the MSBuild verbosity (/v) swicth together determine whether a message appears on the output or not. See [Controlling verbosity](#controlling-verbosity) for details.
47-
**MaxIssueCount** | int (>0), default: **100** | Analysis stops when reaching this number of issues.
48+
**MaxIssueCount** | int (>0), default: **100** | Analysis stops when reaching this number of dependency issues.
49+
**MaxIssueCountSeverity** | Info, **Warning**, Error | This is the severity of the issue of reaching MaxIssueCount.
50+
**AutoLowerMaxIssueCount** | true, **false** | If set to true then each successful build yielding fewer issues than MaxIssueCount sets MaxIssueCount to the current number of issues.
4851
**InheritanceDepth** | int (>=0), default: **0** | Sets the number of parent folder levels to inherit config from. 0 means no inheritance.
4952

5053
### Whitelisting
@@ -164,6 +167,23 @@ Even if all the settings come from a higher-level config, you have to put **at l
164167
E.g.: `<NsDepCopConfig InheritanceDepth="3"/>`
165168
* You can turn on diagnostic messages ([Controlling verbosity](#controlling-verbosity)) to see which config files were found and loaded by the tool and what effective config resulted from combining them.
166169

170+
## Dealing with a high number of dependency issues
171+
If there are so many dependency issues that you cannot fix them all at once but you still want to control them somehow then try the following.
172+
173+
* Prevent the introduction of more dependency issues. Set the current number of issues as the maximum and make it an error to create more.
174+
175+
```xml
176+
<NsDepCopConfig IssueKind="Warning" MaxIssueCount="<the current number of issues>" MaxIssueCountSeverity="Error">
177+
```
178+
179+
* Encourage developers to gradually fix the dependency issues by automatically lowering the max issue count whenever possible. Turn on AutoLowerMaxIssueCount.
180+
181+
```xml
182+
<NsDepCopConfig IssueKind="Warning" MaxIssueCount="100" MaxIssueCountSeverity="Error" AutoLowerMaxIssueCount="true">
183+
```
184+
185+
> Please note that when NsDepCop modifies the nsdepcop.config files their formatting will be reset (because of the XML deserialization/serialization roundtrip).
186+
167187
## Controlling verbosity
168188
* Besides emitting dependency violation issues, the tool can emit diagnostic and info messages too.
169189
* **Info messages** tell you when was the tool started and finished.

doc/Troubleshooting.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
# NsDepCop Troubleshooting
22

3+
* [Exception: Unable to communicate with NsDepCop service](#item5)
34
* [NsDepCop NuGet package is not adding config.nsdepcop file to the project](#item4)
45
* [Anonymous types raise false alarms](#item3)
56
* [Setup is unable to add NsDepCop target to the C# build workflow](#item2)
67
* [Setup is unable to remove NsDepCop target from the C# build workflow](#item1)
78

9+
<a name="item5"></a>
10+
## Exception: Unable to communicate with NsDepCop service
11+
> Applies to version v1.7.1 or later.
12+
13+
This problem is likely caused by the analyzer client not waiting enough time for the analyzer server started in a separate process to spin up.
14+
To fix it:
15+
* Update to v1.8.0 or later.
16+
* Try to set longer and/or more wait intervals in your config.nsdepcop file(s) by adding the AnalyzerServiceCallRetryTimeSpans attribute to the root element and fiddling with its value. The value should be a comma separated list of wait times between retries (in milliseconds).
17+
* E.g. this config waits 100ms, then 1sec, then 10sec:
18+
19+
```xml
20+
<NsDepCopConfig AnalyzerServiceCallRetryTimeSpans="100,1000,10000">
21+
```
22+
823
<a name="item4"></a>
924
## NsDepCop NuGet package is not adding config.nsdepcop file to the project
1025
If the project uses the **PackageReference** package manager format then content files are not added to the project.

0 commit comments

Comments
 (0)