Skip to content

Commit c403b72

Browse files
committed
Polishing before release.
1 parent 11f0da7 commit c403b72

19 files changed

+30
-35
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ What is this [**dependency control**](doc/DependencyControl.md) anyway?
1414

1515
1. Add the [![NuGet Package](https://img.shields.io/nuget/v/NsDepCop.svg)](https://nuget.org/packages/NsDepCop) package to your C# projects.
1616
1. A file called **config.nsdepcop** is automatically added. Edit it and describe [**dependency rules**](doc/Help.md#dependency-rules).
17+
* If you already have an nsdepcop.config in the project then nuget will prompt you whether you want to overwrite it. Make sure you choose 'No'.
1718
1. When you **build** the project, dependency violations will be reported in the build output just like compiler errors/warnings.
1819

1920
See the [**Help**](doc/Help.md) for details.

appveyor.yml

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

33
environment:
44
shortversion: '1.6.0'
5-
informationalversion: '1.6.0-rc1'
5+
informationalversion: '1.6.0'
66

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

doc/Help.md

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ config.nsdepcop file in "C:\MySolution\MyProject":
149149

150150
More info:
151151
* If there is a conflict between the project-level and the inherited settings then the project-level settings "win".
152+
* The `IsEnabled` attribute has different meaning in the project-level config and in inherited configs.
153+
* If `IsEnabled="false"` in a project-level config then the project don't get analyzed.
154+
* If `IsEnabled="false"` in an inherited config then its content doesn't get inherited.
152155
* The inheritance is not limited to just a project and a solution level config; you can have any number of config.nsdepcop files at any folder levels. Just make sure you set the `InheritanceDepth` to a number that is great enough to find all the higher-level configs.
153156
* There must always be a config.nsdepcop file in the project folder if you want to analyze that project.
154157
Even if all the settings come from a higher-level config, you have to put **at least a minimal config to the project level**, that enables the inheritance in the first place.

source/NsDepCop.Core/Implementation/Analysis/TypeDependencyValidator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Linq;
33
using Codartis.NsDepCop.Core.Interface.Analysis;
44
using Codartis.NsDepCop.Core.Interface.Config;
5-
using MoreLinq;
5+
using Codartis.NsDepCop.Core.Util;
66

77
namespace Codartis.NsDepCop.Core.Implementation.Analysis
88
{

source/NsDepCop.Core/NsDepCop.Core.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
<Compile Include="Util\EnumerableExtensions.cs" />
127127
<Compile Include="Interface\Analysis\ITypeDependencyEnumerator.cs" />
128128
<Compile Include="Interface\Config\NamespaceSpecification.cs" />
129-
<Compile Include="Util\MoreLinqExtensions.cs" />
129+
<Compile Include="Util\LinqExtensions.cs" />
130130
<Compile Include="Properties\AssemblyInfo.cs" />
131131
<Compile Include="Implementation\Config\XmlFileConfigProvider.cs" />
132132
<Compile Include="Interface\Analysis\SourceSegment.cs" />
@@ -145,12 +145,12 @@
145145
</ItemGroup>
146146
<ItemGroup />
147147
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
148-
<Import Project="..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" />
148+
<Import Project="..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" />
149149
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
150150
<PropertyGroup>
151151
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
152152
</PropertyGroup>
153-
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets'))" />
153+
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets'))" />
154154
</Target>
155155
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
156156
Other similar extension points exist, see Microsoft.Common.targets.

source/NsDepCop.Core/Util/MoreLinqExtensions.cs source/NsDepCop.Core/Util/LinqExtensions.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33

4-
// ReSharper disable once CheckNamespace
5-
namespace MoreLinq
4+
namespace Codartis.NsDepCop.Core.Util
65
{
7-
public static class MoreLinqExtensions
6+
public static class LinqExtensions
87
{
98
public static TSource MinByOrDefault<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> selector)
109
{

source/NsDepCop.Core/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net452" />
44
<package id="Microsoft.CodeAnalysis.Common" version="1.3.2" targetFramework="net452" />
55
<package id="Microsoft.CodeAnalysis.CSharp" version="1.3.2" targetFramework="net452" />
6-
<package id="NsDepCop" version="1.6.0-beta3" targetFramework="net452" developmentDependency="true" />
6+
<package id="NsDepCop" version="1.6.0-rc1" targetFramework="net452" developmentDependency="true" />
77
<package id="System.Collections" version="4.0.0" targetFramework="net452" />
88
<package id="System.Collections.Immutable" version="1.1.37" targetFramework="net452" />
99
<package id="System.Diagnostics.Debug" version="4.0.0" targetFramework="net452" />

source/NsDepCop.MsBuildTask/NsDepCop.MsBuildTask.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@
7878
</None>
7979
</ItemGroup>
8080
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
81-
<Import Project="..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" />
81+
<Import Project="..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" />
8282
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
8383
<PropertyGroup>
8484
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
8585
</PropertyGroup>
86-
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets'))" />
86+
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets'))" />
8787
</Target>
8888
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
8989
Other similar extension points exist, see Microsoft.Common.targets.

source/NsDepCop.MsBuildTask/NsDepCopTask.cs

+7-8
Original file line numberDiff line numberDiff line change
@@ -208,23 +208,22 @@ private void LogInfoMessage(string message)
208208
private void LogBuildEvent(IssueKind issueKind, string message, MessageImportance messageImportance, string code = null,
209209
string path = null, int startLine = 0, int startColumn = 0, int endLine = 0, int endColumn = 0)
210210
{
211-
message = "[" + ProductConstants.ToolName + "] " + message;
212-
213211
switch (issueKind)
214212
{
215213
case IssueKind.Error:
216-
BuildEngine.LogErrorEvent(new BuildErrorEventArgs(
217-
null, code, path, startLine, startColumn, endLine, endColumn, message, code, ProductConstants.ToolName));
214+
BuildEngine.LogErrorEvent(
215+
new BuildErrorEventArgs(null, code, path, startLine, startColumn, endLine, endColumn, message, code, ProductConstants.ToolName));
218216
break;
219217

220218
case IssueKind.Warning:
221-
BuildEngine.LogWarningEvent(new BuildWarningEventArgs(
222-
null, code, path, startLine, startColumn, endLine, endColumn, message, code, ProductConstants.ToolName));
219+
BuildEngine.LogWarningEvent(
220+
new BuildWarningEventArgs(null, code, path, startLine, startColumn, endLine, endColumn, message, code, ProductConstants.ToolName));
223221
break;
224222

225223
default:
226-
BuildEngine.LogMessageEvent(new BuildMessageEventArgs(
227-
null, code, path, startLine, startColumn, endLine, endColumn, message, code, ProductConstants.ToolName, messageImportance));
224+
BuildEngine.LogMessageEvent(
225+
new BuildMessageEventArgs(null, code, path, startLine, startColumn, endLine, endColumn,
226+
$"[{ProductConstants.ToolName}] {message}", code, ProductConstants.ToolName, messageImportance));
228227
break;
229228
}
230229
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="NsDepCop" version="1.6.0-beta3" targetFramework="net452" developmentDependency="true" />
3+
<package id="NsDepCop" version="1.6.0-rc1" targetFramework="net452" developmentDependency="true" />
44
</packages>

source/NsDepCop.Setup.CustomActions/NsDepCop.Setup.CustomActions.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@
7171
</ItemGroup>
7272
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7373
<Import Project="$(WixCATargetsPath)" />
74-
<Import Project="..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" />
74+
<Import Project="..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" />
7575
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
7676
<PropertyGroup>
7777
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
7878
</PropertyGroup>
79-
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets'))" />
79+
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets'))" />
8080
</Target>
8181
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="NsDepCop" version="1.6.0-beta3" targetFramework="net452" developmentDependency="true" />
3+
<package id="NsDepCop" version="1.6.0-rc1" targetFramework="net452" developmentDependency="true" />
44
</packages>

source/NsDepCop.VisualStudioIntegration/IssueDescriptorExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Codartis.NsDepCop.VisualStudioIntegration
99
internal static class IssueDescriptorExtensions
1010
{
1111
/// <summary>
12-
/// Format string to create a help link for diagnostics. The parameter is the diagnostic's code in full UPPERCASE.
12+
/// Format string to create a help link for diagnostics. The parameter is the diagnostic's code in lowercase.
1313
/// </summary>
1414
private const string HelpLinkFormat = @"https://github.com/realvizu/NsDepCop/blob/VS2015/doc/Diagnostics.md#{0}";
1515

@@ -27,7 +27,7 @@ public static DiagnosticDescriptor ToDiagnosticDescriptor<TIssue>(this IssueDesc
2727

2828
private static string GetHelpLink(string issueDescriptorId)
2929
{
30-
return string.Format(HelpLinkFormat, issueDescriptorId.ToUpper(CultureInfo.InvariantCulture));
30+
return string.Format(HelpLinkFormat, issueDescriptorId.ToLower(CultureInfo.InvariantCulture));
3131
}
3232
}
3333
}

source/NsDepCop.VisualStudioIntegration/NsDepCop.VisualStudioIntegration.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@
9797
<Analyzer Include="..\packages\Microsoft.CodeAnalysis.Analyzers.1.1.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
9898
</ItemGroup>
9999
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
100-
<Import Project="..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" />
100+
<Import Project="..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets" Condition="Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" />
101101
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
102102
<PropertyGroup>
103103
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
104104
</PropertyGroup>
105-
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-beta3\build\NsDepCop.targets'))" />
105+
<Error Condition="!Exists('..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NsDepCop.1.6.0-rc1\build\NsDepCop.targets'))" />
106106
</Target>
107107
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
108108
Other similar extension points exist, see Microsoft.Common.targets.

source/NsDepCop.VisualStudioIntegration/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net452" />
44
<package id="Microsoft.CodeAnalysis.Common" version="1.3.2" targetFramework="net452" />
55
<package id="Microsoft.CodeAnalysis.CSharp" version="1.3.2" targetFramework="net452" />
6-
<package id="NsDepCop" version="1.6.0-beta3" targetFramework="net452" developmentDependency="true" />
6+
<package id="NsDepCop" version="1.6.0-rc1" targetFramework="net452" developmentDependency="true" />
77
<package id="System.Collections" version="4.0.0" targetFramework="net452" />
88
<package id="System.Collections.Immutable" version="1.1.37" targetFramework="net452" />
99
<package id="System.Diagnostics.Debug" version="4.0.0" targetFramework="net452" />

source/NsDepCop.sln

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AB1A4FF5-D372-416A-9986-6C3548F78B3B}"
77
ProjectSection(SolutionItems) = preProject
88
..\appveyor.yml = ..\appveyor.yml
9-
build.cmd = build.cmd
109
..\CHANGELOG.md = ..\CHANGELOG.md
1110
config.nsdepcop = config.nsdepcop
1211
..\Contribute.md = ..\Contribute.md

source/build.cmd

-5
This file was deleted.

source/config.nsdepcop

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<NsDepCopConfig CodeIssueKind="Error" ChildCanDependOnParentImplicitly="true" InfoImportance="High">
33
<Allowed From="*" To="System.*" />
4-
<Allowed From="*" To="MoreLinq" />
54
<Allowed From="*" To="Codartis.NsDepCop.Core.Util" />
65
</NsDepCopConfig>

source/include/VersionInfo.cs

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)