diff --git a/Directory.Build.props b/Directory.Build.props index bc5bea70..c302a740 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,4 +29,8 @@ + + + + diff --git a/README.md b/README.md index 81b47677..237cf9c4 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,11 @@ There are several ways you can use the ecoCode analyzers in your .Net projects: Both the EcoCode NuGet package and Visual Studio extension target .Net Standard 2.0 and can be used in a wide range of projects. See [Microsoft documentation](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0#select-net-standard-version) for details about the supported .Net Frameworks in .Net Standard 2.0. -🌿 Rules +🌿 EcoCode Rules ------------------- |Id|Description|Severity|Enabled|Code fix| -|--|-----------|:------:|:--------:|:------:| +|--|-----------|:------:|:-----:|:------:| |[EC69](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC69/csharp/EC69.asciidoc)|Don’t call loop invariant functions in loop conditions|⚠️|✔️|❌| |[EC72](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC72/csharp/EC72.asciidoc)|Don’t execute SQL queries in loops|⚠️|✔️|❌| |[EC75](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC75/csharp/EC75.asciidoc)|Don’t concatenate `strings` in loops|⚠️|✔️|❌| @@ -45,6 +45,15 @@ Both the EcoCode NuGet package and Visual Studio extension target .Net Standard |[EC87](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC87/csharp/EC87.asciidoc)|Use collection indexer|⚠️|✔️|✔️| |[EC88](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC88/csharp/EC88.asciidoc)|Dispose resource asynchronously|⚠️|✔️|✔️| +🌿 Roslyn Rules +------------------- + +This plugin customizes the severity of certain Roslyn rules. + +|Id|Description|Old Severity|New Severity|Enabled|Code fix| +|--|-----------|:----------:|:----------:|:-----:|:------:| +|[CA1825](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825)|Avoid zero-length array allocations|ℹ️|⚠️|✔️|✔️| + 🤝 Contribution --------------- diff --git a/src/EcoCode.Package/EcoCode.Package.csproj b/src/EcoCode.Package/EcoCode.Package.csproj index f82156ab..0a27a4cf 100644 --- a/src/EcoCode.Package/EcoCode.Package.csproj +++ b/src/EcoCode.Package/EcoCode.Package.csproj @@ -40,6 +40,8 @@ + + diff --git a/src/EcoCode.Package/EcoCode.globalconfig b/src/EcoCode.Package/EcoCode.globalconfig new file mode 100644 index 00000000..51e617c7 --- /dev/null +++ b/src/EcoCode.Package/EcoCode.globalconfig @@ -0,0 +1,4 @@ +is_global = true + +# CA1825: Avoid zero-length array allocations +dotnet_diagnostic.CA1825.severity = warning diff --git a/src/EcoCode.Package/EcoCode.props b/src/EcoCode.Package/EcoCode.props new file mode 100644 index 00000000..6a79f989 --- /dev/null +++ b/src/EcoCode.Package/EcoCode.props @@ -0,0 +1,5 @@ + + + + +