Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-606: Upgrade to C# 11 #86

Merged
merged 16 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Lombiq.Analyzers/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)orchardcore.ruleset</CodeAnalysisRuleSet>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Don't run analyzers during Visual Studio build, not to slow down development. They still run during dotnet build.
By making this conditional, it won't overwrite the value if you set it in the Directory.Build.props file. For
Rider users: https://youtrack.jetbrains.com/issue/RIDER-80579 -->
<RunAnalyzersDuringBuild Condition="'$(RunAnalyzersDuringBuild)' != 'true'">false</RunAnalyzersDuringBuild>
<!-- Don't run analyzers during Visual Studio build, not to slow down development. They still run during dotnet
build. By making this conditional, it won't overwrite the value if you set it in the Directory.Build.props
file. For Rider users: https://youtrack.jetbrains.com/issue/RIDER-80579 -->
0liver marked this conversation as resolved.
Show resolved Hide resolved
<!-- Needed for project targeting versions earlier than .NET 5. Only works with .NET Core and later projects, see:
https://docs.microsoft.com/en-us/dotnet/core/project-sdk/overview.
Note that this is not needed if the Microsoft.CodeAnalysis.NetAnalyzers NuGet package is installed. -->
<!-- <EnableNETAnalyzers>true</EnableNETAnalyzers> -->
<!-- Strict mode for the C# compiler, see: https://www.meziantou.net/csharp-compiler-strict-mode.htm. -->
<Features>strict</Features>
<!-- Useful to set here since the language version affects which analyzers to use and how to configure them. -->
<LangVersion>10.0</LangVersion>
<LangVersion>11.0</LangVersion>
<!-- Setting the analysis level explicitly lets us opt in to new analyzers with SDK upgrades. See:
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#latest-updates -->
<AnalysisLevel>6.0</AnalysisLevel>
<AnalysisLevel>7.0</AnalysisLevel>
<!-- This is for Microsoft.CodeAnalysis.NetAnalyzers. This way, we have control over it unlike when getting it
via the .NET SDK. See: https://docs.microsoft.com/en-us/visualstudio/code-quality/migrate-from-fxcop-analyzers-to-net-analyzers
.NET code style analysis is not working with .NET 5 though, see: https://github.com/dotnet/roslyn/issues/33558#issuecomment-867346974. -->
Expand Down
10 changes: 5 additions & 5 deletions Lombiq.Analyzers/CommonPackages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<ItemGroup>
<AnalyzerPackage Include="AsyncFixer" Version="1.6.0"/>
<AnalyzerPackage Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59"/>
<AnalyzerPackage Include="Meziantou.Analyzer" Version="2.0.5"/>
<AnalyzerPackage Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.4.0"/>
<AnalyzerPackage Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0"/>
<AnalyzerPackage Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.4.33"/>
<AnalyzerPackage Include="Meziantou.Analyzer" Version="2.0.56"/>
<AnalyzerPackage Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.6.0"/>
<AnalyzerPackage Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.1"/>
<AnalyzerPackage Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.6.40"/>
<AnalyzerPackage Include="SecurityCodeScan.VS2019" Version="5.6.7"/>
<AnalyzerPackage Include="SonarAnalyzer.CSharp" Version="8.51.0.59060"/>
<AnalyzerPackage Include="SonarAnalyzer.CSharp" Version="9.2.0.71021"/>
<AnalyzerPackage Include="StyleCop.Analyzers" Version="1.2.0-beta.435"/>
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions Lombiq.Analyzers/Lombiq.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<DefaultItemExcludes>$(DefaultItemExcludes);.git*;</DefaultItemExcludes>
<!-- This is duplicated with Lombiq.Analyzers.nuspec.template but is needed for the NuGet publishing workflow not to
throw a warning. -->
<PackageLicenseFile>License.md</PackageLicenseFile>
0liver marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<!-- This project is built with an externally generated .nuspec file so NuGet-related properties are not needed here.
Expand Down
4 changes: 1 addition & 3 deletions Lombiq.Analyzers/general.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
<Rule Id="S1075" Action="None" />
<Rule Id="S1109" Action="Warning" />
<Rule Id="S113" Action="Warning" />
<Rule Id="S1144" Action="Warning" />
<Rule Id="S1133" Action="None" />
<Rule Id="S1145" Action="Warning" />
<Rule Id="S1147" Action="Warning" />
<Rule Id="S1151" Action="Warning" />
Expand Down Expand Up @@ -386,7 +386,6 @@
<Rule Id="S3906" Action="Warning" />
<Rule Id="S3908" Action="Warning" />
<Rule Id="S3937" Action="Warning" />
<Rule Id="S3949" Action="Warning" />
0liver marked this conversation as resolved.
Show resolved Hide resolved
<Rule Id="S3962" Action="Warning" />
<Rule Id="S3963" Action="None" />
<Rule Id="S4002" Action="Warning" />
Expand All @@ -399,7 +398,6 @@
<Rule Id="S4226" Action="Warning" />
<Rule Id="S4261" Action="Warning" />
<Rule Id="S4432" Action="Warning" />
<Rule Id="S4487" Action="Warning" />
<Rule Id="S4564" Action="Warning" />
<Rule Id="S881" Action="Warning" />
</Rules>
Expand Down