-
Notifications
You must be signed in to change notification settings - Fork 17
Stylecop.Analyzers
This project uses the new, Roslyn based, Stylecop.Analyzers for code analysis.
This means developers have to think differently then before. Stylecop.Analyzers can fix some of the errors themselves (such as a trailing whitespace), and do need much less attendance from the developer. As a big bonus it is also much faster than the old Stylecop.
There are some features that are not fully included in this version, or are bugged
- You cannot exclude files by specifying it in the *.csproj file, as an alternative you need to include
// <auto-generated />
at the top of the file. - When adding a new project, you manually need to add the
stylecop.json
file to the *.csproj file. After adding the file like always, you need to perform the following steps (taken from the official page
- Right click the project in Solution Explorer and select Unload Project. If you are asked to save changes, click Yes.
- Right click the unloaded project in Solution Explorer and select Edit ProjectName.csproj.
- Locate the following item in the project file.
<None Include="stylecop.json" />- Change the definition to the following.
<AdditionalFiles Include="$(SolutionDir)stylecop.json" />- Save and close the project file.
- Right click the unloaded project in Solution Explorer and select Reload Project. The
stylecop.json
file resides in the main GW2.NET folder bsides the .gitignore and the BasicRules.ruleset file, be sure to change the path accordingly.
Furthermore you need to add the *.ruleset file to each csproj file. To do this, add <CodeAnalysisRuleSet>$(SolutionDir)GW2NET.ruleset</CodeAnalysisRuleSet>
inside each compile configuration PropertyGroup
If you think the rules should be changed, edit the GW2NET.ruleset file and send a pull request. The same goes for Stylecop.Analyzers settings.
-
Documentation
-
Specialty Services
-
Optional Topics