Skip to content

Commit 2559298

Browse files
committed
Merge pull request #1638 from sharwell/update-beta14
Update to StyleCop.Analyzers 1.0.0-beta14
2 parents 747d677 + 560de15 commit 2559298

10 files changed

Lines changed: 67 additions & 54 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/Helpers/DiagnosticResult.cs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,6 @@ namespace TestHelper
66
using System;
77
using Microsoft.CodeAnalysis;
88

9-
/// <summary>
10-
/// Location where the diagnostic appears, as determined by path, line number, and column number.
11-
/// </summary>
12-
public struct DiagnosticResultLocation
13-
{
14-
public string Path;
15-
public int Line;
16-
public int Column;
17-
18-
public DiagnosticResultLocation(string path, int line, int column)
19-
{
20-
if (line < 0 && column < 0)
21-
{
22-
throw new ArgumentOutOfRangeException("At least one of line and column must be > 0");
23-
}
24-
25-
if (line < -1 || column < -1)
26-
{
27-
throw new ArgumentOutOfRangeException("Both line and column must be >= -1");
28-
}
29-
30-
this.Path = path;
31-
this.Line = line;
32-
this.Column = column;
33-
}
34-
}
35-
369
/// <summary>
3710
/// Structure that stores information about a <see cref="Diagnostic"/> appearing in a source.
3811
/// </summary>
@@ -177,4 +150,4 @@ public DiagnosticResult WithLineOffset(int offset)
177150
return result;
178151
}
179152
}
180-
}
153+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
2+
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
3+
4+
namespace TestHelper
5+
{
6+
using System;
7+
8+
/// <summary>
9+
/// Location where the diagnostic appears, as determined by path, line number, and column number.
10+
/// </summary>
11+
public struct DiagnosticResultLocation
12+
{
13+
public string Path;
14+
public int Line;
15+
public int Column;
16+
17+
public DiagnosticResultLocation(string path, int line, int column)
18+
{
19+
if (line < 0 && column < 0)
20+
{
21+
throw new ArgumentOutOfRangeException("At least one of line and column must be > 0");
22+
}
23+
24+
if (line < -1 || column < -1)
25+
{
26+
throw new ArgumentOutOfRangeException("Both line and column must be >= -1");
27+
}
28+
29+
this.Path = path;
30+
this.Line = line;
31+
this.Column = column;
32+
}
33+
}
34+
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
<Compile Include="ExportCodeFixProviderAttributeNameTest.cs" />
169169
<Compile Include="Helpers\CodeFixVerifier.Helper.cs" />
170170
<Compile Include="Helpers\DiagnosticResult.cs" />
171+
<Compile Include="Helpers\DiagnosticResultLocation.cs" />
171172
<Compile Include="Helpers\DiagnosticVerifier.Helper.cs" />
172173
<Compile Include="Helpers\ExclusionTestAnalyzer.cs" />
173174
<Compile Include="Helpers\TestDiagnosticProvider.cs" />
@@ -359,12 +360,10 @@
359360
<None Include="..\StyleCop.Analyzers.ruleset">
360361
<Link>StyleCop.Analyzers.ruleset</Link>
361362
</None>
362-
<None Include="packages.config" />
363-
</ItemGroup>
364-
<ItemGroup>
365-
<AdditionalFiles Include="..\stylecop.json">
363+
<None Include="..\stylecop.json">
366364
<Link>stylecop.json</Link>
367-
</AdditionalFiles>
365+
</None>
366+
<None Include="packages.config" />
368367
</ItemGroup>
369368
<ItemGroup>
370369
<ProjectReference Include="..\StyleCop.Analyzers\StyleCop.Analyzers.csproj">
@@ -376,8 +375,8 @@
376375
<Analyzer Include="..\..\packages\AsyncUsageAnalyzers.1.0.0-alpha003\analyzers\dotnet\AsyncUsageAnalyzers.dll" />
377376
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
378377
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
379-
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
380-
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
378+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
379+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
381380
</ItemGroup>
382381
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
383382
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@@ -386,7 +385,9 @@
386385
</PropertyGroup>
387386
<Error Condition="!Exists('..\..\packages\xunit.core.2.1.0-beta4-build3109\build\portable-net45+netcore45+wp8+wpa81\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.1.0-beta4-build3109\build\portable-net45+netcore45+wp8+wpa81\xunit.core.props'))" />
388387
<Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.1.0-beta4-build1109\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.1.0-beta4-build1109\build\net20\xunit.runner.visualstudio.props'))" />
388+
<Error Condition="!Exists('..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets'))" />
389389
</Target>
390+
<Import Project="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets" Condition="Exists('..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets')" />
390391
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
391392
Other similar extension points exist, see Microsoft.Common.targets.
392393
<Target Name="BeforeBuild">

StyleCop.Analyzers/StyleCop.Analyzers.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="1.0.0" targetFramework="net452" />
99
<package id="Microsoft.Composition" version="1.0.27" targetFramework="net452" />
1010
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
11-
<package id="StyleCop.Analyzers" version="1.0.0-beta013" targetFramework="net452" developmentDependency="true" />
11+
<package id="StyleCop.Analyzers" version="1.0.0-beta014" targetFramework="net452" developmentDependency="true" />
1212
<package id="System.Collections.Immutable" version="1.1.36" targetFramework="net452" />
1313
<package id="System.Reflection.Metadata" version="1.0.21" targetFramework="net452" />
1414
<package id="xunit" version="2.1.0-beta4-build3109" targetFramework="net452" />

StyleCop.Analyzers/StyleCop.Analyzers/Helpers/DocumentationCommentExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace StyleCop.Analyzers.Helpers
1111
using Microsoft.CodeAnalysis.CSharp.Syntax;
1212
using StyleCop.Analyzers.SpacingRules;
1313

14-
internal static class DocumentationSyntaxExtensions
14+
internal static class DocumentationCommentExtensions
1515
{
1616
public static DocumentationCommentTriviaSyntax GetDocumentationCommentTriviaSyntax(this SyntaxNode node)
1717
{

StyleCop.Analyzers/StyleCop.Analyzers/Helpers/TokenHelpers.cs renamed to StyleCop.Analyzers/StyleCop.Analyzers/Helpers/TokenHelper.cs

File renamed without changes.

StyleCop.Analyzers/StyleCop.Analyzers/StyleCop.Analyzers.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
<Compile Include="Helpers\Requires.cs" />
138138
<Compile Include="Helpers\SpecializedTasks.cs" />
139139
<Compile Include="Helpers\SyntaxTreeHelpers.cs" />
140-
<Compile Include="Helpers\TokenHelpers.cs" />
140+
<Compile Include="Helpers\TokenHelper.cs" />
141141
<Compile Include="Helpers\TriviaHelper.cs" />
142142
<Compile Include="Helpers\UsingDirectiveSyntaxHelpers.cs" />
143143
<Compile Include="Helpers\XmlCommentHelper.cs" />
@@ -405,6 +405,9 @@
405405
<None Include="..\StyleCop.Analyzers.ruleset">
406406
<Link>StyleCop.Analyzers.ruleset</Link>
407407
</None>
408+
<None Include="..\stylecop.json">
409+
<Link>stylecop.json</Link>
410+
</None>
408411
<None Include="build\StyleCop.Analyzers.targets" />
409412
<None Include="packages.config" />
410413
<NuGetManifest Include="StyleCop.Analyzers.nuspec">
@@ -417,11 +420,6 @@
417420
<None Include="tools\uninstall.ps1" />
418421
<None Include="ReadMe.txt" />
419422
</ItemGroup>
420-
<ItemGroup>
421-
<AdditionalFiles Include="..\stylecop.json">
422-
<Link>stylecop.json</Link>
423-
</AdditionalFiles>
424-
</ItemGroup>
425423
<ItemGroup>
426424
<Reference Include="Microsoft.CodeAnalysis, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
427425
<HintPath>..\..\packages\Microsoft.CodeAnalysis.Common.1.0.0\lib\portable-net45+win8\Microsoft.CodeAnalysis.dll</HintPath>
@@ -471,8 +469,8 @@
471469
<Analyzer Include="..\..\packages\AsyncUsageAnalyzers.1.0.0-alpha003\analyzers\dotnet\AsyncUsageAnalyzers.dll" />
472470
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
473471
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
474-
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
475-
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
472+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
473+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
476474
</ItemGroup>
477475
<ItemGroup>
478476
<EmbeddedResource Include="DocumentationRules\DocumentationResources.resx">
@@ -519,8 +517,10 @@
519517
</PropertyGroup>
520518
<Error Condition="!Exists('..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.props'))" />
521519
<Error Condition="!Exists('..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets'))" />
520+
<Error Condition="!Exists('..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets'))" />
522521
</Target>
523522
<Import Project="..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets" Condition="Exists('..\..\packages\Tvl.NuGet.BuildTasks.1.0.0-alpha002\build\Tvl.NuGet.BuildTasks.targets')" />
523+
<Import Project="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets" Condition="Exists('..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets')" />
524524
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
525525
Other similar extension points exist, see Microsoft.Common.targets.
526526
<Target Name="BeforeBuild">

StyleCop.Analyzers/StyleCop.Analyzers/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<package id="Microsoft.Composition" version="1.0.27" targetFramework="portable-net45+win8" />
1010
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="portable45-net45+win8" />
1111
<package id="NuGet.CommandLine" version="2.8.3" targetFramework="portable45-net45+win8" />
12-
<package id="StyleCop.Analyzers" version="1.0.0-beta013" targetFramework="portable45-net45+win8" developmentDependency="true" />
12+
<package id="StyleCop.Analyzers" version="1.0.0-beta014" targetFramework="portable45-net45+win8" developmentDependency="true" />
1313
<package id="System.Collections.Immutable" version="1.1.36" targetFramework="portable45-net45+win8" />
1414
<package id="System.Reflection.Metadata" version="1.0.21" targetFramework="portable45-net45+win8" />
1515
<package id="Tvl.NuGet.BuildTasks" version="1.0.0-alpha002" targetFramework="portable45-net45+win8" />

StyleCop.Analyzers/StyleCopTester/StyleCopTester.csproj

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,18 @@
133133
<None Include="..\StyleCop.Analyzers.ruleset">
134134
<Link>StyleCop.Analyzers.ruleset</Link>
135135
</None>
136+
<None Include="..\stylecop.json">
137+
<Link>stylecop.json</Link>
138+
</None>
136139
<None Include="App.config" />
137140
<None Include="packages.config" />
138141
</ItemGroup>
139-
<ItemGroup>
140-
<AdditionalFiles Include="..\stylecop.json">
141-
<Link>stylecop.json</Link>
142-
</AdditionalFiles>
143-
</ItemGroup>
144142
<ItemGroup>
145143
<Analyzer Include="..\..\packages\AsyncUsageAnalyzers.1.0.0-alpha003\analyzers\dotnet\AsyncUsageAnalyzers.dll" />
146144
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll" />
147145
<Analyzer Include="..\..\packages\Microsoft.CodeAnalysis.Analyzers.1.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll" />
148-
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
149-
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
146+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
147+
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
150148
</ItemGroup>
151149
<ItemGroup>
152150
<ProjectReference Include="..\StyleCop.Analyzers\StyleCop.Analyzers.csproj">
@@ -155,6 +153,13 @@
155153
</ProjectReference>
156154
</ItemGroup>
157155
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
156+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
157+
<PropertyGroup>
158+
<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>
159+
</PropertyGroup>
160+
<Error Condition="!Exists('..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets'))" />
161+
</Target>
162+
<Import Project="..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets" Condition="Exists('..\..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets')" />
158163
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
159164
Other similar extension points exist, see Microsoft.Common.targets.
160165
<Target Name="BeforeBuild">

StyleCop.Analyzers/StyleCopTester/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<package id="Microsoft.CodeAnalysis.VisualBasic.Workspaces" version="1.0.0" targetFramework="net45" />
1010
<package id="Microsoft.CodeAnalysis.Workspaces.Common" version="1.0.0" targetFramework="net45" />
1111
<package id="Microsoft.Composition" version="1.0.27" targetFramework="net45" />
12-
<package id="StyleCop.Analyzers" version="1.0.0-beta013" targetFramework="net452" developmentDependency="true" />
12+
<package id="StyleCop.Analyzers" version="1.0.0-beta014" targetFramework="net452" developmentDependency="true" />
1313
<package id="System.Collections.Immutable" version="1.1.36" targetFramework="net45" />
1414
<package id="System.Reflection.Metadata" version="1.0.21" targetFramework="net45" />
1515
</packages>

0 commit comments

Comments
 (0)