diff --git a/ConvertTo-Nuspec.ps1 b/ConvertTo-Nuspec.ps1 index fc7f599e..7eaaed06 100644 --- a/ConvertTo-Nuspec.ps1 +++ b/ConvertTo-Nuspec.ps1 @@ -1,24 +1,41 @@ param($Version) -$projectPath = Join-Path $PWD Lombiq.Analyzers -function Read-Xml([string]$File) { [xml](Get-Content (Join-Path $projectPath $File)) } +$packages = @( + 'Lombiq.Analyzers', + 'Lombiq.Analyzers.NetFx', + 'Lombiq.Analyzers.OrchardCore', + 'Lombiq.Analyzers.Orchard1', + 'Lombiq.Analyzers.VisualStudioExtension' +) -$nuspec = Read-Xml Lombiq.Analyzers.nuspec.template -$dependencies = $nuspec.package.metadata.dependencies +# Iterate through the packages to replace +foreach ($package in $packages) +{ + $projectPath = Join-Path $PWD $package + function Read-Xml([string]$File) { [xml](Get-Content $File) } -$nuspec.package.metadata.GetElementsByTagName('version')[0].InnerXml = $Version + $nuspec = Read-Xml (Join-Path $projectPath "$package.nuspec.template") + $dependencies = $nuspec.package.metadata.dependencies -foreach ($dependency in (Read-Xml CommonPackages.props).Project.ItemGroup.AnalyzerPackage) -{ - $id = $dependency.Include - if (-not $id) { continue } + $nuspec.package.metadata.GetElementsByTagName('version')[0].InnerXml = $Version - $node = $nuspec.CreateElement('dependency') - $node.SetAttribute('id', $id) - $node.SetAttribute('version', $dependency.Version) + # AnalyzerPackages.props is optional. + $analyzerPackagesPropsFile = Join-Path $projectPath 'AnalyzerPackages.props' + if (Test-Path $analyzerPackagesPropsFile) + { + foreach ($dependency in (Read-Xml $analyzerPackagesPropsFile).Project.ItemGroup.AnalyzerPackage) + { + $id = $dependency.Include + if (-not $id) { continue } - $dependencies.AppendChild($node) -} + $node = $nuspec.CreateElement('dependency') + $node.SetAttribute('id', $id) + $node.SetAttribute('version', $dependency.Version) -$outputPath = Join-Path $projectPath Lombiq.Analyzers.nuspec -$nuspec.Save($outputPath) + $dependencies.AppendChild($node) + } + } + + $outputPath = Join-Path $projectPath "$package.nuspec" + $nuspec.Save($outputPath) +} diff --git a/Lombiq.Analyzers/NetFx.Build.props b/Lombiq.Analyzers.NetFx/Build.props similarity index 83% rename from Lombiq.Analyzers/NetFx.Build.props rename to Lombiq.Analyzers.NetFx/Build.props index 23016dd3..27bf9c30 100644 --- a/Lombiq.Analyzers/NetFx.Build.props +++ b/Lombiq.Analyzers.NetFx/Build.props @@ -1,6 +1,5 @@ - $(MSBuildThisFileDirectory)orchard1.ruleset $(OutputPath) @@ -28,7 +27,12 @@ <_SkipUpgradeNetAnalyzersNuGetWarning>true - + + + + + + + License.md + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig new file mode 100644 index 00000000..d2d434d4 --- /dev/null +++ b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.globalconfig @@ -0,0 +1,13 @@ +is_global = true +global_level = 10 + +# General code analysis rules for .NET Framework projects, extending Lombiq.Analyzers.globalconfig. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA1016.severity = none + +# SonarAnalyzer.CSharp rules +dotnet_diagnostic.S3904.severity = none diff --git a/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template new file mode 100644 index 00000000..52a9c515 --- /dev/null +++ b/Lombiq.Analyzers.NetFx/Lombiq.Analyzers.NetFx.nuspec.template @@ -0,0 +1,30 @@ + + + + Lombiq.Analyzers.NetFx + $version$ + Lombiq .NET Analyzers for .NET Framework + Lombiq Technologies + License.md + https://aka.ms/deprecateLicenseUrl + NuGetIcon.png + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.NetFx + Lombiq .NET Analyzers for .NET Framework: .NET code analyzers and code convention settings for .NET Framework projects. See the project website for detailed documentation. + Copyright © 2020, Lombiq Technologies Ltd. + NetFx Lombiq AspNetCore CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + + + + + true + + + + + + diff --git a/Lombiq.Analyzers.NetFx/NuGetIcon.png b/Lombiq.Analyzers.NetFx/NuGetIcon.png new file mode 100644 index 00000000..162a0050 Binary files /dev/null and b/Lombiq.Analyzers.NetFx/NuGetIcon.png differ diff --git a/Lombiq.Analyzers.NetFx/Readme.md b/Lombiq.Analyzers.NetFx/Readme.md new file mode 100644 index 00000000..6c78b607 --- /dev/null +++ b/Lombiq.Analyzers.NetFx/Readme.md @@ -0,0 +1,5 @@ +# Lombiq .NET Analyzers for .NET Framework + +## About + +.NET code analyzers and code convention settings for .NET Framework projects. See [the root Readme](../Readme.md) for details on how to use the project. diff --git a/Lombiq.Analyzers.NetFx/build/Lombiq.Analyzers.NetFx.props b/Lombiq.Analyzers.NetFx/build/Lombiq.Analyzers.NetFx.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.NetFx/build/Lombiq.Analyzers.NetFx.props @@ -0,0 +1,7 @@ + + + true + + + + diff --git a/Lombiq.Analyzers.Orchard1/Build.props b/Lombiq.Analyzers.Orchard1/Build.props new file mode 100644 index 00000000..743450e6 --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Build.props @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Lombiq.Analyzers.Orchard1/License.md b/Lombiq.Analyzers.Orchard1/License.md new file mode 100644 index 00000000..2e53f494 --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/License.md @@ -0,0 +1,13 @@ +Copyright © 2020, [Lombiq Technologies Ltd.](https://lombiq.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj new file mode 100644 index 00000000..684422c1 --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.csproj @@ -0,0 +1,31 @@ + + + + netstandard2.0 + $(DefaultItemExcludes);.git*; + + License.md + + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig new file mode 100644 index 00000000..74c575ba --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.globalconfig @@ -0,0 +1,17 @@ +is_global = true +global_level = 20 + +# Code analysis rules for Orchard 1 projects, extending Lombiq.Analyzers.NetFx.globalconfig and +# Lombiq.Analyzers.OrchardCore.globalconfig. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA3147.severity = none + +# SecurityCodeScan.VS2019 rules +dotnet_diagnostic.SCS0016.severity = none + +# SonarAnalyzer.CSharp rules +dotnet_diagnostic.S4564.severity = none diff --git a/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.nuspec.template b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.nuspec.template new file mode 100644 index 00000000..165da160 --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Lombiq.Analyzers.Orchard1.nuspec.template @@ -0,0 +1,30 @@ + + + + Lombiq.Analyzers.Orchard1 + $version$ + Lombiq .NET Analyzers for Orchard 1 + Lombiq Technologies + License.md + https://aka.ms/deprecateLicenseUrl + NuGetIcon.png + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.Orchard1 + Lombiq .NET Analyzers for Orchard 1: .NET code analyzers and code convention settings for Orchard 1 (https://orchardcore.net/orchardcms) apps. See the project website for detailed documentation. + Copyright © 2020, Lombiq Technologies Ltd. + Orchard Lombiq AspNet CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + + + + + + true + + + + + + diff --git a/Lombiq.Analyzers.Orchard1/NuGetIcon.png b/Lombiq.Analyzers.Orchard1/NuGetIcon.png new file mode 100644 index 00000000..162a0050 Binary files /dev/null and b/Lombiq.Analyzers.Orchard1/NuGetIcon.png differ diff --git a/Lombiq.Analyzers.Orchard1/Readme.md b/Lombiq.Analyzers.Orchard1/Readme.md new file mode 100644 index 00000000..75d0f66f --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/Readme.md @@ -0,0 +1,5 @@ +# Lombiq .NET Analyzers for Orchard 1 + +## About + +.NET code analyzers and code convention settings for [Orchard 1](https://orchardcore.net/orchardcms) projects. See [the root Readme](../Readme.md) for details on how to use the project. diff --git a/Lombiq.Analyzers.Orchard1/build/Lombiq.Analyzers.Orchard1.props b/Lombiq.Analyzers.Orchard1/build/Lombiq.Analyzers.Orchard1.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.Orchard1/build/Lombiq.Analyzers.Orchard1.props @@ -0,0 +1,7 @@ + + + true + + + + diff --git a/Lombiq.Analyzers.OrchardCore/Build.props b/Lombiq.Analyzers.OrchardCore/Build.props new file mode 100644 index 00000000..59007c73 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Build.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/Lombiq.Analyzers.OrchardCore/License.md b/Lombiq.Analyzers.OrchardCore/License.md new file mode 100644 index 00000000..2e53f494 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/License.md @@ -0,0 +1,13 @@ +Copyright © 2020, [Lombiq Technologies Ltd.](https://lombiq.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj new file mode 100644 index 00000000..9348c934 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.csproj @@ -0,0 +1,30 @@ + + + + netstandard2.0 + $(DefaultItemExcludes);.git*; + + License.md + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig new file mode 100644 index 00000000..a3cd3ca8 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.globalconfig @@ -0,0 +1,25 @@ +is_global = true +global_level = 10 + +# Code analysis rules for Orchard Core projects, extending Lombiq.Analyzers.globalconfig. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. + + +# Microsoft.CodeAnalysis.CSharp rules +dotnet_diagnostic.CS1591.severity = none + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA1014.severity = none +dotnet_diagnostic.CA1019.severity = silent +dotnet_diagnostic.CA1062.severity = silent +dotnet_diagnostic.CA1710.severity = silent +dotnet_diagnostic.CA1711.severity = silent +dotnet_diagnostic.CA1716.severity = silent +dotnet_diagnostic.CA1724.severity = silent +dotnet_diagnostic.CA1812.severity = silent +dotnet_diagnostic.CA1848.severity = none +dotnet_diagnostic.CA2007.severity = silent +dotnet_diagnostic.CA5391.severity = silent +dotnet_diagnostic.CA5395.severity = silent diff --git a/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template new file mode 100644 index 00000000..0a679ed1 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Lombiq.Analyzers.OrchardCore.nuspec.template @@ -0,0 +1,29 @@ + + + + Lombiq.Analyzers.OrchardCore + $version$ + Lombiq .NET Analyzers for Orchard Core + Lombiq Technologies + License.md + https://aka.ms/deprecateLicenseUrl + NuGetIcon.png + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.OrchardCore + Lombiq .NET Analyzers for Orchard Core: .NET code analyzers and code convention settings for Orchard Core (https://orchardcore.net/) apps. See the project website for detailed documentation. + Copyright © 2020, Lombiq Technologies Ltd. + OrchardCore Lombiq AspNetCore CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + + + + + + + + + + + diff --git a/Lombiq.Analyzers.OrchardCore/NuGetIcon.png b/Lombiq.Analyzers.OrchardCore/NuGetIcon.png new file mode 100644 index 00000000..162a0050 Binary files /dev/null and b/Lombiq.Analyzers.OrchardCore/NuGetIcon.png differ diff --git a/Lombiq.Analyzers.OrchardCore/Readme.md b/Lombiq.Analyzers.OrchardCore/Readme.md new file mode 100644 index 00000000..9973ce56 --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/Readme.md @@ -0,0 +1,5 @@ +# Lombiq .NET Analyzers for Orchard Core + +## About + +.NET code analyzers and code convention settings for [Orchard Core](https://orchardcore.net/) projects. See [the root Readme](../Readme.md) for details on how to use the project. diff --git a/Lombiq.Analyzers.OrchardCore/build/Lombiq.Analyzers.OrchardCore.props b/Lombiq.Analyzers.OrchardCore/build/Lombiq.Analyzers.OrchardCore.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.OrchardCore/build/Lombiq.Analyzers.OrchardCore.props @@ -0,0 +1,7 @@ + + + true + + + + diff --git a/Lombiq.Analyzers.VisualStudioExtension/Build.props b/Lombiq.Analyzers.VisualStudioExtension/Build.props new file mode 100644 index 00000000..773ec19e --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Build.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/Lombiq.Analyzers.VisualStudioExtension/License.md b/Lombiq.Analyzers.VisualStudioExtension/License.md new file mode 100644 index 00000000..2e53f494 --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/License.md @@ -0,0 +1,13 @@ +Copyright © 2020, [Lombiq Technologies Ltd.](https://lombiq.com) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.csproj b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.csproj new file mode 100644 index 00000000..798adbaa --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.csproj @@ -0,0 +1,30 @@ + + + + netstandard2.0 + $(DefaultItemExcludes);.git*; + + License.md + + + + + + + + + + + + + + + + + + diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig new file mode 100644 index 00000000..f79ff9f7 --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.globalconfig @@ -0,0 +1,10 @@ +is_global = true +global_level = 20 + +# Code analysis rules for Visual Studio extension projects, extending Lombiq.Analyzers.NetFx.globalconfig. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. + +# Microsoft.VisualStudio.Threading.Analyzers rules +dotnet_diagnostic.VSTHRD002.severity = warning diff --git a/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template new file mode 100644 index 00000000..d9809c33 --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Lombiq.Analyzers.VisualStudioExtension.nuspec.template @@ -0,0 +1,30 @@ + + + + Lombiq.Analyzers.VisualStudioExtension + $version$ + Lombiq .NET Analyzers for Visual Studio Extensions + Lombiq Technologies + License.md + https://aka.ms/deprecateLicenseUrl + NuGetIcon.png + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers.VisualStudioExtension + Lombiq .NET Analyzers for Visual Studio Extensions: .NET code analyzers and code convention settings for Visual Studio Extensions. See the project website for detailed documentation. + Copyright © 2020, Lombiq Technologies Ltd. + VisualStudioExtension VisualStudio Lombiq AspNet CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + + + + + + true + + + + + + diff --git a/Lombiq.Analyzers.VisualStudioExtension/NuGetIcon.png b/Lombiq.Analyzers.VisualStudioExtension/NuGetIcon.png new file mode 100644 index 00000000..162a0050 Binary files /dev/null and b/Lombiq.Analyzers.VisualStudioExtension/NuGetIcon.png differ diff --git a/Lombiq.Analyzers.VisualStudioExtension/Readme.md b/Lombiq.Analyzers.VisualStudioExtension/Readme.md new file mode 100644 index 00000000..0ec85362 --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/Readme.md @@ -0,0 +1,5 @@ +# Lombiq .NET Analyzers for Visual Studio Extensions + +## About + +.NET code analyzers and code convention settings for Visual Studio Extension projects. See [the root Readme](../Readme.md) for details on how to use the project. diff --git a/Lombiq.Analyzers.VisualStudioExtension/build/Lombiq.Analyzers.VisualStudioExtension.props b/Lombiq.Analyzers.VisualStudioExtension/build/Lombiq.Analyzers.VisualStudioExtension.props new file mode 100644 index 00000000..49b5725f --- /dev/null +++ b/Lombiq.Analyzers.VisualStudioExtension/build/Lombiq.Analyzers.VisualStudioExtension.props @@ -0,0 +1,7 @@ + + + true + + + + diff --git a/Lombiq.Analyzers.sln b/Lombiq.Analyzers.sln index 4ea0a908..d7a002c7 100644 --- a/Lombiq.Analyzers.sln +++ b/Lombiq.Analyzers.sln @@ -3,20 +3,47 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.Analyzers", "Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers", "Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.OrchardCore", "Lombiq.Analyzers.OrchardCore\Lombiq.Analyzers.OrchardCore.csproj", "{56EB2C63-4689-40E8-B967-8E78D401E25B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.NetFx", "Lombiq.Analyzers.NetFx\Lombiq.Analyzers.NetFx.csproj", "{5706CF69-091E-4F97-A6CE-3440F9CEACC7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.Orchard1", "Lombiq.Analyzers.Orchard1\Lombiq.Analyzers.Orchard1.csproj", "{0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.VisualStudioExtension", "Lombiq.Analyzers.VisualStudioExtension\Lombiq.Analyzers.VisualStudioExtension.csproj", "{85C33788-497A-4223-B266-48B2592A04EA}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Debug|Any CPU.Build.0 = Debug|Any CPU {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Release|Any CPU.ActiveCfg = Release|Any CPU {1435B0AD-AB9A-42BA-B3D9-554FE5274CE8}.Release|Any CPU.Build.0 = Release|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56EB2C63-4689-40E8-B967-8E78D401E25B}.Release|Any CPU.Build.0 = Release|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5706CF69-091E-4F97-A6CE-3440F9CEACC7}.Release|Any CPU.Build.0 = Release|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FD2BD1A-0411-4AB0-B478-C8ECAE8759E8}.Release|Any CPU.Build.0 = Release|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85C33788-497A-4223-B266-48B2592A04EA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CF592D6A-8CAC-4389-89C7-593C104DB561} EndGlobalSection EndGlobal diff --git a/Lombiq.Analyzers/.editorconfig b/Lombiq.Analyzers/.editorconfig index 1791262b..574b0e97 100644 --- a/Lombiq.Analyzers/.editorconfig +++ b/Lombiq.Analyzers/.editorconfig @@ -1,12 +1,6 @@ # WARNING: Only edit this file in the Lombiq .NET Analyzers repository's "Lombiq.Analyzers" folder. A copy of this file # anywhere else will be overwritten. -# Common .NET conventions, code formatting and naming convention rules. Check out possible configs here: -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference -# If you found some issue then try to fix it, which you can also do from VS Quick Actions: -# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#automatically-configure-code-styles -# Add new file types at the bottom. For new rules for C# files follow the structure that VS generates. - # All files [*] @@ -19,269 +13,10 @@ indent_size = 4 indent_style = space trim_trailing_whitespace = true - # New line preferences end_of_line = crlf insert_final_newline = true -dotnet_style_operator_placement_when_wrapping = beginning_of_line tab_width = 4 -dotnet_style_coalesce_expression = true:warning -dotnet_style_null_propagation = true:warning -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning -dotnet_style_prefer_auto_properties = true:warning - -# C# files -[*.cs] - -#### .NET Coding Conventions #### - -# Organize usings -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = false - -# this. and Me. preferences -dotnet_style_qualification_for_event = false:warning -dotnet_style_qualification_for_field = false:warning -dotnet_style_qualification_for_method = false:warning -dotnet_style_qualification_for_property = false:warning - -# Language keywords vs BCL types preferences -dotnet_style_predefined_type_for_locals_parameters_members = true:warning -dotnet_style_predefined_type_for_member_access = true:warning - -# Parentheses preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent -dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent - -# Modifier preferences -dotnet_style_require_accessibility_modifiers = always:warning - -# Expression-level preferences -dotnet_style_coalesce_expression = true:warning -dotnet_style_collection_initializer = true:warning -dotnet_style_explicit_tuple_names = true:warning -dotnet_style_null_propagation = true:warning -dotnet_style_object_initializer = true:warning -dotnet_style_prefer_auto_properties = true:warning -dotnet_style_prefer_compound_assignment = true:warning -dotnet_style_prefer_conditional_expression_over_assignment = true:warning -dotnet_style_prefer_conditional_expression_over_return = false -dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning -dotnet_style_prefer_inferred_tuple_names = true:warning -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning -dotnet_style_prefer_simplified_interpolation = true:warning - -# Field preferences -dotnet_style_readonly_field = true:warning - -# Parameter preferences -dotnet_code_quality_unused_parameters = non_pubic:suggestion - -#### C# Style Rules #### - -#IDE* rules are managed here. - -# Note that currently both IDE* rules and csharp_style_* rules are necessary, because only IDE rules will be enforced -# during build, see: https://github.com/dotnet/roslyn/issues/44201. - -# Default severity for analyzer diagnostics for all categories (escalated to build warnings). See -# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories for the list of categories. -dotnet_analyzer_diagnostic.category-Design.severity = warning -dotnet_analyzer_diagnostic.category-Documentation.severity = warning -dotnet_analyzer_diagnostic.category-Globalization.severity = warning -dotnet_analyzer_diagnostic.category-Interoperability.severity = warning -dotnet_analyzer_diagnostic.category-Maintainability.severity = warning -dotnet_analyzer_diagnostic.category-Naming.severity = warning -dotnet_analyzer_diagnostic.category-Performance.severity = warning -dotnet_analyzer_diagnostic.category-SingleFile.severity = warning -dotnet_analyzer_diagnostic.category-Reliability.severity = warning -dotnet_analyzer_diagnostic.category-Security.severity = warning -dotnet_analyzer_diagnostic.category-Style.severity = warning -dotnet_analyzer_diagnostic.category-Usage.severity = warning -dotnet_analyzer_diagnostic.category-CodeQuality.severity = warning - -# IDE0011: Add braces to 'if' statement. -# The "when-multiline:warning" config is not actually for cases when the if body is in another line so we have to turn -# this off completely, see: https://github.com/dotnet/roslyn/issues/40912. -dotnet_diagnostic.IDE0011.severity = none -# IDE0050: Convert to tuple -# Quite dangerous as we most frequently use anonymous types to interface with other APIs (like generating routes) and -# those can fail on this silently in runtime while building correctly. -dotnet_diagnostic.IDE0050.severity = none -# IDE0052: Private member can be removed as the value assigned to it is never used. -# We use S4487 for that. -dotnet_diagnostic.IDE0052.severity = none -# IDE0072: Populate switch -# Also signals on switches with discards, by design: https://github.com/dotnet/roslyn/issues/48876. -dotnet_diagnostic.IDE0072.severity = none -# "Namespace 'Foo' does not match folder structure, expected 'Foo'" -dotnet_diagnostic.IDE0130.severity = none - -# While these are in the Style category, they need to be explicitly set for some reason. -# IDE0079 Remove unnecessary suppression -dotnet_diagnostic.IDE0079.severity = warning -dotnet_diagnostic.IDE0022.severity = warning - -# 'var' preferences -dotnet_diagnostic.IDE0007.severity = warning -dotnet_diagnostic.IDE0008.severity = none - -# We don't want to decorate every public member with XML comments, only public APIs - so turn CS1591 off. -# CS1591 Missing XML Comment for publicly visible type or member -dotnet_diagnostic.CS1591.severity = none - -#### C# Coding Conventions #### - -# 'var' preferences -# These won't take effect during build due to this bug: -# https://github.com/dotnet/roslyn/issues/44250 -csharp_style_var_elsewhere = true:warning -# If this is not turned off then there will be messages for e.g. integers too, like in for loops. -csharp_style_var_for_built_in_types = false:none -csharp_style_var_when_type_is_apparent = true:warning - -# Expression-bodied members -csharp_style_expression_bodied_accessors = true:warning -csharp_style_expression_bodied_constructors = true:warning -csharp_style_expression_bodied_indexers = true:warning -csharp_style_expression_bodied_lambdas = true:warning -csharp_style_expression_bodied_local_functions = true:warning -csharp_style_expression_bodied_methods = true:warning -csharp_style_expression_bodied_operators = true:warning -csharp_style_expression_bodied_properties = true:warning - -# Pattern matching preferences -csharp_style_pattern_matching_over_as_with_null_check = true:warning -csharp_style_pattern_matching_over_is_with_cast_check = true:warning -csharp_style_prefer_switch_expression = true:warning - -# Null-checking preferences -csharp_style_conditional_delegate_call = true:warning - -# Modifier preferences -csharp_prefer_static_local_function = true:warning -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent - -# Code-block preferences -csharp_prefer_simple_using_statement = true:warning -# IDE0160: Convert to block-scoped namespace -csharp_style_namespace_declarations = file_scoped:warning - -# Expression-level preferences -csharp_prefer_simple_default_expression = true:warning -csharp_style_deconstructed_variable_declaration = false:silent -csharp_style_inlined_variable_declaration = true:warning -csharp_style_pattern_local_over_anonymous_function = true:warning -csharp_style_prefer_index_operator = true:warning -csharp_style_prefer_range_operator = true:warning -csharp_style_throw_expression = true:warning -csharp_style_unused_value_assignment_preference = discard_variable:suggestion -csharp_style_unused_value_expression_statement_preference = discard_variable:none - -# 'using' directive preferences -csharp_using_directive_placement = outside_namespace:silent - -#### C# Formatting Rules #### - -# New line preferences -csharp_new_line_before_catch = true -csharp_new_line_before_else = true -csharp_new_line_before_finally = true -csharp_new_line_before_members_in_anonymous_types = true -csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_open_brace = all -csharp_new_line_between_query_expression_clauses = true - -# Indentation preferences -csharp_indent_block_contents = true -csharp_indent_braces = false -csharp_indent_case_contents = true -csharp_indent_case_contents_when_block = true -csharp_indent_labels = no_change -csharp_indent_switch_labels = true - -# Space preferences -csharp_space_after_cast = false -csharp_space_after_colon_in_inheritance_clause = true -csharp_space_after_comma = true -csharp_space_after_dot = false -csharp_space_after_keywords_in_control_flow_statements = true -csharp_space_after_semicolon_in_for_statement = true -csharp_space_around_binary_operators = before_and_after -csharp_space_around_declaration_statements = false -csharp_space_before_colon_in_inheritance_clause = true -csharp_space_before_comma = false -csharp_space_before_dot = false -csharp_space_before_open_square_brackets = false -csharp_space_before_semicolon_in_for_statement = false -csharp_space_between_empty_square_brackets = false -csharp_space_between_method_call_empty_parameter_list_parentheses = false -csharp_space_between_method_call_name_and_opening_parenthesis = false -csharp_space_between_method_call_parameter_list_parentheses = false -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -csharp_space_between_method_declaration_name_and_open_parenthesis = false -csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_parentheses = false -csharp_space_between_square_brackets = false - -# Wrapping preferences -csharp_preserve_single_line_blocks = true -csharp_preserve_single_line_statements = true - -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = * -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = * -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = * -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case - -# Disabling "catch a more specific exception type" suggestion which is overwhelmingly a false positive. -dotnet_diagnostic.CA1031.severity = silent -# Disabling "do not nest type" suggestion. -dotnet_diagnostic.CA1034.severity = silent -# Disabling "CA1810: Initialize reference type static fields inline" as RSPEC-3963 is used instead. -dotnet_diagnostic.CA1810.severity = none - -# Don't apply "CA1822: Mark members as static" to the public API -dotnet_code_quality.ca1822.api_surface = private, internal -csharp_prefer_braces = true:silent # Various config files [*.{config,csproj,json,props,targets}] diff --git a/Lombiq.Analyzers/CommonPackages.props b/Lombiq.Analyzers/AnalyzerPackages.props similarity index 100% rename from Lombiq.Analyzers/CommonPackages.props rename to Lombiq.Analyzers/AnalyzerPackages.props diff --git a/Lombiq.Analyzers/Build.props b/Lombiq.Analyzers/Build.props index ea139c5e..b73060c4 100644 --- a/Lombiq.Analyzers/Build.props +++ b/Lombiq.Analyzers/Build.props @@ -1,6 +1,5 @@ - $(MSBuildThisFileDirectory)orchardcore.ruleset true - - - - - @@ -78,7 +76,9 @@ + "-target:Restore;LombiqNetAnalyzers" (including the quotes) to restore all package dependencies first. + .editorconfig needs to be copied since this is the only standard way for every editor to be able to use it (until + extending other .editorconfig files will be possible: https://github.com/editorconfig/editorconfig/issues/236). --> + all + +``` + +The `all` is necessary to prevent the analyzers "leaking" into other projects that may consume yours. + +You can also add the package to all projects inside a folder at once [from a _Directory.Build.props_ file](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build). + +## How to add the analyzers to SDK-style projects from a Git submodule + +Use this approach if you always want to use the very latest version, or if you'd like to contribute to Lombiq .NET Analyzers. + +1. Add to the following to the _.gitmodules_ file (we use the _tools_ subfolder for the submodule's folder here but feel free to use something else): ```gitmodules [submodule "Lombiq.Analyzers"] @@ -12,7 +40,7 @@ ``` _`path` can target anything but we suggest either the folder where the solution `.sln` file is located (mostly the repository root) or a "tools" subfolder therein._ -2. Create a _Directory.Build.props_ file in the folder where the solution _.sln_ file is located (mostly the repository root) with the following content (if you've put the submodule into a different folder then change the path): +2. Create a _Directory.Build.props_ file in the folder where the solution _.sln_ file is located (mostly the repository root) with the following content, referencing the analyzer project you selected above (if you've put the submodule into a different folder then change the path): ```xml @@ -26,14 +54,6 @@ /.editorconfig ``` -This will use the analyzer configuration suitable for Orchard Core projects. If you want to use the this in a non-Orchard .NET app then switch over to the general configuration by adding the following to the _Directory.Build.props_ file: - -```xml - - $(MSBuildThisFileDirectory)tools/Lombiq.Analyzers/general.ruleset - -``` - For at least Visual Studio and JetBrains Rider you don't need any further setup for IDE support. For [OmniSharp-integrated editors](http://www.omnisharp.net/#integrations) like Visual Studio Code you'll also need to add an _omnisharp.json_ file to the root of the solution: ```json @@ -47,39 +67,35 @@ For at least Visual Studio and JetBrains Rider you don't need any further setup } ``` -## How to add the analyzers to SDK-style projects from NuGet - -The recommended approach for SDK-style projects is adding .NET Analyzers as a submodule as explained above due to the increased control you have over configuration. However, if you aren't using Git, dislike submodules or prefer NuGet, you can also use the [NuGet package](https://www.nuget.org/packages/Lombiq.Analyzers/) to install it for just one project. Once you add the package to your project, all analyzers will be applied. Check for the latest version number [on NuGet](https://www.nuget.org/packages/Lombiq.Analyzers/). - -```csproj - - all - -``` +## How to add the analyzers to individual non-SDK-style .NET Framework projects (not solutions) -The `all` is necessary to prevent the analyzers "leaking" into other projects that may consume yours. +The key difference compared to .NET projects is that for non-SDK-style .NET Framework projects, you need to add Lombiq .NET Analyzers to each project. -You can also add the package to all projects inside a folder at once [from a _Directory.Build.props_ file](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build). +1. Same as above - add the .NET-Analyzers repository as a Git submodule to your repository or add the NuGet package in the next step. +2. Create a _Directory.Build.props_ file in a common root folder of your projects, or in every project folder you want to target, next to the _.csproj_ file with the following content, either referencing `Lombiq.Analyzers.NetFx` or `Lombiq.Analyzers.Orchard1`: -## How to add the analyzers to individual non-SDK-style .NET Framework projects (not solutions) + ```csproj + + all + + ``` -1. Same as above - add the .NET-Analyzers repository as a submodule to your repository. -2. Create a _Directory.Build.props_ file in every project folder you want to target, next to the _.csproj_ file with the following content (import the _NetFx.Build.props_ file instead of _Build.props_, adjust the relative path as suitable): + Or if you're using a Git submodule (adjust the relative path as suitable): ```xml - + ``` -3. The _NetFx.Build.props_ will copy this project's _.editorconfig_ file into every project folder that you've created a _Directory.Build.props_ in, so you might want to gitignore those: + If you do this for multiple projects, it's recommended to add your own central props file (like _Analyzers.Build.props_) where you do the above and import that in each project instead. + +3. _Build.props_ will copy this project's _.editorconfig_ file into every project folder that you've created a _Directory.Build.props_ in, so you might want to gitignore those: ```gitignore .editorconfig ``` -This will use the analyzer configuration suitable for Orchard 1 projects. If you want to use this in a non-Orchard .NET Framework app then use the _general.ruleset_ file as described above. - ## Introducing analyzers to an existing project What to do if you're not starting a green-field project but want to add analyzers to an existing (large) project? @@ -97,7 +113,7 @@ What to do if you're not starting a green-field project but want to add analyzer - .NET Core and .NET 5 or later projects can use this without anything special. - .NET Framework projects: - Projects using the new SDK-style csproj format don't need anything special. You [can convert projects manually](https://docs.microsoft.com/en-us/dotnet/core/porting/#per-project-steps) from the non-SDK-style csproj format or automatically with the [try-convert](https://github.com/dotnet/try-convert) utility. You'll also need to manually remove any leftover _packages.config_ files and adjust _NuGet.config_ files. - - Projects using the legacy, non-SDK-style csproj format should use _NetFx.Build.props_ as described above, but the including project needs to use `PackageReference`s. You can convert your _packages.config_-based project to `PackageReference`s using [this walkthrough](https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference). + - Projects using the legacy, non-SDK-style csproj format should use `Lombiq.Analyzers.NetFx` as described above, but the including project needs to use `PackageReference`s. You can convert your _packages.config_-based project to `PackageReference`s using [this walkthrough](https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference). 4. Now you can add this project to yours as explained above. 5. Introduce analyzers gradually unless it's a small project and you can fix every analyzer violation at once. To do this, only enable a handful of analyzers first (or enable them just for a couple of projects in a given solution), fix the violations, get used to them, then enable more later. See [the docs on configuring analyzers](ConfiguringAnalyzers.md) for how to do disable certain analyzers of the default configuration and thus activating analyzers in your code base gradually. We recommend enabling analyzers and fixing violations in at least three stages: 1. All the simpler rules, i.e. all rules except the ones in the next steps (that means, if you're working with the default configuration, to disable the rules mentioned in the next steps). These are quite straightforward to fix, to an extent can be done even automatically. It's the best if you group warnings by code in the Error List and fix them one by one, committing to the repository after completing each. It's better to batch this work in a way that you fix a particular type of warning for all projects of a solution at once, as opposed to fixing multiple type of warnings for just selected projects. This is because it's more efficient to just repeat the same kind of fix for all projects (can sometimes even be done automatically) in one go instead of revisiting it in multiple iterations. For tips on how to make fixing violations easier see [this page](UsingAnalyzersDuringDevelopment.md). diff --git a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md index a779dc55..7da36459 100644 --- a/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md +++ b/Lombiq.Analyzers/Docs/ConfiguringAnalyzers.md @@ -14,14 +14,14 @@ Place a _Directory.Build.props_ file into the project's folder (or folder with s ``` -This will completely disable code analysis packages. To also disable .NET SDK analysis override them from an _.editorconfig_ file placed into the given project's folder. There you can disable any unwanted rules, like disabling .NET code style analysis completely: +This will completely disable code analysis packages. To also disable .NET SDK analysis override them from an _.globalconfig_ file placed into the given project's folder. There you can disable any unwanted rules, like disabling .NET code style analysis completely: ```editorconfig [*.cs] dotnet_analyzer_diagnostic.category-Style.severity = none ``` -## How to disable analyzers during `dotnet build` +## How to disable all analyzers during `dotnet build` By default the `dotnet build` command runs analyzers and produces code analysis warnings if there are any but it makes the build slower. Pass the `/p:RunCodeAnalysis=false` parameter to disable analyzers during build, like: @@ -33,36 +33,19 @@ dotnet build MySolution.sln /p:RunCodeAnalysis=false If not all the configuration in this project is suitable for your solution then you can also override them globally. This way, the default configuration will be merged with your custom configuration and you can override any number of rules conveniently at one place for all projects in your solution. -### Overriding analyzer configuration from a ruleset file +### Overriding analyzer configuration from a _.globalconfig_ file -1. Create your own ruleset file, similar to this project's _general.ruleset_ file. Make sure the file name is all lower-case, because if you edit it in Visual Studio it will be converted anyway and that could cause problems on Unix-like systems. Add any rule configurations there that you want to override. Also, include this project's _general.ruleset_ file as a child, allowing its rules to be available by default. In the end you should have something like this (the included rules only serve as an example): +1. Create your own _.globalconfig_ file with your own rule configuration, similar to this project's _.globalconfig_ files (see [the official docs on this file format](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#global-analyzerconfig)). +2. Place the file into the folder under which you want the configuration to apply to all projects. +3. Now every rule you've configured in your _.globalconfig_ file will take precedence over the default ones. For everything else, the default ones will be applied. - ```xml - - - - - - - - - - - ``` +Note that if you add your _.globalconfig_ file to the solution you'll get GUI support for it in Visual Studio and you'll be able to configure rules without manually editing the configuration text. -2. In the _Directory.Build.props_ file of your solution add a reference to your own ruleset file, overriding the default: +More complex configuration is also available: - ```xml - - $(MSBuildThisFileDirectory)my.ruleset - - ``` - -3. Now every rule you've defined in _my.ruleset_ will take precedence over the default ones. For everything else, the default ones will be applied. - -Note that if you add your ruleset file to the solution you'll get GUI support for it in Visual Studio and you'll be able to configure rules without manually editing the XML. - -You can similarly add such `ruleset` files to subfolders, to just override rules for projects in that folder. +- You can similarly add such _.globalconfig_ files to subfolders, to just override rules for projects in that folder. +- Such files can be placed outside of the folder hierarchy too and referenced from csproj or props files with the `` element, see [the docs](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#naming). +- You can further adjust the precedence of _.globalconfig_ files with their names and the `global_level` entry, see [the docs](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/configuration-files#precedence). ### Suppressing analyzers from code for a whole project @@ -84,18 +67,14 @@ using System.Diagnostics.CodeAnalysis; ### Overriding _.editorconfig_ rules -You can't as easily do the same as with ruleset files with _.editorconfig_ rules. [It's not possible to define explicit inheritance between _.editorconfig_ files](https://github.com/editorconfig/editorconfig/issues/236) so [the only option is to use the folder hierarchy](https://stackoverflow.com/questions/58543855/can-visual-studio-use-an-editorconfig-not-in-the-directory-hierarchy/58556556#58556556): The _Build.props_ file of this project copies the default _.editorconfig_ file into the solution root. If you put your projects below that in the folder hierarchy and use your own _.editorconfig_ there then the latter will take precedence and you can override the default rules. E.g. you can override certain analyzer rules for a whole folder (even a folder within a project) like this: +You can't as easily do the same as with _.globalconfig_ files with _.editorconfig_ rules. [It's not possible to define explicit inheritance between _.editorconfig_ files](https://github.com/editorconfig/editorconfig/issues/236) so [the only option is to use the folder hierarchy](https://stackoverflow.com/questions/58543855/can-visual-studio-use-an-editorconfig-not-in-the-directory-hierarchy/58556556#58556556): The _Build.props_ files of this project copy the default _.editorconfig_ file into the solution root. If you put your projects below that in the folder hierarchy and use your own _.editorconfig_ there then the latter will take precedence and you can override the default rules. E.g. you can override certain analyzer rules for a whole folder (even a folder within a project) like this: ```editor-config -# C# files -[*.cs] +[*.{config,csproj,json,props,targets}] -# MA0016: Prefer return collection abstraction instead of implementation -dotnet_diagnostic.MA0016.severity = none +indent_size = 4 ``` -While eventually all analyzer rules in the .NET ecosystem will live in _.editorconfig_ this is not the case yet. However, you can override _.editorconfig_ rules from a ruleset file: You can open the ruleset file in Visual Studio and under the `Microsoft.CodeAnalysis.CSharp.Features` section you'll also be able to configure each IDE\* rule. - ### Overriding _stylecop.json_ and _SonarLint.xml_ configuration The project includes further configuration for `StyleCop.Analyzers` and `SonarAnalyzer.CSharp` in their own formats. These files are referenced as `` elements in the _props_ files corresponding to .NET Core or later and .NET Framework. From your own _Directory.Build.props_ file you need to recreate the contents of the original _props_ file but reference your custom configuration file instead. diff --git a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md index 52a7255a..4b6a1190 100644 --- a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md +++ b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringCommandLineBuilds.md @@ -18,7 +18,7 @@ dotnet build MySolution.sln --no-incremental /p:TreatWarningsAsErrors=true ## .NET code style analysis -If you want code style analysis configured in _.editorconfig_ (i.e. IDE\* rules, this is not applicable to the others) to be checked during build too (it's already checked during editing) then you'll need to run the build with `RunAnalyzersDuringBuild=true`. **Don't** enable `EnforceCodeStyleInBuild` as explained in [the docs](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#code-style-analysis) because that always uses the analyzers from the .NET SDK, not the explicitly referenced packages, and violations won't show up (see [this comment](https://github.com/dotnet/roslyn/issues/50785#issuecomment-768606882)). +If you want code style analysis configured in _.globalconfig_ (i.e. IDE\* rules, this is not applicable to the others) to be checked during build too (it's already checked during editing) then you'll need to run the build with `RunAnalyzersDuringBuild=true`. **Don't** enable `EnforceCodeStyleInBuild` as explained in [the docs](https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#code-style-analysis) because that always uses the analyzers from the .NET SDK, not the explicitly referenced packages, and violations won't show up (see [this comment](https://github.com/dotnet/roslyn/issues/50785#issuecomment-768606882)). ```ps dotnet build MySolution.sln --no-incremental /p:RunAnalyzersDuringBuild=true diff --git a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md index bcd02127..1b7fa89e 100644 --- a/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md +++ b/Lombiq.Analyzers/Docs/UsingAnalyzersDuringDevelopment.md @@ -3,12 +3,12 @@ ## Working with analyzers in Visual Studio or another IDE - Output of the analyzers will show up as entries of various levels (i.e. Errors, Warnings, Messages) in the Error List window of Visual Studio for the currently open files (the error codes will link to more info on the violations). You'll also see squiggly lines in the code editor as it is usual for any code issues. -- For a lot of issues you'll be able to use automatic code fixes, or suppress them if they're wrong in the given context from the Visual Studio Quick Actions menu (Ctrl + . by default). The [Productivity Power Tools](https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.ProductivityPowerPack2017) Visual Studio extension can remove and order namespace imports, as well as format the document when saving (just enable its "Format document on save" option). [CodeMaid](https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid) can similarly format whole projects or even the full solution at once. The command-line [`dotnet-format`](https://github.com/dotnet/format) can fix all issues that can be fixed automatically. -- The _Build.props_ (for .NET Framework projects, _NetFx.Build.props_) file disables analyzers during Visual Studio build, not to slow down development; you can enable them by setting `RunAnalyzersDuringBuild` to `true`. After this, they'll show for the whole solution after a rebuild (but not when you build an already built solution, just with a rebuild or a fresh build). +- For a lot of issues you'll be able to use automatic code fixes, or suppress them if they're wrong in the given context from the Visual Studio Quick Actions menu (Ctrl + . by default). The [Productivity Power Tools](https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.ProductivityPowerPack2022) Visual Studio extension can remove and order namespace imports, as well as format the document when saving (just enable its "Format document on save" option). [CodeMaid](https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid) can similarly format whole projects or even the full solution at once. The command-line [`dotnet-format`](https://github.com/dotnet/format) can fix all issues that can be fixed automatically. +- The _Build.props_ files disable analyzers during Visual Studio build, not to slow down development; you can enable them by setting `RunAnalyzersDuringBuild` to `true`. After this, they'll show for the whole solution after a rebuild (but not when you build an already built solution, just with a rebuild or a fresh build). - When working on reducing cognitive complexity to pass the [S3776 rule](https://rules.sonarsource.com/csharp/RSPEC-3776/) you can make use of the [CognitiveComplexity plugin for JetBrains Rider](https://plugins.jetbrains.com/plugin/12024-cognitivecomplexity) or the [ReSharper plugin of the same name](https://plugins.jetbrains.com/plugin/12391-cognitivecomplexity) for Visual Studio. It annotates the individual contributors to the cognitive complexity score so you can quickly identify trouble spots with the least effort. The scoring algorithm is not 100% identical to the one used in Sonar but it's similar enough to greatly speed up the task of refactoring complex methods. - The following VS extensions fit nicely into an analyzer-aided developer workflow: - [Rewrap](https://marketplace.visualstudio.com/items?itemName=stkb.Rewrap-18980) helps you wrap comment text at a character limit you can change in the settings. We recommend this to be set to 120. - - [Editor Guidelines](https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelines) displays the column guidelines defined in our editor config. + - [Editor Guidelines](https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview) displays the column guidelines defined in our editor config. ## Practices on suppressing a rule for a given piece of code diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.csproj b/Lombiq.Analyzers/Lombiq.Analyzers.csproj index 1335deb9..a16ea83f 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.csproj +++ b/Lombiq.Analyzers/Lombiq.Analyzers.csproj @@ -10,18 +10,18 @@ - + - + diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig b/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig new file mode 100644 index 00000000..6aa96246 --- /dev/null +++ b/Lombiq.Analyzers/Lombiq.Analyzers.globalconfig @@ -0,0 +1,661 @@ +is_global = true +global_level = 0 + +# General code analysis rules for any .NET and .NET Framework project. + +# To get Visual Studio GUI support for configuring these rules, put it into the solution's startup project's folder and +# rename it to .editorconfig. This should eventually not be necessary, see https://github.com/dotnet/roslyn/issues/70326. + +# Start code style preferences + +# Check out possible configs here: +# https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false + +# this. and Me. preferences +dotnet_style_qualification_for_event = false:warning +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_property = false:warning + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = always:warning + +# Expression-level preferences +dotnet_style_coalesce_expression = true:warning +dotnet_style_collection_initializer = true:warning +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_null_propagation = true:warning +dotnet_style_object_initializer = true:warning +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true:warning +dotnet_style_prefer_compound_assignment = true:warning +dotnet_style_prefer_conditional_expression_over_assignment = true:warning +dotnet_style_prefer_conditional_expression_over_return = false +dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:warning +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning +dotnet_style_prefer_simplified_interpolation = true:warning + +# Field preferences +dotnet_style_readonly_field = true:warning + +# Parameter preferences +dotnet_code_quality_unused_parameters = non_pubic:suggestion + +# Note that currently both IDE* rules and csharp_style_* rules are necessary, because only IDE rules will be enforced +# during build, see: https://github.com/dotnet/roslyn/issues/44201. + +# Default severity for analyzer diagnostics for all categories (escalated to build warnings). See +# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/categories for the list of categories. +dotnet_analyzer_diagnostic.category-Design.severity = warning +dotnet_analyzer_diagnostic.category-Documentation.severity = warning +dotnet_analyzer_diagnostic.category-Globalization.severity = warning +dotnet_analyzer_diagnostic.category-Interoperability.severity = warning +dotnet_analyzer_diagnostic.category-Maintainability.severity = warning +dotnet_analyzer_diagnostic.category-Naming.severity = warning +dotnet_analyzer_diagnostic.category-Performance.severity = warning +dotnet_analyzer_diagnostic.category-SingleFile.severity = warning +dotnet_analyzer_diagnostic.category-Reliability.severity = warning +dotnet_analyzer_diagnostic.category-Security.severity = warning +dotnet_analyzer_diagnostic.category-Style.severity = warning +dotnet_analyzer_diagnostic.category-Usage.severity = warning +dotnet_analyzer_diagnostic.category-CodeQuality.severity = warning + +# IDE0011: Add braces to 'if' statement. +# The "when-multiline:warning" config is not actually for cases when the if body is in another line so we have to turn +# this off completely, see: https://github.com/dotnet/roslyn/issues/40912. +dotnet_diagnostic.IDE0011.severity = none +# IDE0050: Convert to tuple +# Quite dangerous as we most frequently use anonymous types to interface with other APIs (like generating routes) and +# those can fail on this silently in runtime while building correctly. +dotnet_diagnostic.IDE0050.severity = none +# IDE0052: Private member can be removed as the value assigned to it is never used. +# We use S4487 for that. +dotnet_diagnostic.IDE0052.severity = none +# IDE0072: Populate switch +# Also signals on switches with discards, by design: https://github.com/dotnet/roslyn/issues/48876. +dotnet_diagnostic.IDE0072.severity = none +# "Namespace 'Foo' does not match folder structure, expected 'Foo'" +dotnet_diagnostic.IDE0130.severity = none + +# While these are in the Style category, they need to be explicitly set for some reason. +# IDE0079 Remove unnecessary suppression +dotnet_diagnostic.IDE0079.severity = warning +dotnet_diagnostic.IDE0022.severity = warning + +# 'var' preferences +dotnet_diagnostic.IDE0007.severity = warning +dotnet_diagnostic.IDE0008.severity = none +# These won't take effect during build due to this bug: https://github.com/dotnet/roslyn/issues/44250. +csharp_style_var_elsewhere = true:warning +# If this is not turned off then there will be messages for e.g. integers too, like in for loops. +csharp_style_var_for_built_in_types = false:none +csharp_style_var_when_type_is_apparent = true:warning + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true:warning +csharp_style_expression_bodied_constructors = true:warning +csharp_style_expression_bodied_indexers = true:warning +csharp_style_expression_bodied_lambdas = true:warning +csharp_style_expression_bodied_local_functions = true:warning +csharp_style_expression_bodied_methods = true:warning +csharp_style_expression_bodied_operators = true:warning +csharp_style_expression_bodied_properties = true:warning + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true:warning +csharp_style_pattern_matching_over_is_with_cast_check = true:warning +csharp_style_prefer_switch_expression = true:warning + +# Null-checking preferences +csharp_style_conditional_delegate_call = true:warning + +# Modifier preferences +csharp_prefer_static_local_function = true:warning +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent + +# Code-block preferences +csharp_prefer_simple_using_statement = true:warning +# IDE0160: Convert to block-scoped namespace +csharp_style_namespace_declarations = file_scoped:warning + +# Expression-level preferences +csharp_prefer_simple_default_expression = true:warning +csharp_style_deconstructed_variable_declaration = false:silent #spell-check-ignore-line +csharp_style_inlined_variable_declaration = true:warning +csharp_style_pattern_local_over_anonymous_function = true:warning +csharp_style_prefer_index_operator = true:warning +csharp_style_prefer_range_operator = true:warning +csharp_style_throw_expression = true:warning +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:none + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace:silent + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = all +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_labels = no_change +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +# Naming rules +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = * +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = * +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = * +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case + +# Don't apply "CA1822: Mark members as static" to the public API +dotnet_code_quality.CA1822.api_surface = private, internal +csharp_prefer_braces = true:silent + +# End code style preferences + +# DotNetAnalyzers.DocumentationAnalyzers rules +dotnet_diagnostic.DOC100.severity = warning +dotnet_diagnostic.DOC101.severity = warning +dotnet_diagnostic.DOC102.severity = warning +dotnet_diagnostic.DOC103.severity = warning +dotnet_diagnostic.DOC104.severity = warning +dotnet_diagnostic.DOC105.severity = warning +dotnet_diagnostic.DOC106.severity = warning +dotnet_diagnostic.DOC107.severity = warning +dotnet_diagnostic.DOC108.severity = warning +dotnet_diagnostic.DOC200.severity = warning +dotnet_diagnostic.DOC201.severity = warning +dotnet_diagnostic.DOC202.severity = warning +dotnet_diagnostic.DOC203.severity = warning +dotnet_diagnostic.DOC204.severity = warning + +# Microsoft.CodeAnalysis.CSharp rules +dotnet_diagnostic.CS1573.severity = none +# We don't want to decorate every public member with XML comments, only public APIs - so turn CS1591 off. +# CS1591 Missing XML Comment for publicly visible type or member +dotnet_diagnostic.CS1591.severity = none + +# Microsoft.CodeAnalysis.NetAnalyzers rules +dotnet_diagnostic.CA1000.severity = warning +dotnet_diagnostic.CA1001.severity = warning +dotnet_diagnostic.CA1002.severity = silent +dotnet_diagnostic.CA1008.severity = warning +dotnet_diagnostic.CA1010.severity = warning +dotnet_diagnostic.CA1012.severity = warning +dotnet_diagnostic.CA1016.severity = warning +dotnet_diagnostic.CA1018.severity = warning +dotnet_diagnostic.CA1024.severity = warning +dotnet_diagnostic.CA1027.severity = warning +dotnet_diagnostic.CA1028.severity = warning +dotnet_diagnostic.CA1030.severity = warning +# Disabling "catch a more specific exception type" suggestion which is overwhelmingly a false positive. +dotnet_diagnostic.CA1031.severity = silent +dotnet_diagnostic.CA1032.severity = warning +dotnet_diagnostic.CA1033.severity = warning +# Disabling "do not nest type" suggestion. +dotnet_diagnostic.CA1034.severity = silent +dotnet_diagnostic.CA1036.severity = warning +dotnet_diagnostic.CA1041.severity = warning +dotnet_diagnostic.CA1043.severity = silent +dotnet_diagnostic.CA1044.severity = warning +dotnet_diagnostic.CA1050.severity = warning +dotnet_diagnostic.CA1051.severity = silent +dotnet_diagnostic.CA1052.severity = warning +dotnet_diagnostic.CA1054.severity = silent +dotnet_diagnostic.CA1055.severity = warning +dotnet_diagnostic.CA1056.severity = silent +dotnet_diagnostic.CA1058.severity = warning +dotnet_diagnostic.CA1061.severity = warning +dotnet_diagnostic.CA1063.severity = warning +dotnet_diagnostic.CA1064.severity = warning +dotnet_diagnostic.CA1065.severity = warning +dotnet_diagnostic.CA1066.severity = warning +dotnet_diagnostic.CA1067.severity = warning +dotnet_diagnostic.CA1068.severity = warning +dotnet_diagnostic.CA1069.severity = warning +dotnet_diagnostic.CA1070.severity = warning +dotnet_diagnostic.CA1200.severity = warning +dotnet_diagnostic.CA1304.severity = warning +dotnet_diagnostic.CA1305.severity = warning +dotnet_diagnostic.CA1307.severity = silent +dotnet_diagnostic.CA1308.severity = warning +dotnet_diagnostic.CA1309.severity = warning +dotnet_diagnostic.CA1310.severity = warning +dotnet_diagnostic.CA1401.severity = warning +dotnet_diagnostic.CA1507.severity = warning +dotnet_diagnostic.CA1508.severity = silent +dotnet_diagnostic.CA1712.severity = warning +dotnet_diagnostic.CA1713.severity = warning +dotnet_diagnostic.CA1715.severity = warning +dotnet_diagnostic.CA1720.severity = warning +dotnet_diagnostic.CA1721.severity = warning +dotnet_diagnostic.CA1801.severity = warning +dotnet_diagnostic.CA1802.severity = warning +dotnet_diagnostic.CA1805.severity = warning +dotnet_diagnostic.CA1806.severity = warning +# Disabling "CA1810: Initialize reference type static fields inline" as RSPEC-3963 is used instead. +dotnet_diagnostic.CA1810.severity = none +dotnet_diagnostic.CA1813.severity = warning +dotnet_diagnostic.CA1814.severity = warning +dotnet_diagnostic.CA1815.severity = warning +dotnet_diagnostic.CA1816.severity = warning +dotnet_diagnostic.CA1820.severity = warning +dotnet_diagnostic.CA1821.severity = warning +dotnet_diagnostic.CA1822.severity = warning +dotnet_diagnostic.CA1823.severity = warning +dotnet_diagnostic.CA1824.severity = warning +dotnet_diagnostic.CA1825.severity = warning +dotnet_diagnostic.CA1826.severity = none +dotnet_diagnostic.CA1827.severity = none +dotnet_diagnostic.CA1828.severity = warning +dotnet_diagnostic.CA1829.severity = warning +dotnet_diagnostic.CA1830.severity = warning +dotnet_diagnostic.CA1832.severity = warning +dotnet_diagnostic.CA1833.severity = warning +dotnet_diagnostic.CA1834.severity = warning +dotnet_diagnostic.CA1835.severity = warning +dotnet_diagnostic.CA1836.severity = warning +dotnet_diagnostic.CA1837.severity = warning +dotnet_diagnostic.CA1838.severity = warning +dotnet_diagnostic.CA1851.severity = warning +dotnet_diagnostic.CA2000.severity = warning +dotnet_diagnostic.CA2002.severity = warning +dotnet_diagnostic.CA2007.severity = warning +dotnet_diagnostic.CA2008.severity = warning +dotnet_diagnostic.CA2009.severity = warning +dotnet_diagnostic.CA2011.severity = warning +dotnet_diagnostic.CA2012.severity = warning +dotnet_diagnostic.CA2016.severity = none +dotnet_diagnostic.CA2100.severity = warning +dotnet_diagnostic.CA2101.severity = warning +dotnet_diagnostic.CA2119.severity = warning +dotnet_diagnostic.CA2153.severity = warning +dotnet_diagnostic.CA2201.severity = warning +dotnet_diagnostic.CA2207.severity = warning +dotnet_diagnostic.CA2208.severity = warning +dotnet_diagnostic.CA2211.severity = warning +dotnet_diagnostic.CA2213.severity = warning +dotnet_diagnostic.CA2214.severity = warning +dotnet_diagnostic.CA2215.severity = warning +dotnet_diagnostic.CA2216.severity = warning +dotnet_diagnostic.CA2217.severity = warning +dotnet_diagnostic.CA2219.severity = warning +dotnet_diagnostic.CA2225.severity = silent +dotnet_diagnostic.CA2226.severity = warning +dotnet_diagnostic.CA2227.severity = warning +dotnet_diagnostic.CA2229.severity = warning +dotnet_diagnostic.CA2231.severity = warning +dotnet_diagnostic.CA2234.severity = silent +dotnet_diagnostic.CA2235.severity = warning +dotnet_diagnostic.CA2237.severity = warning +dotnet_diagnostic.CA2241.severity = warning +dotnet_diagnostic.CA2242.severity = warning +dotnet_diagnostic.CA2243.severity = warning +dotnet_diagnostic.CA2244.severity = warning +dotnet_diagnostic.CA2245.severity = warning +dotnet_diagnostic.CA2246.severity = warning +dotnet_diagnostic.CA2248.severity = warning +dotnet_diagnostic.CA2249.severity = warning +dotnet_diagnostic.CA2300.severity = warning +dotnet_diagnostic.CA2301.severity = warning +dotnet_diagnostic.CA2302.severity = warning +dotnet_diagnostic.CA2305.severity = warning +dotnet_diagnostic.CA2310.severity = warning +dotnet_diagnostic.CA2311.severity = warning +dotnet_diagnostic.CA2312.severity = warning +dotnet_diagnostic.CA2315.severity = warning +dotnet_diagnostic.CA2321.severity = warning +dotnet_diagnostic.CA2322.severity = warning +dotnet_diagnostic.CA2326.severity = warning +dotnet_diagnostic.CA2327.severity = warning +dotnet_diagnostic.CA2328.severity = warning +dotnet_diagnostic.CA2329.severity = warning +dotnet_diagnostic.CA2330.severity = warning +dotnet_diagnostic.CA2350.severity = warning +dotnet_diagnostic.CA2351.severity = warning +dotnet_diagnostic.CA2352.severity = warning +dotnet_diagnostic.CA2353.severity = warning +dotnet_diagnostic.CA2354.severity = warning +dotnet_diagnostic.CA2355.severity = warning +dotnet_diagnostic.CA2356.severity = warning +dotnet_diagnostic.CA2361.severity = warning +dotnet_diagnostic.CA2362.severity = warning +dotnet_diagnostic.CA3001.severity = warning +dotnet_diagnostic.CA3002.severity = warning +dotnet_diagnostic.CA3003.severity = warning +dotnet_diagnostic.CA3004.severity = warning +dotnet_diagnostic.CA3005.severity = warning +dotnet_diagnostic.CA3006.severity = warning +dotnet_diagnostic.CA3007.severity = warning +dotnet_diagnostic.CA3008.severity = warning +dotnet_diagnostic.CA3009.severity = warning +dotnet_diagnostic.CA3010.severity = warning +dotnet_diagnostic.CA3011.severity = warning +dotnet_diagnostic.CA3012.severity = warning +dotnet_diagnostic.CA3061.severity = warning +dotnet_diagnostic.CA3075.severity = warning +dotnet_diagnostic.CA3076.severity = warning +dotnet_diagnostic.CA3077.severity = warning +dotnet_diagnostic.CA3147.severity = warning +dotnet_diagnostic.CA5350.severity = warning +dotnet_diagnostic.CA5351.severity = warning +dotnet_diagnostic.CA5358.severity = warning +dotnet_diagnostic.CA5359.severity = warning +dotnet_diagnostic.CA5360.severity = warning +dotnet_diagnostic.CA5361.severity = warning +dotnet_diagnostic.CA5362.severity = warning +dotnet_diagnostic.CA5363.severity = warning +dotnet_diagnostic.CA5364.severity = warning +dotnet_diagnostic.CA5365.severity = warning +dotnet_diagnostic.CA5366.severity = warning +dotnet_diagnostic.CA5367.severity = warning +dotnet_diagnostic.CA5368.severity = warning +dotnet_diagnostic.CA5369.severity = warning +dotnet_diagnostic.CA5370.severity = warning +dotnet_diagnostic.CA5371.severity = warning +dotnet_diagnostic.CA5372.severity = warning +dotnet_diagnostic.CA5373.severity = warning +dotnet_diagnostic.CA5374.severity = warning +dotnet_diagnostic.CA5375.severity = warning +dotnet_diagnostic.CA5376.severity = warning +dotnet_diagnostic.CA5377.severity = warning +dotnet_diagnostic.CA5378.severity = warning +dotnet_diagnostic.CA5379.severity = warning +dotnet_diagnostic.CA5380.severity = warning +dotnet_diagnostic.CA5381.severity = warning +dotnet_diagnostic.CA5382.severity = warning +dotnet_diagnostic.CA5383.severity = warning +dotnet_diagnostic.CA5384.severity = warning +dotnet_diagnostic.CA5385.severity = warning +dotnet_diagnostic.CA5386.severity = warning +dotnet_diagnostic.CA5387.severity = warning +dotnet_diagnostic.CA5388.severity = warning +dotnet_diagnostic.CA5389.severity = warning +dotnet_diagnostic.CA5390.severity = warning +dotnet_diagnostic.CA5392.severity = warning +dotnet_diagnostic.CA5393.severity = warning +dotnet_diagnostic.CA5394.severity = warning +dotnet_diagnostic.CA5396.severity = warning +dotnet_diagnostic.CA5397.severity = warning +dotnet_diagnostic.CA5398.severity = warning +dotnet_diagnostic.CA5399.severity = warning +dotnet_diagnostic.CA5400.severity = warning +dotnet_diagnostic.CA5401.severity = warning +dotnet_diagnostic.CA5402.severity = warning +dotnet_diagnostic.CA5403.severity = warning + +# Microsoft.VisualStudio.Threading.Analyzers rules +dotnet_diagnostic.VSTHRD002.severity = none +dotnet_diagnostic.VSTHRD102.severity = warning +dotnet_diagnostic.VSTHRD104.severity = warning +dotnet_diagnostic.VSTHRD109.severity = warning +dotnet_diagnostic.VSTHRD111.severity = none +dotnet_diagnostic.VSTHRD112.severity = warning +dotnet_diagnostic.VSTHRD113.severity = warning +dotnet_diagnostic.VSTHRD200.severity = none + +# Meziantou.Analyzer rules +dotnet_diagnostic.MA0001.severity = none +dotnet_diagnostic.MA0002.severity = none +dotnet_diagnostic.MA0003.severity = warning +dotnet_diagnostic.MA0004.severity = none +dotnet_diagnostic.MA0005.severity = none +dotnet_diagnostic.MA0006.severity = none +dotnet_diagnostic.MA0007.severity = none +dotnet_diagnostic.MA0011.severity = none +dotnet_diagnostic.MA0012.severity = none +dotnet_diagnostic.MA0013.severity = none +dotnet_diagnostic.MA0015.severity = none +dotnet_diagnostic.MA0018.severity = none +dotnet_diagnostic.MA0020.severity = none +dotnet_diagnostic.MA0027.severity = none +dotnet_diagnostic.MA0028.severity = none +dotnet_diagnostic.MA0029.severity = none +dotnet_diagnostic.MA0031.severity = none +dotnet_diagnostic.MA0036.severity = none +dotnet_diagnostic.MA0037.severity = none +dotnet_diagnostic.MA0038.severity = none +dotnet_diagnostic.MA0039.severity = none +dotnet_diagnostic.MA0040.severity = warning +dotnet_diagnostic.MA0041.severity = none +dotnet_diagnostic.MA0042.severity = none +dotnet_diagnostic.MA0043.severity = none +dotnet_diagnostic.MA0044.severity = none +dotnet_diagnostic.MA0047.severity = none +dotnet_diagnostic.MA0048.severity = none +dotnet_diagnostic.MA0049.severity = none +dotnet_diagnostic.MA0050.severity = warning +dotnet_diagnostic.MA0051.severity = none +dotnet_diagnostic.MA0052.severity = none +dotnet_diagnostic.MA0053.severity = none +dotnet_diagnostic.MA0056.severity = none +dotnet_diagnostic.MA0057.severity = none +dotnet_diagnostic.MA0058.severity = none +dotnet_diagnostic.MA0059.severity = none +dotnet_diagnostic.MA0062.severity = none +dotnet_diagnostic.MA0063.severity = warning +dotnet_diagnostic.MA0065.severity = none +dotnet_diagnostic.MA0066.severity = none +dotnet_diagnostic.MA0067.severity = warning +dotnet_diagnostic.MA0069.severity = none +dotnet_diagnostic.MA0071.severity = warning +dotnet_diagnostic.MA0072.severity = none +dotnet_diagnostic.MA0073.severity = none +dotnet_diagnostic.MA0074.severity = none +dotnet_diagnostic.MA0075.severity = warning +dotnet_diagnostic.MA0076.severity = warning +dotnet_diagnostic.MA0078.severity = warning +dotnet_diagnostic.MA0079.severity = warning +dotnet_diagnostic.MA0082.severity = none +dotnet_diagnostic.MA0086.severity = none +dotnet_diagnostic.MA0089.severity = warning +dotnet_diagnostic.MA0090.severity = none +dotnet_diagnostic.MA0095.severity = none +dotnet_diagnostic.MA0097.severity = none +dotnet_diagnostic.MA0098.severity = none +dotnet_diagnostic.MA0101.severity = none +dotnet_diagnostic.MA0102.severity = none +dotnet_diagnostic.MA0105.severity = warning +dotnet_diagnostic.MA0106.severity = none +dotnet_diagnostic.MA0111.severity = none +dotnet_diagnostic.MA0120.severity = warning +dotnet_diagnostic.MA0121.severity = warning +dotnet_diagnostic.MA0122.severity = warning + +# SonarAnalyzer.CSharp rules +dotnet_diagnostic.S100.severity = warning +dotnet_diagnostic.S103.severity = warning +dotnet_diagnostic.S104.severity = warning +dotnet_diagnostic.S105.severity = warning +dotnet_diagnostic.S106.severity = warning +dotnet_diagnostic.S107.severity = warning +dotnet_diagnostic.S1075.severity = none +dotnet_diagnostic.S1109.severity = warning +dotnet_diagnostic.S113.severity = warning +dotnet_diagnostic.S1133.severity = none +dotnet_diagnostic.S1144.severity = warning +dotnet_diagnostic.S1145.severity = warning +dotnet_diagnostic.S1147.severity = warning +dotnet_diagnostic.S1151.severity = warning +dotnet_diagnostic.S1192.severity = warning +dotnet_diagnostic.S1226.severity = warning +dotnet_diagnostic.S1227.severity = warning +dotnet_diagnostic.S1244.severity = warning +dotnet_diagnostic.S127.severity = warning +dotnet_diagnostic.S1301.severity = warning +dotnet_diagnostic.S131.severity = warning +dotnet_diagnostic.S134.severity = warning +dotnet_diagnostic.S1696.severity = warning +dotnet_diagnostic.S1698.severity = warning +dotnet_diagnostic.S1858.severity = warning +dotnet_diagnostic.S2148.severity = warning +dotnet_diagnostic.S2197.severity = warning +dotnet_diagnostic.S2278.severity = warning +dotnet_diagnostic.S2302.severity = warning +dotnet_diagnostic.S2330.severity = warning +dotnet_diagnostic.S2333.severity = warning +dotnet_diagnostic.S2342.severity = warning +dotnet_diagnostic.S2357.severity = warning +dotnet_diagnostic.S2387.severity = warning +dotnet_diagnostic.S2437.severity = warning +dotnet_diagnostic.S2699.severity = none +dotnet_diagnostic.S2701.severity = warning +dotnet_diagnostic.S2760.severity = warning +dotnet_diagnostic.S2952.severity = warning +dotnet_diagnostic.S2955.severity = warning +dotnet_diagnostic.S3052.severity = warning +dotnet_diagnostic.S3215.severity = warning +dotnet_diagnostic.S3234.severity = warning +dotnet_diagnostic.S3235.severity = warning +dotnet_diagnostic.S3240.severity = warning +dotnet_diagnostic.S3253.severity = warning +dotnet_diagnostic.S3254.severity = warning +dotnet_diagnostic.S3257.severity = warning +dotnet_diagnostic.S3353.severity = warning +dotnet_diagnostic.S3366.severity = warning +dotnet_diagnostic.S3376.severity = none +dotnet_diagnostic.S3441.severity = warning +dotnet_diagnostic.S3458.severity = none +dotnet_diagnostic.S3532.severity = warning +dotnet_diagnostic.S3626.severity = none +dotnet_diagnostic.S3693.severity = warning +dotnet_diagnostic.S3717.severity = warning +dotnet_diagnostic.S3776.severity = warning +dotnet_diagnostic.S3872.severity = warning +dotnet_diagnostic.S3880.severity = warning +dotnet_diagnostic.S3898.severity = warning +dotnet_diagnostic.S3902.severity = warning +dotnet_diagnostic.S3903.severity = none +dotnet_diagnostic.S3906.severity = warning +dotnet_diagnostic.S3908.severity = warning +dotnet_diagnostic.S3937.severity = warning +dotnet_diagnostic.S3949.severity = warning +dotnet_diagnostic.S3962.severity = warning +dotnet_diagnostic.S3963.severity = none +dotnet_diagnostic.S4002.severity = warning +dotnet_diagnostic.S4025.severity = warning +dotnet_diagnostic.S4041.severity = warning +dotnet_diagnostic.S4047.severity = warning +dotnet_diagnostic.S4052.severity = warning +dotnet_diagnostic.S4212.severity = warning +dotnet_diagnostic.S4225.severity = warning +dotnet_diagnostic.S4226.severity = warning +dotnet_diagnostic.S4261.severity = warning +dotnet_diagnostic.S4432.severity = warning +dotnet_diagnostic.S4487.severity = warning +dotnet_diagnostic.S4564.severity = warning +dotnet_diagnostic.S881.severity = warning + +# StyleCop.Analyzers rules +dotnet_diagnostic.SA0001.severity = none +dotnet_diagnostic.SA1009.severity = none +dotnet_diagnostic.SA1101.severity = none +dotnet_diagnostic.SA1111.severity = none +dotnet_diagnostic.SA1118.severity = none +dotnet_diagnostic.SA1124.severity = none +dotnet_diagnostic.SA1133.severity = none +dotnet_diagnostic.SA1200.severity = none +dotnet_diagnostic.SA1204.severity = none +dotnet_diagnostic.SA1208.severity = none +dotnet_diagnostic.SA1306.severity = none +dotnet_diagnostic.SA1309.severity = none +dotnet_diagnostic.SA1401.severity = none +dotnet_diagnostic.SA1402.severity = none +dotnet_diagnostic.SA1501.severity = none +dotnet_diagnostic.SA1502.severity = none +dotnet_diagnostic.SA1503.severity = none +dotnet_diagnostic.SA1512.severity = none +dotnet_diagnostic.SA1515.severity = none +dotnet_diagnostic.SA1516.severity = none +dotnet_diagnostic.SA1519.severity = none +dotnet_diagnostic.SA1601.severity = none +dotnet_diagnostic.SA1602.severity = none +dotnet_diagnostic.SA1611.severity = none +dotnet_diagnostic.SA1612.severity = none +dotnet_diagnostic.SA1615.severity = none +dotnet_diagnostic.SA1633.severity = none +dotnet_diagnostic.SA1649.severity = none +dotnet_diagnostic.SX1101.severity = warning +dotnet_diagnostic.SX1309S.severity = warning diff --git a/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template b/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template index 4763c806..813da85e 100644 --- a/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template +++ b/Lombiq.Analyzers/Lombiq.Analyzers.nuspec.template @@ -8,14 +8,15 @@ License.md https://aka.ms/deprecateLicenseUrl NuGetIcon.png - https://github.com/Lombiq/.NET-Analyzers - Lombiq .NET Analyzers: .NET code analyzers and code convention settings for Lombiq (https://lombiq.com) projects, predominantly for Orchard Core (https://orchardcore.net/) apps but also any .NET apps. See the project website for detailed documentation. + https://github.com/Lombiq/.NET-Analyzers/blob/dev/Lombiq.Analyzers + Lombiq .NET Analyzers: .NET code analyzers and code convention settings for general .NET projects. See the project website for detailed documentation. Copyright © 2020, Lombiq Technologies Ltd. - OrchardCore Lombiq AspNetCore CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop + Lombiq CodeAnalysis DotNetAnalyzers Analyzer Analyzers Diagnostic Roslyn Refactoring AsyncFixer Meziantou.Analyzer StyleCop - + + true - + all diff --git a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj index eee58ccf..cc1ccf18 100644 --- a/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.PackageReference/Lombiq.Analyzers.PackageReference.csproj @@ -5,7 +5,7 @@ - + all diff --git a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj index 19f387d4..2ab55bcf 100644 --- a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj +++ b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.csproj @@ -1,6 +1,6 @@ - + net6.0 diff --git a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln index 80f6336c..6578ecc8 100644 --- a/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln +++ b/TestSolutions/Lombiq.Analyzers.ProjectReference/Lombiq.Analyzers.ProjectReference.sln @@ -1,25 +1,24 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30114.105 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34202.233 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.Analyzers.ProjectReference", "Lombiq.Analyzers.ProjectReference.csproj", "{E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.ProjectReference", "Lombiq.Analyzers.ProjectReference.csproj", "{E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lombiq.Analyzers", "..\..\Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{E4090872-11F2-49D1-A746-65E15DC4977E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers", "..\..\Lombiq.Analyzers\Lombiq.Analyzers.csproj", "{E4090872-11F2-49D1-A746-65E15DC4977E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CE857933-4E64-44B8-A1CA-3489F88475AB}" ProjectSection(SolutionItems) = preProject ..\Directory.Build.props = ..\Directory.Build.props EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lombiq.Analyzers.OrchardCore", "..\..\Lombiq.Analyzers.OrchardCore\Lombiq.Analyzers.OrchardCore.csproj", "{E1189194-7972-4A65-BFD5-82B55F17763D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E43F83B6-F5D0-4FD9-AD3D-2FB071B777A6}.Debug|Any CPU.Build.0 = Debug|Any CPU @@ -29,5 +28,12 @@ Global {E4090872-11F2-49D1-A746-65E15DC4977E}.Debug|Any CPU.Build.0 = Debug|Any CPU {E4090872-11F2-49D1-A746-65E15DC4977E}.Release|Any CPU.ActiveCfg = Release|Any CPU {E4090872-11F2-49D1-A746-65E15DC4977E}.Release|Any CPU.Build.0 = Release|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1189194-7972-4A65-BFD5-82B55F17763D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal