Created Roslyn Analyzers (third-party) (markdown)

James Groom 2023-03-16 10:46:46 +10:00
parent 1ced0053d5
commit a96866338c
1 changed files with 30 additions and 0 deletions

@ -0,0 +1,30 @@
As a reminder, the project files' include graph looks like:
```
/Common.props
├─ /ExternalProjects/LibCommon.props
│ ├─ /ExternalProjects/FlatBuffers.GenOutput/FlatBuffers.GenOutput.csproj
│ ├─ /ExternalProjects/iso-parser/ISOParser.csproj
│ ├─ /ExternalProjects/NLua/NLua.csproj
│ ├─ /ExternalProjects/PcxFileTypePlugin.HawkQuantizer/PcxFileTypePlugin.HawkQuantizer.csproj
│ └─ /ExternalProjects/AnalyzersCommon.props
│ ├─ /ExternalProjects/BizHawk.Analyzer/BizHawk.Analyzer.csproj
│ └─ /ExternalProjects/BizHawk.SrcGen.ReflectionCache/BizHawk.SrcGen.ReflectionCache.csproj
├─ /src/BizHawk.Version/BizHawk.Version.csproj
├─ /src/MainSlnCommon.props
│ ├─ /src/BizHawk.Common/BizHawk.Common.csproj
│ ├─ ... (other main solution projects, including tests)
│ └─ /src/MainSlnExecutable.props
│ ├─ /src/BizHawk.Bizware.Test/BizHawk.Bizware.Test.csproj
│ ├─ /src/BizHawk.Client.DiscoHawk/BizHawk.Client.DiscoHawk.csproj
│ └─ /src/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj
└─ /ExternalToolProjects/ExtToolCommon.props
├─ /ExternalToolProjects/HelloWorld/HelloWorld.csproj (also imports NET48ExternalToolForm.targets)
└─ ... (other ext. tools)
```
`/Common.props` enables the .NET Analyzers and StyleCop, and imports BizHawk.Analyzer and some third-party Analyzers.
You can tell the assembly references are working if `;;` is flagged with "MA0037: Remove empty statement".
You can tell the ruleset reference is working if the above is true but the output isn't flooded with other warnings like "MEN002: Line must be no longer than 160 characters".
Similarly, you can tell the StyleCop config reference is working if the output isn't flooded with other warnings like "SA1600: Elements should be documented".
> Note: `/src/MainSlnCommon.props` *disables* Analyzers unless `-p:RunAnalyzersDuringBuild=true` is passed to `dotnet` / the build script.