|
1 | 1 | # StyleChecker |
2 | 2 |
|
3 | | -StyleChecker is yet another code style checker and refactoring tool like |
4 | | -[FxCopAnalyzers][fxcopanalyzers], |
5 | | -[StyleCop Analyzers][stylecopanalyzers], |
6 | | -[SonarLint][sonarlint], |
7 | | -[Roslynator][roslynator], |
8 | | -and so on. It uses |
9 | | -[the .NET Compiler Platform ("Roslyn")](https://github.com/dotnet/roslyn) |
10 | | -to analyze the C# source code of .NET Core projects and outputs diagnostics |
11 | | -of a rule violation, |
12 | | -and when running with Visual Studio it provides code fixes as much as possible. |
13 | | -Note that StyleChecker contains only supplemental or niche analyzers, |
14 | | -so it is intended to be used together with other Roslyn analyzers. |
| 3 | +StyleChecker is another code style checking and refactoring tool similar to |
| 4 | +[FxCopAnalyzers][fxcopanalyzers], [StyleCop Analyzers][stylecopanalyzers], |
| 5 | +[SonarLint][sonarlint], [Roslynator][roslynator], etc. It uses the |
| 6 | +[.NET Compiler Platform ("Roslyn")][roslyn] to analyze the C# source code of |
| 7 | +.NET projects and outputs diagnostics of rule violations. And when used with |
| 8 | +IDEs such as Visual Studio, it provides as many code fixes as possible. Note |
| 9 | +that you should use this tool with other Roslyn analyzers, as it contains only |
| 10 | +complementary or niche analyzers. |
15 | 11 |
|
16 | 12 | ## Get started |
17 | 13 |
|
18 | | -StyleChecker is available as |
19 | | -[the ![NuGet-logo][nuget-logo] NuGet package][nuget-stylechecker]. |
| 14 | +StyleChecker is available as [the ![NuGet-logo][nuget-logo] NuGet |
| 15 | +package][nuget-stylechecker]. |
20 | 16 |
|
21 | 17 | ### Install StyleChecker to your project with Visual Studio |
22 | 18 |
|
23 | 19 | 1. Open Package Manager Console. (Open your project with Visual Studio, and |
24 | | - select Tools |
25 | | - ➜ NuGet Package Manager |
26 | | - ➜ Package Manager Console.) |
| 20 | + select Tools ➜ NuGet Package Manager ➜ Package Manager |
| 21 | + Console.) |
27 | 22 | 2. Enter the command `Install-Package StyleChecker` in the Package Manager |
28 | 23 | Console. |
29 | 24 |
|
30 | | -### Install StyleChecker to your project with .NET Core CLI |
| 25 | +### Install StyleChecker to your project with .NET CLI |
31 | 26 |
|
32 | | -1. Enter the command `dotnet add package StyleChecker` with the console. |
| 27 | +- Enter the command `dotnet add package StyleChecker` with the console. |
33 | 28 |
|
34 | 29 | ## Diagnostics |
35 | 30 |
|
36 | 31 | See [the list of diagnostics](doc/rules). |
37 | 32 |
|
38 | 33 | ## Customize configuration |
39 | 34 |
|
40 | | -Some analyzers can be customized to change their behaviors, |
41 | | -placing the configuration file `StyleChecker.xml` at the project root. |
42 | | -The XML Schema Definition file `config.v1.xsd` of the configuration file |
43 | | -and a sample of the configuration file are provided in the directory |
44 | | -`StyleChecker/StyleChecker/nuget/samples/` of the source tree |
45 | | -(or in `~/.nuget/packages/stylechecker/VERSION/samples/` |
46 | | -if you installed StyleChecker with the NuGet package). Note that |
47 | | -StyleChecker does not use the XML Schema Definition file, |
48 | | -but it helps you edit `StyleChecker.xml` with the text editor |
49 | | -that is able to validate XML documents (for example, Visual Studio IDE, |
50 | | -Visual Studio Code, and so on). |
| 35 | +You can customize some analyzers to change their behaviors by placing the |
| 36 | +configuration file `StyleChecker.xml` at the project root. The XML Schema |
| 37 | +Definition file `config.v1.xsd` of the configuration file and a sample of the |
| 38 | +configuration file are available in the directory |
| 39 | +`StyleChecker/StyleChecker/nuget/samples/` of the source tree (or in |
| 40 | +`~/.nuget/packages/stylechecker/VERSION/samples/` if you installed StyleChecker |
| 41 | +with the NuGet package). Note that StyleChecker does not use the XML Schema |
| 42 | +Definition file. But it helps you edit `StyleChecker.xml` with the text editor |
| 43 | +that can validate XML documents (for example, Visual Studio IDE, Visual Studio |
| 44 | +Code, and so on). |
51 | 45 |
|
52 | | -Create your own `StyleChecker.xml` file and place it at your project root, |
53 | | -and add the `AdditionalFiles` element to `.csproj` file in your project |
54 | | -as follows: |
| 46 | +Create your own `StyleChecker.xml` file, place it at your project root, and add |
| 47 | +the `AdditionalFiles` element to the `.csproj` file in your project as follows: |
55 | 48 |
|
56 | 49 | ```xml |
57 | 50 | <ItemGroup> |
58 | 51 | <AdditionalFiles Include="StyleChecker.xml" /> |
59 | 52 | </ItemGroup> |
60 | 53 | ``` |
61 | 54 |
|
62 | | -Alternatively, with Visual Studio you can set "C# analyzer additional file" |
63 | | -to Build Action property (This property can be changed from |
64 | | -Solution Explorer |
65 | | -➜ Right Click on the `StyleChecker.xml` |
66 | | -➜ Properties |
67 | | -➜ Advanced |
68 | | -➜ Build Action). |
| 55 | +Alternatively, in Visual Studio, you can set the value "C# analyzer additional |
| 56 | +file" to the Build Action property. You can change this property from Solution |
| 57 | +Explorer ➜ Right Click on the `StyleChecker.xml` ➜ Properties |
| 58 | +➜ Advanced ➜ Build Action. |
69 | 59 |
|
| 60 | +[roslyn]: https://github.com/dotnet/roslyn |
70 | 61 | [fxcopanalyzers]: https://github.com/dotnet/roslyn-analyzers |
71 | 62 | [stylecopanalyzers]: https://github.com/DotNetAnalyzers/StyleCopAnalyzers |
72 | 63 | [sonarlint]: https://github.com/SonarSource/sonarlint-visualstudio |
|
0 commit comments