From 22ca3edef1138ccba326e032631472d58c25c163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Barr=C3=A9?= Date: Fri, 20 Sep 2024 11:36:36 -0400 Subject: [PATCH] Update dependencies --- .github/workflows/ci.yml | 27 +- Meziantou.DotNet.CodingStandard.nuspec | 2 +- .../Analyzer.Meziantou.Analyzer.editorconfig | 1596 +++++++++-------- .../CodingStandardTests.cs | 49 +- .../DotnetVersions.cs | 55 + ...ziantou.DotNet.CodingStandard.Tests.csproj | 9 +- .../PackageFixture.cs | 14 + .../ConfigFilesGenerator.csproj | 13 +- 8 files changed, 926 insertions(+), 839 deletions(-) create mode 100644 tests/Meziantou.DotNet.CodingStandard.Tests/DotnetVersions.cs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd5f1a0..9b62488 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,8 +25,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v4 + - uses: actions/setup-dotnet@v4 - run: dotnet run --project=tools/ConfigFilesGenerator/ConfigFilesGenerator.csproj create_nuget: @@ -34,7 +33,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 - - uses: actions/setup-dotnet@v4 - run: | try { @@ -60,19 +58,29 @@ jobs: path: "**/*.nupkg" test: - runs-on: windows-latest + runs-on: ubuntu-latest + needs: [create_nuget] steps: - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 + - uses: actions/download-artifact@v4 + with: + name: nuget + path: ${{ env.NuGetDirectory }} - uses: actions/setup-dotnet@v4 with: dotnet-version: | - 8.0.x 9.0.100-rc.1.24452.12 - - run: dotnet test tests/Meziantou.DotNet.CodingStandard.Tests/Meziantou.DotNet.CodingStandard.Tests.csproj + 8.0.x + - run: dotnet --info + - run: dotnet test tests/Meziantou.DotNet.CodingStandard.Tests/Meziantou.DotNet.CodingStandard.Tests.csproj --logger "trx;LogFileName=test_results.trx" --results-directory test_results + - uses: actions/upload-artifact@v4 + if: always() + with: + name: test_results + path: test_results deploy: - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-latest" needs: [create_nuget, lint_config, test] steps: - uses: actions/checkout@v4 @@ -80,8 +88,7 @@ jobs: with: name: nuget path: ${{ env.NuGetDirectory }} - - name: Setup .NET Core - uses: actions/setup-dotnet@v4 + - uses: actions/setup-dotnet@v4 - run: | Write-Host "Current ref: $env:GITHUB_REF" Write-Host "Searching nupkg in folder: ${{ env.NuGetDirectory }}" diff --git a/Meziantou.DotNet.CodingStandard.nuspec b/Meziantou.DotNet.CodingStandard.nuspec index eb813be..57247fb 100644 --- a/Meziantou.DotNet.CodingStandard.nuspec +++ b/Meziantou.DotNet.CodingStandard.nuspec @@ -13,7 +13,7 @@ - + diff --git a/src/configuration/Analyzer.Meziantou.Analyzer.editorconfig b/src/configuration/Analyzer.Meziantou.Analyzer.editorconfig index 50f6348..75d40e9 100644 --- a/src/configuration/Analyzer.Meziantou.Analyzer.editorconfig +++ b/src/configuration/Analyzer.Meziantou.Analyzer.editorconfig @@ -1,793 +1,803 @@ -# global_level must be higher than the NET Analyzer files -is_global = true -global_level = 0 - -# MA0001: StringComparison is missing -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0001.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0001.severity = warning - -# MA0002: IEqualityComparer or IComparer is missing -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0002.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0002.severity = warning - -# MA0003: Add parameter name to improve readability -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0003.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0003.severity = suggestion - -# MA0004: Use Task.ConfigureAwait -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0004.severity = warning - -# MA0005: Use Array.Empty() -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0005.md -# Enabled: True, Severity: warning -# Superseeded by CA1825 -dotnet_diagnostic.MA0005.severity = none - -# MA0006: Use String.Equals instead of equality operator -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0006.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0006.severity = silent - -# MA0007: Add a comma after the last value -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0007.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0007.severity = suggestion - -# MA0008: Add StructLayoutAttribute -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0008.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0008.severity = warning - -# MA0009: Add regex evaluation timeout -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0009.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0009.severity = warning - -# MA0010: Mark attributes with AttributeUsageAttribute -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0010.md -# Enabled: True, Severity: warning -# Superseeded by CA1018 -dotnet_diagnostic.MA0010.severity = none - -# MA0011: IFormatProvider is missing -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0011.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0011.severity = warning - -# MA0012: Do not raise reserved exception type -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0012.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0012.severity = warning - -# MA0013: Types should not extend System.ApplicationException -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0013.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0013.severity = warning - -# MA0014: Do not raise System.ApplicationException type -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0014.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0014.severity = warning - -# MA0015: Specify the parameter name in ArgumentException -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0015.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0015.severity = warning - -# MA0016: Prefer using collection abstraction instead of implementation -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0016.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0016.severity = none - -# MA0017: Abstract types should not have public or internal constructors -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0017.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0017.severity = warning - -# MA0018: Do not declare static members on generic types (deprecated; use CA1000 instead) -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0018.md -# Enabled: True, Severity: suggestion -# Superseeded by CA1000 -dotnet_diagnostic.MA0018.severity = none - -# MA0019: Use EventArgs.Empty -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0019.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0019.severity = warning - -# MA0020: Use direct methods instead of LINQ methods -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0020.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0020.severity = suggestion - -# MA0021: Use StringComparer.GetHashCode instead of string.GetHashCode -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0021.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0021.severity = warning - -# MA0022: Return Task.FromResult instead of returning null -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0022.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0022.severity = warning - -# MA0023: Add RegexOptions.ExplicitCapture -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0023.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0023.severity = warning - -# MA0024: Use an explicit StringComparer when possible -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0024.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0024.severity = warning - -# MA0025: Implement the functionality instead of throwing NotImplementedException -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0025.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0025.severity = warning - -# MA0026: Fix TODO comment -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0026.severity = warning - -# MA0027: Prefer rethrowing an exception implicitly -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0027.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0027.severity = warning - -# MA0028: Optimize StringBuilder usage -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0028.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0028.severity = suggestion - -# MA0029: Combine LINQ methods -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0029.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0029.severity = suggestion - -# MA0030: Remove useless OrderBy call -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0030.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0030.severity = warning - -# MA0031: Optimize Enumerable.Count() usage -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0031.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0031.severity = suggestion - -# MA0032: Use an overload with a CancellationToken argument -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0032.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0032.severity = none - -# MA0033: Do not tag instance fields with ThreadStaticAttribute -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0033.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0033.severity = warning - -# MA0035: Do not use dangerous threading methods -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0035.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0035.severity = warning - -# MA0036: Make class static -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0036.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0036.severity = suggestion - -# MA0037: Remove empty statement -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0037.md -# Enabled: True, Severity: error -dotnet_diagnostic.MA0037.severity = error - -# MA0038: Make method static (deprecated, use CA1822 instead) -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0038.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0038.severity = none - -# MA0039: Do not write your own certificate validation method -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0039.md -# Enabled: True, Severity: error -dotnet_diagnostic.MA0039.severity = error - -# MA0040: Forward the CancellationToken parameter to methods that take one -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0040.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0040.severity = suggestion - -# MA0041: Make property static (deprecated, use CA1822 instead) -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0041.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0041.severity = none - -# MA0042: Do not use blocking calls in an async method -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0042.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0042.severity = suggestion - -# MA0043: Use nameof operator in ArgumentException -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0043.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0043.severity = suggestion - -# MA0044: Remove useless ToString call -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0044.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0044.severity = suggestion - -# MA0045: Do not use blocking calls in a sync method (need to make calling method async) -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0045.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0045.severity = none - -# MA0046: Use EventHandler to declare events -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0046.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0046.severity = warning - -# MA0047: Declare types in namespaces -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0047.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0047.severity = warning - -# MA0048: File name must match type name -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0048.severity = warning - -# MA0049: Type name should not match containing namespace -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0049.md -# Enabled: True, Severity: error -dotnet_diagnostic.MA0049.severity = error - -# MA0050: Validate arguments correctly in iterator methods -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0050.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0050.severity = suggestion - -# MA0051: Method is too long -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0051.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0051.severity = none - -# MA0052: Replace constant Enum.ToString with nameof -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0052.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0052.severity = suggestion - -# MA0053: Make class sealed -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0053.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0053.severity = suggestion - -# MA0054: Embed the caught exception as innerException -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0054.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0054.severity = warning - -# MA0055: Do not use finalizer -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0055.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0055.severity = warning - -# MA0056: Do not call overridable members in constructor -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0056.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0056.severity = warning - -# MA0057: Class name should end with 'Attribute' -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0057.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0057.severity = suggestion - -# MA0058: Class name should end with 'Exception' -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0058.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0058.severity = suggestion - -# MA0059: Class name should end with 'EventArgs' -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0059.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0059.severity = suggestion - -# MA0060: The value returned by Stream.Read/Stream.ReadAsync is not used -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0060.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0060.severity = warning - -# MA0061: Method overrides should not change default values -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0061.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0061.severity = warning - -# MA0062: Non-flags enums should not be marked with "FlagsAttribute" -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0062.md -# Enabled: True, Severity: warning -# Superseeded by CA2217 -dotnet_diagnostic.MA0062.severity = none - -# MA0063: Use Where before OrderBy -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0063.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0063.severity = suggestion - -# MA0064: Avoid locking on publicly accessible instance -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0064.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0064.severity = warning - -# MA0065: Default ValueType.Equals or HashCode is used for struct equality -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0065.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0065.severity = warning - -# MA0066: Hash table unfriendly type is used in a hash table -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0066.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0066.severity = warning - -# MA0067: Use Guid.Empty -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0067.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0067.severity = suggestion - -# MA0068: Invalid parameter name for nullable attribute -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0068.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0068.severity = warning - -# MA0069: Non-constant static fields should not be visible -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0069.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0069.severity = warning - -# MA0070: Obsolete attributes should include explanations -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0070.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0070.severity = warning - -# MA0071: Avoid using redundant else -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0071.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0071.severity = silent - -# MA0072: Do not throw from a finally block -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0072.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0072.severity = warning - -# MA0073: Avoid comparison with bool constant -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0073.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0073.severity = suggestion - -# MA0074: Avoid implicit culture-sensitive methods -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0074.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0074.severity = warning - -# MA0075: Do not use implicit culture-sensitive ToString -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0075.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0075.severity = suggestion - -# MA0076: Do not use implicit culture-sensitive ToString in interpolated strings -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0076.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0076.severity = suggestion - -# MA0077: A class that provides Equals(T) should implement IEquatable -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0077.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0077.severity = warning - -# MA0078: Use 'Cast' instead of 'Select' to cast -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0078.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0078.severity = none - -# MA0079: Forward the CancellationToken using .WithCancellation() -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0079.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0079.severity = suggestion - -# MA0080: Use a cancellation token using .WithCancellation() -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0080.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0080.severity = none - -# MA0081: Method overrides should not omit params keyword -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0081.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0081.severity = warning - -# MA0082: NaN should not be used in comparisons -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0082.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0082.severity = warning - -# MA0083: ConstructorArgument parameters should exist in constructors -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0083.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0083.severity = warning - -# MA0084: Local variables should not hide other symbols -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0084.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0084.severity = warning - -# MA0085: Anonymous delegates should not be used to unsubscribe from Events -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0085.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0085.severity = warning - -# MA0086: Do not throw from a finalizer -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0086.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0086.severity = warning - -# MA0087: Parameters with [DefaultParameterValue] attributes should also be marked [Optional] -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0087.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0087.severity = warning - -# MA0088: Use [DefaultParameterValue] instead of [DefaultValue] -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0088.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0088.severity = warning - -# MA0089: Optimize string method usage -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0089.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0089.severity = suggestion - -# MA0090: Remove empty else/finally block -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0090.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0090.severity = suggestion - -# MA0091: Sender should be 'this' for instance events -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0091.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0091.severity = warning - -# MA0092: Sender should be 'null' for static events -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0092.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0092.severity = warning - -# MA0093: EventArgs should not be null -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0093.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0093.severity = warning - -# MA0094: A class that provides CompareTo(T) should implement IComparable -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0094.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0094.severity = warning - -# MA0095: A class that implements IEquatable should override Equals(object) -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0095.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0095.severity = warning - -# MA0096: A class that implements IComparable should also implement IEquatable -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0096.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0096.severity = warning - -# MA0097: A class that implements IComparable or IComparable should override comparison operators -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0097.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0097.severity = warning - -# MA0098: Use indexer instead of LINQ methods -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0098.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0098.severity = suggestion - -# MA0099: Use Explicit enum value instead of 0 -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0099.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0099.severity = warning - -# MA0100: Await task before disposing of resources -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0100.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0100.severity = warning - -# MA0101: String contains an implicit end of line character -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0101.md -# Enabled: True, Severity: silent -dotnet_diagnostic.MA0101.severity = silent - -# MA0102: Make member readonly -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0102.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0102.severity = suggestion - -# MA0103: Use SequenceEqual instead of equality operator -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0103.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0103.severity = warning - -# MA0104: Do not create a type with a name from the BCL -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0104.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0104.severity = none - -# MA0105: Use the lambda parameters instead of using a closure -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0105.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0105.severity = suggestion - -# MA0106: Avoid closure by using an overload with the 'factoryArgument' parameter -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0106.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0106.severity = suggestion - -# MA0107: Do not use culture-sensitive object.ToString -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0107.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0107.severity = none - -# MA0108: Remove redundant argument value -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0108.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0108.severity = suggestion - -# MA0109: Consider adding an overload with a Span or Memory -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0109.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0109.severity = none - -# MA0110: Use the Regex source generator -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0110.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0110.severity = suggestion - -# MA0111: Use string.Create instead of FormattableString -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0111.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0111.severity = suggestion - -# MA0112: Use 'Count > 0' instead of 'Any()' -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0112.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0112.severity = silent - -# MA0113: Use DateTime.UnixEpoch -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0113.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0113.severity = suggestion - -# MA0114: Use DateTimeOffset.UnixEpoch -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0114.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0114.severity = suggestion - -# MA0115: Unknown component parameter -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0115.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0115.severity = warning - -# MA0116: Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter] -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0116.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0116.severity = warning - -# MA0117: Parameters with [EditorRequired] attributes should also be marked as [Parameter] -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0117.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0117.severity = warning - -# MA0118: [JSInvokable] methods must be public -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0118.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0118.severity = warning - -# MA0119: JSRuntime must not be used in OnInitialized or OnInitializedAsync -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0119.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0119.severity = warning - -# MA0120: Use InvokeVoidAsync when the returned value is not used -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0120.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0120.severity = warning - -# MA0121: Do not overwrite parameter value -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0121.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0121.severity = none - -# MA0122: Parameters with [SupplyParameterFromQuery] attributes are only valid in routable components (@page) -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0122.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0122.severity = warning - -# MA0123: Sequence number must be a constant -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0123.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0123.severity = warning - -# MA0124: Log parameter type is not valid -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0124.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0124.severity = warning - -# MA0125: The list of log parameter types contains an invalid type -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0125.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0125.severity = warning - -# MA0126: The list of log parameter types contains a duplicate -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0126.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0126.severity = warning - -# MA0127: Use String.Equals instead of is pattern -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0127.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0127.severity = none - -# MA0128: Use 'is' operator instead of SequenceEqual -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0128.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0128.severity = suggestion - -# MA0129: Await task in using statement -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0129.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0129.severity = warning - -# MA0130: GetType() should not be used on System.Type instances -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0130.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0130.severity = warning - -# MA0131: ArgumentNullException.ThrowIfNull should not be used with non-nullable types -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0131.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0131.severity = warning - -# MA0132: Do not convert implicitly to DateTimeOffset -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0132.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0132.severity = warning - -# MA0133: Use DateTimeOffset instead of relying on the implicit conversion -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0133.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0133.severity = warning - -# MA0134: Observe result of async calls -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0134.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0134.severity = warning - -# MA0135: The log parameter has no configured type -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0135.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0135.severity = none - -# MA0136: Raw String contains an implicit end of line character -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0136.md -# Enabled: True, Severity: silent -dotnet_diagnostic.MA0136.severity = silent - -# MA0137: Use 'Async' suffix when a method returns an awaitable type -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0137.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0137.severity = none - -# MA0138: Do not use 'Async' suffix when a method does not return an awaitable type -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0138.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0138.severity = none - -# MA0139: Log parameter type is not valid -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0139.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0139.severity = warning - -# MA0140: Both if and else branch have identical code -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0140.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0140.severity = warning - -# MA0141: Use pattern matching instead of inequality operators for null check -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0141.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0141.severity = suggestion - -# MA0142: Use pattern matching instead of equality operators for null check -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0142.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0142.severity = suggestion - -# MA0143: Primary constructor parameters should be readonly -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0143.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0143.severity = warning - -# MA0144: Use System.OperatingSystem to check the current OS -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0144.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0144.severity = warning - -# MA0145: Signature for [UnsafeAccessorAttribute] method is not valid -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0145.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0145.severity = warning - -# MA0146: Name must be set explicitly on local functions -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0146.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0146.severity = warning - -# MA0147: Avoid async void method for delegate -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0147.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0147.severity = warning - -# MA0148: Use pattern matching instead of equality operators for discrete value -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0148.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0148.severity = suggestion - -# MA0149: Use pattern matching instead of inequality operators for discrete value -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0149.md -# Enabled: False, Severity: suggestion -dotnet_diagnostic.MA0149.severity = suggestion - -# MA0150: Do not call the default object.ToString explicitly -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0150.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0150.severity = warning - -# MA0151: DebuggerDisplay must contain valid members -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0151.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0151.severity = warning - -# MA0152: Use Unwrap instead of using await twice -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0152.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0152.severity = suggestion - -# MA0153: Do not log symbols decorated with DataClassificationAttribute directly -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0153.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0153.severity = warning - -# MA0154: Use langword in XML comment -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0154.md -# Enabled: True, Severity: suggestion -dotnet_diagnostic.MA0154.severity = suggestion - -# MA0155: Do not use async void methods -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0155.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0155.severity = warning - -# MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0156.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0156.severity = none - -# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md -# Enabled: False, Severity: warning -dotnet_diagnostic.MA0157.severity = none - -# MA0158: Use System.Threading.Lock -# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0158.md -# Enabled: True, Severity: warning -dotnet_diagnostic.MA0158.severity = warning - +# global_level must be higher than the NET Analyzer files +is_global = true +global_level = 0 + +# MA0001: StringComparison is missing +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0001.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0001.severity = warning + +# MA0002: IEqualityComparer or IComparer is missing +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0002.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0002.severity = warning + +# MA0003: Add parameter name to improve readability +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0003.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0003.severity = suggestion + +# MA0004: Use Task.ConfigureAwait +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0004.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0004.severity = warning + +# MA0005: Use Array.Empty() +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0005.md +# Enabled: True, Severity: warning +# Superseeded by CA1825 +dotnet_diagnostic.MA0005.severity = none + +# MA0006: Use String.Equals instead of equality operator +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0006.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0006.severity = silent + +# MA0007: Add a comma after the last value +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0007.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0007.severity = suggestion + +# MA0008: Add StructLayoutAttribute +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0008.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0008.severity = warning + +# MA0009: Add regex evaluation timeout +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0009.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0009.severity = warning + +# MA0010: Mark attributes with AttributeUsageAttribute +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0010.md +# Enabled: True, Severity: warning +# Superseeded by CA1018 +dotnet_diagnostic.MA0010.severity = none + +# MA0011: IFormatProvider is missing +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0011.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0011.severity = warning + +# MA0012: Do not raise reserved exception type +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0012.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0012.severity = warning + +# MA0013: Types should not extend System.ApplicationException +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0013.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0013.severity = warning + +# MA0014: Do not raise System.ApplicationException type +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0014.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0014.severity = warning + +# MA0015: Specify the parameter name in ArgumentException +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0015.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0015.severity = warning + +# MA0016: Prefer using collection abstraction instead of implementation +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0016.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0016.severity = none + +# MA0017: Abstract types should not have public or internal constructors +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0017.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0017.severity = warning + +# MA0018: Do not declare static members on generic types (deprecated; use CA1000 instead) +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0018.md +# Enabled: True, Severity: suggestion +# Superseeded by CA1000 +dotnet_diagnostic.MA0018.severity = none + +# MA0019: Use EventArgs.Empty +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0019.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0019.severity = warning + +# MA0020: Use direct methods instead of LINQ methods +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0020.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0020.severity = suggestion + +# MA0021: Use StringComparer.GetHashCode instead of string.GetHashCode +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0021.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0021.severity = warning + +# MA0022: Return Task.FromResult instead of returning null +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0022.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0022.severity = warning + +# MA0023: Add RegexOptions.ExplicitCapture +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0023.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0023.severity = warning + +# MA0024: Use an explicit StringComparer when possible +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0024.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0024.severity = warning + +# MA0025: Implement the functionality instead of throwing NotImplementedException +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0025.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0025.severity = warning + +# MA0026: Fix TODO comment +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0026.severity = warning + +# MA0027: Prefer rethrowing an exception implicitly +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0027.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0027.severity = warning + +# MA0028: Optimize StringBuilder usage +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0028.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0028.severity = suggestion + +# MA0029: Combine LINQ methods +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0029.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0029.severity = suggestion + +# MA0030: Remove useless OrderBy call +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0030.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0030.severity = warning + +# MA0031: Optimize Enumerable.Count() usage +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0031.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0031.severity = suggestion + +# MA0032: Use an overload with a CancellationToken argument +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0032.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0032.severity = none + +# MA0033: Do not tag instance fields with ThreadStaticAttribute +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0033.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0033.severity = warning + +# MA0035: Do not use dangerous threading methods +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0035.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0035.severity = warning + +# MA0036: Make class static +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0036.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0036.severity = suggestion + +# MA0037: Remove empty statement +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0037.md +# Enabled: True, Severity: error +dotnet_diagnostic.MA0037.severity = error + +# MA0038: Make method static (deprecated, use CA1822 instead) +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0038.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0038.severity = none + +# MA0039: Do not write your own certificate validation method +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0039.md +# Enabled: True, Severity: error +dotnet_diagnostic.MA0039.severity = error + +# MA0040: Forward the CancellationToken parameter to methods that take one +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0040.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0040.severity = suggestion + +# MA0041: Make property static (deprecated, use CA1822 instead) +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0041.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0041.severity = none + +# MA0042: Do not use blocking calls in an async method +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0042.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0042.severity = suggestion + +# MA0043: Use nameof operator in ArgumentException +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0043.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0043.severity = suggestion + +# MA0044: Remove useless ToString call +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0044.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0044.severity = suggestion + +# MA0045: Do not use blocking calls in a sync method (need to make calling method async) +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0045.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0045.severity = none + +# MA0046: Use EventHandler to declare events +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0046.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0046.severity = warning + +# MA0047: Declare types in namespaces +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0047.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0047.severity = warning + +# MA0048: File name must match type name +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0048.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0048.severity = warning + +# MA0049: Type name should not match containing namespace +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0049.md +# Enabled: True, Severity: error +dotnet_diagnostic.MA0049.severity = error + +# MA0050: Validate arguments correctly in iterator methods +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0050.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0050.severity = suggestion + +# MA0051: Method is too long +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0051.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0051.severity = none + +# MA0052: Replace constant Enum.ToString with nameof +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0052.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0052.severity = suggestion + +# MA0053: Make class sealed +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0053.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0053.severity = suggestion + +# MA0054: Embed the caught exception as innerException +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0054.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0054.severity = warning + +# MA0055: Do not use finalizer +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0055.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0055.severity = warning + +# MA0056: Do not call overridable members in constructor +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0056.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0056.severity = warning + +# MA0057: Class name should end with 'Attribute' +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0057.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0057.severity = suggestion + +# MA0058: Class name should end with 'Exception' +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0058.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0058.severity = suggestion + +# MA0059: Class name should end with 'EventArgs' +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0059.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0059.severity = suggestion + +# MA0060: The value returned by Stream.Read/Stream.ReadAsync is not used +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0060.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0060.severity = warning + +# MA0061: Method overrides should not change default values +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0061.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0061.severity = warning + +# MA0062: Non-flags enums should not be marked with "FlagsAttribute" +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0062.md +# Enabled: True, Severity: warning +# Superseeded by CA2217 +dotnet_diagnostic.MA0062.severity = none + +# MA0063: Use Where before OrderBy +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0063.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0063.severity = suggestion + +# MA0064: Avoid locking on publicly accessible instance +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0064.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0064.severity = warning + +# MA0065: Default ValueType.Equals or HashCode is used for struct equality +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0065.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0065.severity = warning + +# MA0066: Hash table unfriendly type is used in a hash table +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0066.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0066.severity = warning + +# MA0067: Use Guid.Empty +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0067.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0067.severity = suggestion + +# MA0068: Invalid parameter name for nullable attribute +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0068.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0068.severity = warning + +# MA0069: Non-constant static fields should not be visible +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0069.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0069.severity = warning + +# MA0070: Obsolete attributes should include explanations +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0070.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0070.severity = warning + +# MA0071: Avoid using redundant else +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0071.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0071.severity = silent + +# MA0072: Do not throw from a finally block +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0072.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0072.severity = warning + +# MA0073: Avoid comparison with bool constant +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0073.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0073.severity = suggestion + +# MA0074: Avoid implicit culture-sensitive methods +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0074.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0074.severity = warning + +# MA0075: Do not use implicit culture-sensitive ToString +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0075.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0075.severity = suggestion + +# MA0076: Do not use implicit culture-sensitive ToString in interpolated strings +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0076.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0076.severity = suggestion + +# MA0077: A class that provides Equals(T) should implement IEquatable +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0077.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0077.severity = warning + +# MA0078: Use 'Cast' instead of 'Select' to cast +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0078.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0078.severity = none + +# MA0079: Forward the CancellationToken using .WithCancellation() +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0079.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0079.severity = suggestion + +# MA0080: Use a cancellation token using .WithCancellation() +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0080.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0080.severity = none + +# MA0081: Method overrides should not omit params keyword +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0081.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0081.severity = warning + +# MA0082: NaN should not be used in comparisons +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0082.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0082.severity = warning + +# MA0083: ConstructorArgument parameters should exist in constructors +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0083.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0083.severity = warning + +# MA0084: Local variables should not hide other symbols +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0084.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0084.severity = warning + +# MA0085: Anonymous delegates should not be used to unsubscribe from Events +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0085.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0085.severity = warning + +# MA0086: Do not throw from a finalizer +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0086.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0086.severity = warning + +# MA0087: Parameters with [DefaultParameterValue] attributes should also be marked [Optional] +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0087.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0087.severity = warning + +# MA0088: Use [DefaultParameterValue] instead of [DefaultValue] +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0088.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0088.severity = warning + +# MA0089: Optimize string method usage +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0089.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0089.severity = suggestion + +# MA0090: Remove empty else/finally block +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0090.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0090.severity = suggestion + +# MA0091: Sender should be 'this' for instance events +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0091.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0091.severity = warning + +# MA0092: Sender should be 'null' for static events +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0092.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0092.severity = warning + +# MA0093: EventArgs should not be null +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0093.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0093.severity = warning + +# MA0094: A class that provides CompareTo(T) should implement IComparable +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0094.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0094.severity = warning + +# MA0095: A class that implements IEquatable should override Equals(object) +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0095.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0095.severity = warning + +# MA0096: A class that implements IComparable should also implement IEquatable +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0096.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0096.severity = warning + +# MA0097: A class that implements IComparable or IComparable should override comparison operators +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0097.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0097.severity = warning + +# MA0098: Use indexer instead of LINQ methods +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0098.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0098.severity = suggestion + +# MA0099: Use Explicit enum value instead of 0 +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0099.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0099.severity = warning + +# MA0100: Await task before disposing of resources +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0100.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0100.severity = warning + +# MA0101: String contains an implicit end of line character +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0101.md +# Enabled: True, Severity: silent +dotnet_diagnostic.MA0101.severity = silent + +# MA0102: Make member readonly +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0102.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0102.severity = suggestion + +# MA0103: Use SequenceEqual instead of equality operator +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0103.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0103.severity = warning + +# MA0104: Do not create a type with a name from the BCL +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0104.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0104.severity = none + +# MA0105: Use the lambda parameters instead of using a closure +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0105.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0105.severity = suggestion + +# MA0106: Avoid closure by using an overload with the 'factoryArgument' parameter +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0106.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0106.severity = suggestion + +# MA0107: Do not use culture-sensitive object.ToString +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0107.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0107.severity = none + +# MA0108: Remove redundant argument value +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0108.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0108.severity = suggestion + +# MA0109: Consider adding an overload with a Span or Memory +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0109.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0109.severity = none + +# MA0110: Use the Regex source generator +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0110.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0110.severity = suggestion + +# MA0111: Use string.Create instead of FormattableString +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0111.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0111.severity = suggestion + +# MA0112: Use 'Count > 0' instead of 'Any()' +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0112.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0112.severity = silent + +# MA0113: Use DateTime.UnixEpoch +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0113.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0113.severity = suggestion + +# MA0114: Use DateTimeOffset.UnixEpoch +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0114.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0114.severity = suggestion + +# MA0115: Unknown component parameter +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0115.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0115.severity = warning + +# MA0116: Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter] +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0116.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0116.severity = warning + +# MA0117: Parameters with [EditorRequired] attributes should also be marked as [Parameter] +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0117.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0117.severity = warning + +# MA0118: [JSInvokable] methods must be public +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0118.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0118.severity = warning + +# MA0119: JSRuntime must not be used in OnInitialized or OnInitializedAsync +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0119.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0119.severity = warning + +# MA0120: Use InvokeVoidAsync when the returned value is not used +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0120.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0120.severity = warning + +# MA0121: Do not overwrite parameter value +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0121.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0121.severity = none + +# MA0122: Parameters with [SupplyParameterFromQuery] attributes are only valid in routable components (@page) +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0122.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0122.severity = warning + +# MA0123: Sequence number must be a constant +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0123.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0123.severity = warning + +# MA0124: Log parameter type is not valid +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0124.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0124.severity = warning + +# MA0125: The list of log parameter types contains an invalid type +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0125.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0125.severity = warning + +# MA0126: The list of log parameter types contains a duplicate +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0126.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0126.severity = warning + +# MA0127: Use String.Equals instead of is pattern +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0127.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0127.severity = none + +# MA0128: Use 'is' operator instead of SequenceEqual +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0128.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0128.severity = suggestion + +# MA0129: Await task in using statement +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0129.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0129.severity = warning + +# MA0130: GetType() should not be used on System.Type instances +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0130.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0130.severity = warning + +# MA0131: ArgumentNullException.ThrowIfNull should not be used with non-nullable types +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0131.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0131.severity = warning + +# MA0132: Do not convert implicitly to DateTimeOffset +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0132.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0132.severity = warning + +# MA0133: Use DateTimeOffset instead of relying on the implicit conversion +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0133.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0133.severity = warning + +# MA0134: Observe result of async calls +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0134.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0134.severity = warning + +# MA0135: The log parameter has no configured type +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0135.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0135.severity = none + +# MA0136: Raw String contains an implicit end of line character +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0136.md +# Enabled: True, Severity: silent +dotnet_diagnostic.MA0136.severity = silent + +# MA0137: Use 'Async' suffix when a method returns an awaitable type +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0137.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0137.severity = none + +# MA0138: Do not use 'Async' suffix when a method does not return an awaitable type +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0138.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0138.severity = none + +# MA0139: Log parameter type is not valid +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0139.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0139.severity = warning + +# MA0140: Both if and else branch have identical code +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0140.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0140.severity = warning + +# MA0141: Use pattern matching instead of inequality operators for null check +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0141.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0141.severity = suggestion + +# MA0142: Use pattern matching instead of equality operators for null check +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0142.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0142.severity = suggestion + +# MA0143: Primary constructor parameters should be readonly +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0143.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0143.severity = warning + +# MA0144: Use System.OperatingSystem to check the current OS +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0144.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0144.severity = warning + +# MA0145: Signature for [UnsafeAccessorAttribute] method is not valid +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0145.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0145.severity = warning + +# MA0146: Name must be set explicitly on local functions +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0146.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0146.severity = warning + +# MA0147: Avoid async void method for delegate +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0147.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0147.severity = warning + +# MA0148: Use pattern matching instead of equality operators for discrete value +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0148.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0148.severity = suggestion + +# MA0149: Use pattern matching instead of inequality operators for discrete value +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0149.md +# Enabled: False, Severity: suggestion +dotnet_diagnostic.MA0149.severity = suggestion + +# MA0150: Do not call the default object.ToString explicitly +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0150.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0150.severity = warning + +# MA0151: DebuggerDisplay must contain valid members +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0151.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0151.severity = warning + +# MA0152: Use Unwrap instead of using await twice +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0152.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0152.severity = suggestion + +# MA0153: Do not log symbols decorated with DataClassificationAttribute directly +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0153.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0153.severity = warning + +# MA0154: Use langword in XML comment +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0154.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0154.severity = suggestion + +# MA0155: Do not use async void methods +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0155.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0155.severity = warning + +# MA0156: Use 'Async' suffix when a method returns IAsyncEnumerable +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0156.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0156.severity = none + +# MA0157: Do not use 'Async' suffix when a method does not return IAsyncEnumerable +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0157.md +# Enabled: False, Severity: warning +dotnet_diagnostic.MA0157.severity = none + +# MA0158: Use System.Threading.Lock +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0158.md +# Enabled: True, Severity: warning +dotnet_diagnostic.MA0158.severity = warning + +# MA0159: Use 'Order' instead of 'OrderBy' +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0159.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0159.severity = suggestion + +# MA0160: Use ContainsKey instead of TryGetValue +# Help link: https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0160.md +# Enabled: True, Severity: suggestion +dotnet_diagnostic.MA0160.severity = suggestion + diff --git a/tests/Meziantou.DotNet.CodingStandard.Tests/CodingStandardTests.cs b/tests/Meziantou.DotNet.CodingStandard.Tests/CodingStandardTests.cs index f0c93ab..fe3b9fa 100644 --- a/tests/Meziantou.DotNet.CodingStandard.Tests/CodingStandardTests.cs +++ b/tests/Meziantou.DotNet.CodingStandard.Tests/CodingStandardTests.cs @@ -4,12 +4,23 @@ using System.Xml.Linq; using Meziantou.Framework; using Xunit.Abstractions; +using static System.Net.Mime.MediaTypeNames; namespace Meziantou.DotNet.CodingStandard.Tests; -public abstract class CodingStandardTests(PackageFixture fixture, ITestOutputHelper testOutputHelper) : IClassFixture +public abstract class CodingStandardTests(PackageFixture fixture, ITestOutputHelper testOutputHelper, string dotnetChannel) : IClassFixture { - protected abstract string CreateGlobalJsonContent(); + private async Task CreateGlobalJsonContent() + { + var version = await DotnetVersions.GetLatestVersionAsync(dotnetChannel); + return $$""" + { + "sdk": { + "version": "{{version}}" + } + } + """; + } [Fact] public async Task BannedSymbolsAreReported() @@ -87,7 +98,7 @@ static void A() Assert.False(data.HasWarning()); Assert.False(data.HasError()); } - + [Fact] public async Task LocalEditorConfigCanOverrideSettings() { @@ -204,11 +215,12 @@ private sealed class ProjectBuilder : IAsyncDisposable private readonly TemporaryDirectory _directory; private readonly ITestOutputHelper _testOutputHelper; + private readonly CodingStandardTests _test; public ProjectBuilder(PackageFixture fixture, ITestOutputHelper testOutputHelper, CodingStandardTests test) { _testOutputHelper = testOutputHelper; - + _test = test; _directory = TemporaryDirectory.Create(); _directory.CreateTextFile("NuGet.config", $""" @@ -230,8 +242,6 @@ public ProjectBuilder(PackageFixture fixture, ITestOutputHelper testOutputHelper """); - - _directory.CreateTextFile("global.json", test.CreateGlobalJsonContent()); } public ProjectBuilder AddFile(string relativePath, string content) @@ -272,7 +282,7 @@ public ProjectBuilder AddCsprojFile((string Name, string Value)[] properties = n {propertiesElement} {packagesElement} - + {string.Join('\n', additionalProjectElements?.Select(e => e.ToString()) ?? [])} @@ -284,6 +294,10 @@ public ProjectBuilder AddCsprojFile((string Name, string Value)[] properties = n public async Task BuildAndGetOutput(string[] buildArguments = null) { + string dotnetVersion = await _test.CreateGlobalJsonContent(); + _testOutputHelper.WriteLine("Global.json version:\n" + dotnetVersion); + _directory.CreateTextFile("global.json", dotnetVersion); + var psi = new ProcessStartInfo("dotnet") { WorkingDirectory = _directory.FullPath, @@ -372,26 +386,11 @@ public override string ToString() } } -public sealed class CodingStandardTestsNet8_0(PackageFixture fixture, ITestOutputHelper testOutputHelper) : CodingStandardTests(fixture, testOutputHelper) +public sealed class CodingStandardTestsNet8_0(PackageFixture fixture, ITestOutputHelper testOutputHelper) : CodingStandardTests(fixture, testOutputHelper, "8.0") { - override protected string CreateGlobalJsonContent() => """ - { - "sdk": { - "version": "8.0.100", - "rollForward": "latestFeature" - } - } - """; + } -public sealed class CodingStandardTestsNet9_0(PackageFixture fixture, ITestOutputHelper testOutputHelper) : CodingStandardTests(fixture, testOutputHelper) +public sealed class CodingStandardTestsNet9_0(PackageFixture fixture, ITestOutputHelper testOutputHelper) : CodingStandardTests(fixture, testOutputHelper, "9.0") { - override protected string CreateGlobalJsonContent() => """ - { - "sdk": { - "version": "9.0.100", - "rollForward": "9.0.100-rc.1.24452.12" - } - } - """; } \ No newline at end of file diff --git a/tests/Meziantou.DotNet.CodingStandard.Tests/DotnetVersions.cs b/tests/Meziantou.DotNet.CodingStandard.Tests/DotnetVersions.cs new file mode 100644 index 0000000..a1f0ca1 --- /dev/null +++ b/tests/Meziantou.DotNet.CodingStandard.Tests/DotnetVersions.cs @@ -0,0 +1,55 @@ +using System.Collections.Concurrent; +using System.Net.Http.Json; +using System.Text.Json.Serialization; +using NuGet.Versioning; + +namespace Meziantou.DotNet.CodingStandard.Tests; + +internal static class DotnetVersions +{ + private static readonly ConcurrentDictionary> Cache = new(StringComparer.Ordinal); + + public static Task GetLatestVersionAsync(string channel) + { + return Cache.GetOrAdd(channel, GetLatestVersionCore); + + static async Task GetLatestVersionCore(string channel) + { + var channelData = await SharedHttpClient.Instance.GetFromJsonAsync($"https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/{channel}/releases.json"); + return channelData.Releases.Where(r => r.Sdk.Version is not null).OrderBy(r => SemanticVersion.Parse(r.Sdk.Version)).Last().Sdk.Version; + } + } + + private sealed class DotNetReleaseEntry + { + [JsonPropertyName("releases.json")] + public string ReleaseJson { get; set; } = null!; + } + + private sealed class ChannelData + { + [JsonPropertyName("channel-version")] + public string ChannelVersion { get; set; } = default!; + + [JsonPropertyName("releases")] + public ChannelRelease[] Releases { get; set; } = default!; + } + + private sealed class ChannelRelease + { + [JsonPropertyName("sdk")] + public ChannelReleaseSdk Sdk { get; set; } + + [JsonPropertyName("release-notes")] + public string ReleaseNotes { get; set; } + + [JsonPropertyName("release-date")] + public DateOnly ReleaseDate { get; set; } + } + + private sealed class ChannelReleaseSdk + { + [JsonPropertyName("version")] + public string Version { get; set; } + } +} diff --git a/tests/Meziantou.DotNet.CodingStandard.Tests/Meziantou.DotNet.CodingStandard.Tests.csproj b/tests/Meziantou.DotNet.CodingStandard.Tests/Meziantou.DotNet.CodingStandard.Tests.csproj index 10e346a..0114294 100644 --- a/tests/Meziantou.DotNet.CodingStandard.Tests/Meziantou.DotNet.CodingStandard.Tests.csproj +++ b/tests/Meziantou.DotNet.CodingStandard.Tests/Meziantou.DotNet.CodingStandard.Tests.csproj @@ -9,11 +9,12 @@ - + - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Meziantou.DotNet.CodingStandard.Tests/PackageFixture.cs b/tests/Meziantou.DotNet.CodingStandard.Tests/PackageFixture.cs index f91fc5c..18ac681 100644 --- a/tests/Meziantou.DotNet.CodingStandard.Tests/PackageFixture.cs +++ b/tests/Meziantou.DotNet.CodingStandard.Tests/PackageFixture.cs @@ -11,6 +11,20 @@ public sealed class PackageFixture : IAsyncLifetime public async Task InitializeAsync() { + if (Environment.GetEnvironmentVariable("CI") != null && Environment.GetEnvironmentVariable("NuGetDirectory") is { } path) + { + var files = Directory.GetFiles(path, "*.nupkg"); + if (files.Length > 0) + { + foreach (var file in files) + { + File.Copy(file, _packageDirectory.FullPath / Path.GetFileName(file)); + } + + return; + } + } + // Build NuGet package var nugetPath = FullPath.GetTempPath() / $"nuget-{Guid.NewGuid()}.exe"; await DownloadFileAsync("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", nugetPath); diff --git a/tools/ConfigFilesGenerator/ConfigFilesGenerator.csproj b/tools/ConfigFilesGenerator/ConfigFilesGenerator.csproj index f1253f7..9cb563c 100644 --- a/tools/ConfigFilesGenerator/ConfigFilesGenerator.csproj +++ b/tools/ConfigFilesGenerator/ConfigFilesGenerator.csproj @@ -9,15 +9,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + +