Skip to content

Commit bcc3026

Browse files
authored
Merge pull request #2705 from sharwell/merge-status-site
Generate status report during a build
2 parents 9296fa2 + 5812583 commit bcc3026

17 files changed

Lines changed: 846 additions & 25 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ See [Contributing](CONTRIBUTING.md)
4444

4545
## Current status
4646

47-
An up-to-date list of which StyleCop rules are implemented and which have code fixes can be found [here](https://stylecop.pdelvo.com/).
47+
An up-to-date list of which StyleCop rules are implemented and which have code fixes can be found [here](https://dotnetanalyzers.github.io/StyleCopAnalyzers/).

StyleCop.Analyzers/Directory.Build.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
<InformationalVersion>1.1.0-dev</InformationalVersion>
1414
</PropertyGroup>
1515

16-
<PropertyGroup>
17-
<EnableDefaultNoneItems>False</EnableDefaultNoneItems>
18-
</PropertyGroup>
19-
2016
<PropertyGroup>
2117
<LangVersion>7</LangVersion>
2218
<Features>strict</Features>

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,4 @@
4141
<ProjectReference Include="..\StyleCop.Analyzers\StyleCop.Analyzers.csproj" />
4242
</ItemGroup>
4343

44-
<ItemGroup>
45-
<None Include="StyleCop.Analyzers.nuspec" />
46-
<None Include="tools\install.ps1" />
47-
<None Include="tools\uninstall.ps1" />
48-
<None Include="ReadMe.txt" />
49-
</ItemGroup>
50-
5144
</Project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="Microsoft.CodeAnalysis" publicKeyToken="31bf3856ad364e35" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
11+
<dependentAssembly>
12+
<assemblyIdentity name="Microsoft.CodeAnalysis.Workspaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
13+
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
14+
</dependentAssembly>
15+
</assemblyBinding>
16+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
17+
<dependentAssembly>
18+
<assemblyIdentity name="Microsoft.CodeAnalysis.CSharp" publicKeyToken="31bf3856ad364e35" culture="neutral" />
19+
<bindingRedirect oldVersion="0.0.0.0-2.9.0.0" newVersion="2.9.0.0" />
20+
</dependentAssembly>
21+
</assemblyBinding>
22+
</runtime>
23+
</configuration>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 StyleCop.Analyzers.Status.Generator
5+
{
6+
/// <summary>
7+
/// This enum is used to indicate whether or not a code fix is implemented
8+
/// </summary>
9+
public enum CodeFixStatus
10+
{
11+
/// <summary>
12+
/// This value indicates, that a code fix is implemented
13+
/// </summary>
14+
Implemented,
15+
16+
/// <summary>
17+
/// This value indicates, that a code fix is not implemented and
18+
/// will not be implemented because it either can't be implemented
19+
/// or a code fix would not be able to fix it rationally.
20+
/// </summary>
21+
NotImplemented,
22+
23+
/// <summary>
24+
/// This value indicates, that a code fix is not implemented because
25+
/// no one implemented it yet, or it is not yet decided if a code fix
26+
/// is going to be implemented in the future.
27+
/// </summary>
28+
NotYetImplemented,
29+
}
30+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 StyleCop.Analyzers.Status.Generator
5+
{
6+
using System;
7+
using System.IO;
8+
using System.Linq;
9+
using LibGit2Sharp;
10+
using Microsoft.Build.Locator;
11+
using Newtonsoft.Json;
12+
13+
/// <summary>
14+
/// The starting point of this application.
15+
/// </summary>
16+
internal class Program
17+
{
18+
/// <summary>
19+
/// The starting point of this application.
20+
/// </summary>
21+
/// <param name="args">The command line parameters.</param>
22+
/// <returns>Zero if the tool completes successfully; otherwise, a non-zero error code.</returns>
23+
internal static int Main(string[] args)
24+
{
25+
if (args.Length < 1)
26+
{
27+
Console.WriteLine("Path to sln file required.");
28+
return 1;
29+
}
30+
31+
if (!File.Exists(args[0]))
32+
{
33+
Console.WriteLine($"Could not find solution file: {Path.GetFullPath(args[0])}");
34+
return 1;
35+
}
36+
37+
MSBuildLocator.RegisterDefaults();
38+
SolutionReader reader = SolutionReader.CreateAsync(args[0]).Result;
39+
40+
var diagnostics = reader.GetDiagnosticsAsync().Result;
41+
42+
diagnostics = diagnostics.Sort((a, b) => a.Id.CompareTo(b.Id));
43+
44+
Commit commit;
45+
string commitId;
46+
47+
using (Repository repository = new Repository(Path.GetDirectoryName(args[0])))
48+
{
49+
commitId = repository.Head.Tip.Sha;
50+
commit = repository.Head.Tip;
51+
52+
var output = new
53+
{
54+
diagnostics,
55+
git = new
56+
{
57+
commit.Sha,
58+
commit.Message,
59+
commit.Author,
60+
commit.Committer,
61+
Parents = commit.Parents.Select(x => x.Sha),
62+
},
63+
};
64+
65+
Console.WriteLine(JsonConvert.SerializeObject(output, Formatting.Indented));
66+
}
67+
68+
return 0;
69+
}
70+
}
71+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"profiles": {
3+
"StyleCop.Analyzers.Status.Generator": {
4+
"commandName": "Project",
5+
"commandLineArgs": "..\\..\\..\\..\\..\\StyleCopAnalyzers.sln",
6+
"environmentVariables": {
7+
"Configuration": "$(Configuration)"
8+
}
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)