From e2b83d56517a969ad80be2c6f3550ef5f8c4d8ef Mon Sep 17 00:00:00 2001 From: Vincent Marmin <3215889+vincent314@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:55:26 +0100 Subject: [PATCH] chore: rename rule keys from ECXXX to GCIXXX --- README.md | 28 ++++++++--------- ...CI69.DontCallFunctionsInLoopConditions.cs} | 4 +-- ...=> GCI72.DontExecuteSqlCommandsInLoops.cs} | 4 +-- ...=> GCI75.DontConcatenateStringsInLoops.cs} | 4 +-- ....cs => GCI81.SpecifyStructLayout.Fixer.cs} | 2 +- ...Layout.cs => GCI81.SpecifyStructLayout.cs} | 4 +-- ... GCI82.VariableCanBeMadeConstant.Fixer.cs} | 2 +- ....cs => GCI82.VariableCanBeMadeConstant.cs} | 4 +-- ...83.ReplaceEnumToStringWithNameOf.Fixer.cs} | 2 +- ...=> GCI83.ReplaceEnumToStringWithNameOf.cs} | 4 +-- ...s => GCI84.AvoidAsyncVoidMethods.Fixer.cs} | 2 +- ...hods.cs => GCI84.AvoidAsyncVoidMethods.cs} | 4 +-- ...eTypeSealed.cs => GCI85.MakeTypeSealed.cs} | 4 +-- ...cs => GCI86.GCCollectShouldNotBeCalled.cs} | 4 +-- ...Fixer.cs => GCI87.UseListIndexer.Fixer.cs} | 2 +- ...ListIndexer.cs => GCI87.UseListIndexer.cs} | 4 +-- ...88.DisposeResourceAsynchronously.Fixer.cs} | 2 +- ...=> GCI88.DisposeResourceAsynchronously.cs} | 4 +-- ...s => GCI91.UseWhereBeforeOrderBy.Fixer.cs} | 2 +- ...erBy.cs => GCI91.UseWhereBeforeOrderBy.cs} | 4 +-- ...CI92.UseLengthToTestEmptyStrings.Fixer.cs} | 2 +- ...s => GCI92.UseLengthToTestEmptyStrings.cs} | 4 +-- ...r.cs => GCI93.ReturnTaskDirectly.Fixer.cs} | 2 +- ...irectly.cs => GCI93.ReturnTaskDirectly.cs} | 4 +-- src/EcoCode.Core/Models/Rule.cs | 30 +++++++++---------- ...ontCallFunctionsInLoopConditions.Tests.cs} | 0 ...72.DontExecuteSqlCommandsInLoops.Tests.cs} | 0 ...75.DontConcatenateStringsInLoops.Tests.cs} | 0 ....cs => GCI81.SpecifyStructLayout.Tests.cs} | 0 ... GCI82.VariableCanBeMadeConstant.Tests.cs} | 0 ...83.ReplaceEnumToStringWithNameOf.Tests.cs} | 0 ...s => GCI84.AvoidAsyncVoidMethods.Tests.cs} | 0 ...Tests.cs => GCI85.MakeTypeSealed.Tests.cs} | 0 ...GCI86.GCCollectShouldNotBeCalled.Tests.cs} | 0 ...Tests.cs => GCI87.UseListIndexer.Tests.cs} | 0 ...88.DisposeResourceAsynchronously.Tests.cs} | 0 ...s => GCI91.UseWhereBeforeOrderBy.Tests.cs} | 0 ...s => GCI92.UseStringsEmptyLength.Tests.cs} | 0 ...s.cs => GCI93.ReturnTaskDirectly.Tests.cs} | 0 39 files changed, 66 insertions(+), 66 deletions(-) rename src/EcoCode.Core/Analyzers/{EC69.DontCallFunctionsInLoopConditions.cs => GCI69.DontCallFunctionsInLoopConditions.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC72.DontExecuteSqlCommandsInLoops.cs => GCI72.DontExecuteSqlCommandsInLoops.cs} (94%) rename src/EcoCode.Core/Analyzers/{EC75.DontConcatenateStringsInLoops.cs => GCI75.DontConcatenateStringsInLoops.cs} (98%) rename src/EcoCode.Core/Analyzers/{EC81.SpecifyStructLayout.Fixer.cs => GCI81.SpecifyStructLayout.Fixer.cs} (98%) rename src/EcoCode.Core/Analyzers/{EC81.SpecifyStructLayout.cs => GCI81.SpecifyStructLayout.cs} (96%) rename src/EcoCode.Core/Analyzers/{EC82.VariableCanBeMadeConstant.Fixer.cs => GCI82.VariableCanBeMadeConstant.Fixer.cs} (98%) rename src/EcoCode.Core/Analyzers/{EC82.VariableCanBeMadeConstant.cs => GCI82.VariableCanBeMadeConstant.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC83.ReplaceEnumToStringWithNameOf.Fixer.cs => GCI83.ReplaceEnumToStringWithNameOf.Fixer.cs} (96%) rename src/EcoCode.Core/Analyzers/{EC83.ReplaceEnumToStringWithNameOf.cs => GCI83.ReplaceEnumToStringWithNameOf.cs} (96%) rename src/EcoCode.Core/Analyzers/{EC84.AvoidAsyncVoidMethods.Fixer.cs => GCI84.AvoidAsyncVoidMethods.Fixer.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC84.AvoidAsyncVoidMethods.cs => GCI84.AvoidAsyncVoidMethods.cs} (94%) rename src/EcoCode.Core/Analyzers/{EC85.MakeTypeSealed.cs => GCI85.MakeTypeSealed.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC86.GCCollectShouldNotBeCalled.cs => GCI86.GCCollectShouldNotBeCalled.cs} (96%) rename src/EcoCode.Core/Analyzers/{EC87.UseListIndexer.Fixer.cs => GCI87.UseListIndexer.Fixer.cs} (99%) rename src/EcoCode.Core/Analyzers/{EC87.UseListIndexer.cs => GCI87.UseListIndexer.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC88.DisposeResourceAsynchronously.Fixer.cs => GCI88.DisposeResourceAsynchronously.Fixer.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC88.DisposeResourceAsynchronously.cs => GCI88.DisposeResourceAsynchronously.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC91.UseWhereBeforeOrderBy.Fixer.cs => GCI91.UseWhereBeforeOrderBy.Fixer.cs} (98%) rename src/EcoCode.Core/Analyzers/{EC91.UseWhereBeforeOrderBy.cs => GCI91.UseWhereBeforeOrderBy.cs} (96%) rename src/EcoCode.Core/Analyzers/{EC92.UseLengthToTestEmptyStrings.Fixer.cs => GCI92.UseLengthToTestEmptyStrings.Fixer.cs} (97%) rename src/EcoCode.Core/Analyzers/{EC92.UseLengthToTestEmptyStrings.cs => GCI92.UseLengthToTestEmptyStrings.cs} (94%) rename src/EcoCode.Core/Analyzers/{EC93.ReturnTaskDirectly.Fixer.cs => GCI93.ReturnTaskDirectly.Fixer.cs} (99%) rename src/EcoCode.Core/Analyzers/{EC93.ReturnTaskDirectly.cs => GCI93.ReturnTaskDirectly.cs} (96%) rename src/EcoCode.Tests/Tests/{EC69.DontCallFunctionsInLoopConditions.Tests.cs => GCI69.DontCallFunctionsInLoopConditions.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC72.DontExecuteSqlCommandsInLoops.Tests.cs => GCI72.DontExecuteSqlCommandsInLoops.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC75.DontConcatenateStringsInLoops.Tests.cs => GCI75.DontConcatenateStringsInLoops.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC81.SpecifyStructLayout.Tests.cs => GCI81.SpecifyStructLayout.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC82.VariableCanBeMadeConstant.Tests.cs => GCI82.VariableCanBeMadeConstant.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC83.ReplaceEnumToStringWithNameOf.Tests.cs => GCI83.ReplaceEnumToStringWithNameOf.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC84.AvoidAsyncVoidMethods.Tests.cs => GCI84.AvoidAsyncVoidMethods.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC85.MakeTypeSealed.Tests.cs => GCI85.MakeTypeSealed.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC86.GCCollectShouldNotBeCalled.Tests.cs => GCI86.GCCollectShouldNotBeCalled.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC87.UseListIndexer.Tests.cs => GCI87.UseListIndexer.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC88.DisposeResourceAsynchronously.Tests.cs => GCI88.DisposeResourceAsynchronously.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC91.UseWhereBeforeOrderBy.Tests.cs => GCI91.UseWhereBeforeOrderBy.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC92.UseStringsEmptyLength.Tests.cs => GCI92.UseStringsEmptyLength.Tests.cs} (100%) rename src/EcoCode.Tests/Tests/{EC93.ReturnTaskDirectly.Tests.cs => GCI93.ReturnTaskDirectly.Tests.cs} (100%) diff --git a/README.md b/README.md index 02e52b5b..48d37004 100644 --- a/README.md +++ b/README.md @@ -48,20 +48,20 @@ EcoCode C# can use [SonarScanner for .Net](https://docs.sonarsource.com/sonarqub |Id|Description|Severity|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|⚠️|❌| -|[EC81](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC81/csharp/EC81.asciidoc)|Specify `struct` layouts|⚠️|✔️| -|[EC82](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC82/csharp/EC82.asciidoc)|Variable can be made constant|ℹ️|✔️| -|[EC83](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC83/csharp/EC83.asciidoc)|Replace Enum `ToString()` with `nameof`|⚠️|✔️| -|[EC84](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC84/csharp/EC84.asciidoc)|Avoid `async void` methods|⚠️|✔️| -|[EC85](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC85/csharp/EC85.asciidoc)|Make type `sealed`|ℹ️|✔️| -|[EC86](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC86/csharp/EC86.asciidoc)|`GC.Collect` should not be called|⚠️|❌| -|[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|⚠️|✔️| -|[EC91](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC91/csharp/EC91.asciidoc)|Use `Where` before `OrderBy`|⚠️|✔️| -|[EC92](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC92/csharp/EC92.asciidoc)|Use `Length` to test empty `strings`|⚠️|✔️| -|[EC93](https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC93/csharp/EC93.asciidoc)|Return `Task` directly|ℹ️|✔️| +|[GCI69](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI69/csharp/GCI69.asciidoc)|Don’t call loop invariant functions in loop conditions|⚠️|❌| +|[GCI72](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI72/csharp/GCI72.asciidoc)|Don’t execute SQL queries in loops|⚠️|❌| +|[GCI75](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI75/csharp/GCI75.asciidoc)|Don’t concatenate `strings` in loops|⚠️|❌| +|[GCI81](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI81/csharp/GCI81.asciidoc)|Specify `struct` layouts|⚠️|✔️| +|[GCI82](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI82/csharp/GCI82.asciidoc)|Variable can be made constant|ℹ️|✔️| +|[GCI83](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI83/csharp/GCI83.asciidoc)|Replace Enum `ToString()` with `nameof`|⚠️|✔️| +|[GCI84](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI84/csharp/GCI84.asciidoc)|Avoid `async void` methods|⚠️|✔️| +|[GCI85](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI85/csharp/GCI85.asciidoc)|Make type `sealed`|ℹ️|✔️| +|[GCI86](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI86/csharp/GCI86.asciidoc)|`GC.Collect` should not be called|⚠️|❌| +|[GCI87](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI87/csharp/GCI87.asciidoc)|Use collection indexer|⚠️|✔️| +|[GCI88](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI88/csharp/GCI88.asciidoc)|Dispose resource asynchronously|⚠️|✔️| +|[GCI91](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI91/csharp/GCI91.asciidoc)|Use `Where` before `OrderBy`|⚠️|✔️| +|[GCI92](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI92/csharp/GCI92.asciidoc)|Use `Length` to test empty `strings`|⚠️|✔️| +|[GCI93](https://github.com/green-code-initiative/creedengo-rules-specifications/blob/main/src/main/rules/GCI93/csharp/GCI93.asciidoc)|Return `Task` directly|ℹ️|✔️| 🌿 Customized Roslyn Rules ------------------- diff --git a/src/EcoCode.Core/Analyzers/EC69.DontCallFunctionsInLoopConditions.cs b/src/EcoCode.Core/Analyzers/GCI69.DontCallFunctionsInLoopConditions.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC69.DontCallFunctionsInLoopConditions.cs rename to src/EcoCode.Core/Analyzers/GCI69.DontCallFunctionsInLoopConditions.cs index 96cdf2df..8a921251 100644 --- a/src/EcoCode.Core/Analyzers/EC69.DontCallFunctionsInLoopConditions.cs +++ b/src/EcoCode.Core/Analyzers/GCI69.DontCallFunctionsInLoopConditions.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC69: Don't call loop invariant functions in loop conditions.</summary> +/// <summary>GCI69: Don't call loop invariant functions in loop conditions.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class DontCallFunctionsInLoopConditions : DiagnosticAnalyzer { @@ -11,7 +11,7 @@ public sealed class DontCallFunctionsInLoopConditions : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC69_DontCallFunctionsInLoopConditions, + id: Rule.Ids.GCI69_DontCallFunctionsInLoopConditions, title: "Don't call loop invariant functions in loop conditions", message: "A loop invariant function is called in a loop condition", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC72.DontExecuteSqlCommandsInLoops.cs b/src/EcoCode.Core/Analyzers/GCI72.DontExecuteSqlCommandsInLoops.cs similarity index 94% rename from src/EcoCode.Core/Analyzers/EC72.DontExecuteSqlCommandsInLoops.cs rename to src/EcoCode.Core/Analyzers/GCI72.DontExecuteSqlCommandsInLoops.cs index f1618476..c86f0fb9 100644 --- a/src/EcoCode.Core/Analyzers/EC72.DontExecuteSqlCommandsInLoops.cs +++ b/src/EcoCode.Core/Analyzers/GCI72.DontExecuteSqlCommandsInLoops.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC72: Don't execute SQL commands in loops.</summary> +/// <summary>GCI72: Don't execute SQL commands in loops.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class DontExecuteSqlCommandsInLoops : DiagnosticAnalyzer { @@ -8,7 +8,7 @@ public sealed class DontExecuteSqlCommandsInLoops : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC72_DontExecuteSqlCommandsInLoops, + id: Rule.Ids.GCI72_DontExecuteSqlCommandsInLoops, title: "Don't execute SQL commands in loops", message: "A SQL command is executed in a loop", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC75.DontConcatenateStringsInLoops.cs b/src/EcoCode.Core/Analyzers/GCI75.DontConcatenateStringsInLoops.cs similarity index 98% rename from src/EcoCode.Core/Analyzers/EC75.DontConcatenateStringsInLoops.cs rename to src/EcoCode.Core/Analyzers/GCI75.DontConcatenateStringsInLoops.cs index 56364e05..5d527ae7 100644 --- a/src/EcoCode.Core/Analyzers/EC75.DontConcatenateStringsInLoops.cs +++ b/src/EcoCode.Core/Analyzers/GCI75.DontConcatenateStringsInLoops.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC75: Don't concatenate strings in loops.</summary> +/// <summary>GCI75: Don't concatenate strings in loops.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class DontConcatenateStringsInLoops : DiagnosticAnalyzer { @@ -13,7 +13,7 @@ public sealed class DontConcatenateStringsInLoops : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC75_DontConcatenateStringsInLoops, + id: Rule.Ids.GCI75_DontConcatenateStringsInLoops, title: "Don't concatenate strings in loops", message: "A string is concatenated in a loop", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC81.SpecifyStructLayout.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI81.SpecifyStructLayout.Fixer.cs similarity index 98% rename from src/EcoCode.Core/Analyzers/EC81.SpecifyStructLayout.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI81.SpecifyStructLayout.Fixer.cs index 448c1c2b..f7a89b20 100644 --- a/src/EcoCode.Core/Analyzers/EC81.SpecifyStructLayout.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI81.SpecifyStructLayout.Fixer.cs @@ -2,7 +2,7 @@ namespace EcoCode.Analyzers; -/// <summary>EC81 fixer: Use struct layout.</summary> +/// <summary>GCI81 fixer: Use struct layout.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(SpecifyStructLayoutFixer)), Shared] public sealed class SpecifyStructLayoutFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC81.SpecifyStructLayout.cs b/src/EcoCode.Core/Analyzers/GCI81.SpecifyStructLayout.cs similarity index 96% rename from src/EcoCode.Core/Analyzers/EC81.SpecifyStructLayout.cs rename to src/EcoCode.Core/Analyzers/GCI81.SpecifyStructLayout.cs index 5881ba04..70c5ee2a 100644 --- a/src/EcoCode.Core/Analyzers/EC81.SpecifyStructLayout.cs +++ b/src/EcoCode.Core/Analyzers/GCI81.SpecifyStructLayout.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC81: Specify struct layout.</summary> +/// <summary>GCI81: Specify struct layout.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class SpecifyStructLayout : DiagnosticAnalyzer { @@ -8,7 +8,7 @@ public sealed class SpecifyStructLayout : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC81_UseStructLayout, + id: Rule.Ids.GCI81_UseStructLayout, title: "Use struct layout", message: "Use struct layout", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC82.VariableCanBeMadeConstant.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI82.VariableCanBeMadeConstant.Fixer.cs similarity index 98% rename from src/EcoCode.Core/Analyzers/EC82.VariableCanBeMadeConstant.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI82.VariableCanBeMadeConstant.Fixer.cs index c9408565..792949e4 100644 --- a/src/EcoCode.Core/Analyzers/EC82.VariableCanBeMadeConstant.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI82.VariableCanBeMadeConstant.Fixer.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC82 dixer: Variable can be made constant.</summary> +/// <summary>GCI82 dixer: Variable can be made constant.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(VariableCanBeMadeConstantFixer)), Shared] public sealed class VariableCanBeMadeConstantFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC82.VariableCanBeMadeConstant.cs b/src/EcoCode.Core/Analyzers/GCI82.VariableCanBeMadeConstant.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC82.VariableCanBeMadeConstant.cs rename to src/EcoCode.Core/Analyzers/GCI82.VariableCanBeMadeConstant.cs index 5c69b298..fb0edf84 100644 --- a/src/EcoCode.Core/Analyzers/EC82.VariableCanBeMadeConstant.cs +++ b/src/EcoCode.Core/Analyzers/GCI82.VariableCanBeMadeConstant.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC82: Variable can be made constant.</summary> +/// <summary>GCI82: Variable can be made constant.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class VariableCanBeMadeConstant : DiagnosticAnalyzer { @@ -8,7 +8,7 @@ public sealed class VariableCanBeMadeConstant : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC82_VariableCanBeMadeConstant, + id: Rule.Ids.GCI82_VariableCanBeMadeConstant, title: "Variable can be made constant", message: "A variable can be made constant", category: Rule.Categories.Usage, diff --git a/src/EcoCode.Core/Analyzers/EC83.ReplaceEnumToStringWithNameOf.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI83.ReplaceEnumToStringWithNameOf.Fixer.cs similarity index 96% rename from src/EcoCode.Core/Analyzers/EC83.ReplaceEnumToStringWithNameOf.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI83.ReplaceEnumToStringWithNameOf.Fixer.cs index 388d141f..bf15c769 100644 --- a/src/EcoCode.Core/Analyzers/EC83.ReplaceEnumToStringWithNameOf.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI83.ReplaceEnumToStringWithNameOf.Fixer.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC83 fixer: Replace enum ToString with nameof.</summary> +/// <summary>GCI83 fixer: Replace enum ToString with nameof.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(ReplaceEnumToStringWithNameOfFixer)), Shared] public sealed class ReplaceEnumToStringWithNameOfFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC83.ReplaceEnumToStringWithNameOf.cs b/src/EcoCode.Core/Analyzers/GCI83.ReplaceEnumToStringWithNameOf.cs similarity index 96% rename from src/EcoCode.Core/Analyzers/EC83.ReplaceEnumToStringWithNameOf.cs rename to src/EcoCode.Core/Analyzers/GCI83.ReplaceEnumToStringWithNameOf.cs index 30ebb9f8..7aba2bbe 100644 --- a/src/EcoCode.Core/Analyzers/EC83.ReplaceEnumToStringWithNameOf.cs +++ b/src/EcoCode.Core/Analyzers/GCI83.ReplaceEnumToStringWithNameOf.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC83: Replace enum ToString with nameof.</summary> +/// <summary>GCI83: Replace enum ToString with nameof.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class ReplaceEnumToStringWithNameOf : DiagnosticAnalyzer { @@ -9,7 +9,7 @@ public sealed class ReplaceEnumToStringWithNameOf : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC83_ReplaceEnumToStringWithNameOf, + id: Rule.Ids.GCI83_ReplaceEnumToStringWithNameOf, title: "Replace enum ToString with nameof", message: "Enum.ToString() can be replaced with nameof()", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC84.AvoidAsyncVoidMethods.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI84.AvoidAsyncVoidMethods.Fixer.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC84.AvoidAsyncVoidMethods.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI84.AvoidAsyncVoidMethods.Fixer.cs index 95ca415f..f319be8b 100644 --- a/src/EcoCode.Core/Analyzers/EC84.AvoidAsyncVoidMethods.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI84.AvoidAsyncVoidMethods.Fixer.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC84 fixer: Avoid async void methods.</summary> +/// <summary>GCI84 fixer: Avoid async void methods.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(AvoidAsyncVoidMethodsFixer)), Shared] public sealed class AvoidAsyncVoidMethodsFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC84.AvoidAsyncVoidMethods.cs b/src/EcoCode.Core/Analyzers/GCI84.AvoidAsyncVoidMethods.cs similarity index 94% rename from src/EcoCode.Core/Analyzers/EC84.AvoidAsyncVoidMethods.cs rename to src/EcoCode.Core/Analyzers/GCI84.AvoidAsyncVoidMethods.cs index bb55b8c0..a9781954 100644 --- a/src/EcoCode.Core/Analyzers/EC84.AvoidAsyncVoidMethods.cs +++ b/src/EcoCode.Core/Analyzers/GCI84.AvoidAsyncVoidMethods.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC84: Avoid async void methods.</summary> +/// <summary>GCI84: Avoid async void methods.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class AvoidAsyncVoidMethods : DiagnosticAnalyzer { @@ -8,7 +8,7 @@ public sealed class AvoidAsyncVoidMethods : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC84_AvoidAsyncVoidMethods, + id: Rule.Ids.GCI84_AvoidAsyncVoidMethods, title: "Avoid async void methods", message: "Avoid async void methods", category: Rule.Categories.Design, diff --git a/src/EcoCode.Core/Analyzers/EC85.MakeTypeSealed.cs b/src/EcoCode.Core/Analyzers/GCI85.MakeTypeSealed.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC85.MakeTypeSealed.cs rename to src/EcoCode.Core/Analyzers/GCI85.MakeTypeSealed.cs index a62948b8..4916ddc8 100644 --- a/src/EcoCode.Core/Analyzers/EC85.MakeTypeSealed.cs +++ b/src/EcoCode.Core/Analyzers/GCI85.MakeTypeSealed.cs @@ -2,7 +2,7 @@ namespace EcoCode.Analyzers; -/// <summary>EC85: Make type sealed.</summary> +/// <summary>GCI85: Make type sealed.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class MakeTypeSealed : DiagnosticAnalyzer { @@ -10,7 +10,7 @@ public sealed class MakeTypeSealed : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC85_MakeTypeSealed, + id: Rule.Ids.GCI85_MakeTypeSealed, title: "Make type sealed", message: "Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC86.GCCollectShouldNotBeCalled.cs b/src/EcoCode.Core/Analyzers/GCI86.GCCollectShouldNotBeCalled.cs similarity index 96% rename from src/EcoCode.Core/Analyzers/EC86.GCCollectShouldNotBeCalled.cs rename to src/EcoCode.Core/Analyzers/GCI86.GCCollectShouldNotBeCalled.cs index 0085fa17..26431277 100644 --- a/src/EcoCode.Core/Analyzers/EC86.GCCollectShouldNotBeCalled.cs +++ b/src/EcoCode.Core/Analyzers/GCI86.GCCollectShouldNotBeCalled.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC86 : GC Collect should not be called.</summary> +/// <summary>GCI86 : GC Collect should not be called.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class GCCollectShouldNotBeCalled : DiagnosticAnalyzer { @@ -8,7 +8,7 @@ public sealed class GCCollectShouldNotBeCalled : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC86_GCCollectShouldNotBeCalled, + id: Rule.Ids.GCI86_GCCollectShouldNotBeCalled, title: "Avoid calling GC.Collect() method", message: "Avoid calling GC.Collect() method", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC87.UseListIndexer.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI87.UseListIndexer.Fixer.cs similarity index 99% rename from src/EcoCode.Core/Analyzers/EC87.UseListIndexer.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI87.UseListIndexer.Fixer.cs index 40e01850..ac33c805 100644 --- a/src/EcoCode.Core/Analyzers/EC87.UseListIndexer.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI87.UseListIndexer.Fixer.cs @@ -2,7 +2,7 @@ namespace EcoCode.Analyzers; -/// <summary>EC87 fixer: Use list indexer.</summary> +/// <summary>GCI87 fixer: Use list indexer.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UseListIndexerFixer)), Shared] public sealed class UseListIndexerFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC87.UseListIndexer.cs b/src/EcoCode.Core/Analyzers/GCI87.UseListIndexer.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC87.UseListIndexer.cs rename to src/EcoCode.Core/Analyzers/GCI87.UseListIndexer.cs index ba1c94ae..d16d2b31 100644 --- a/src/EcoCode.Core/Analyzers/EC87.UseListIndexer.cs +++ b/src/EcoCode.Core/Analyzers/GCI87.UseListIndexer.cs @@ -2,7 +2,7 @@ namespace EcoCode.Analyzers; -/// <summary>EC87: Use list indexer.</summary> +/// <summary>GCI87: Use list indexer.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class UseListIndexer : DiagnosticAnalyzer { @@ -10,7 +10,7 @@ public sealed class UseListIndexer : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC87_UseCollectionIndexer, + id: Rule.Ids.GCI87_UseCollectionIndexer, title: "Use list indexer", message: "A list indexer should be used instead of a Linq method", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Analyzers/EC88.DisposeResourceAsynchronously.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI88.DisposeResourceAsynchronously.Fixer.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC88.DisposeResourceAsynchronously.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI88.DisposeResourceAsynchronously.Fixer.cs index cc485723..8127963b 100644 --- a/src/EcoCode.Core/Analyzers/EC88.DisposeResourceAsynchronously.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI88.DisposeResourceAsynchronously.Fixer.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC88 fixer: Dispose resource asynchronously.</summary> +/// <summary>GCI88 fixer: Dispose resource asynchronously.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(DisposeResourceAsynchronouslyFixer)), Shared] public sealed class DisposeResourceAsynchronouslyFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC88.DisposeResourceAsynchronously.cs b/src/EcoCode.Core/Analyzers/GCI88.DisposeResourceAsynchronously.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC88.DisposeResourceAsynchronously.cs rename to src/EcoCode.Core/Analyzers/GCI88.DisposeResourceAsynchronously.cs index 54dc4172..5f6b5006 100644 --- a/src/EcoCode.Core/Analyzers/EC88.DisposeResourceAsynchronously.cs +++ b/src/EcoCode.Core/Analyzers/GCI88.DisposeResourceAsynchronously.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC88: Dispose resource asynchronously.</summary> +/// <summary>GCI88: Dispose resource asynchronously.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class DisposeResourceAsynchronously : DiagnosticAnalyzer { @@ -9,7 +9,7 @@ public sealed class DisposeResourceAsynchronously : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC88_DisposeResourceAsynchronously, + id: Rule.Ids.GCI88_DisposeResourceAsynchronously, title: "Dispose resource asynchronously", message: "A resource can be disposed asynchronously", category: Rule.Categories.Usage, diff --git a/src/EcoCode.Core/Analyzers/EC91.UseWhereBeforeOrderBy.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI91.UseWhereBeforeOrderBy.Fixer.cs similarity index 98% rename from src/EcoCode.Core/Analyzers/EC91.UseWhereBeforeOrderBy.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI91.UseWhereBeforeOrderBy.Fixer.cs index 87d8b6f7..4ab98ace 100644 --- a/src/EcoCode.Core/Analyzers/EC91.UseWhereBeforeOrderBy.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI91.UseWhereBeforeOrderBy.Fixer.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC91 fixer: Use Where before OrderBy.</summary> +/// <summary>GCI91 fixer: Use Where before OrderBy.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UseWhereBeforeOrderByFixer)), Shared] public sealed class UseWhereBeforeOrderByFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC91.UseWhereBeforeOrderBy.cs b/src/EcoCode.Core/Analyzers/GCI91.UseWhereBeforeOrderBy.cs similarity index 96% rename from src/EcoCode.Core/Analyzers/EC91.UseWhereBeforeOrderBy.cs rename to src/EcoCode.Core/Analyzers/GCI91.UseWhereBeforeOrderBy.cs index 7fef19b1..02d4945b 100644 --- a/src/EcoCode.Core/Analyzers/EC91.UseWhereBeforeOrderBy.cs +++ b/src/EcoCode.Core/Analyzers/GCI91.UseWhereBeforeOrderBy.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC91: Use Where before OrderBy.</summary> +/// <summary>GCI91: Use Where before OrderBy.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class UseWhereBeforeOrderBy : DiagnosticAnalyzer { @@ -9,7 +9,7 @@ public sealed class UseWhereBeforeOrderBy : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC91_UseWhereBeforeOrderBy, + id: Rule.Ids.GCI91_UseWhereBeforeOrderBy, title: "Use Where before OrderBy", message: "Call Where before OrderBy in a LINQ method chain", category: Rule.Categories.Usage, diff --git a/src/EcoCode.Core/Analyzers/EC92.UseLengthToTestEmptyStrings.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI92.UseLengthToTestEmptyStrings.Fixer.cs similarity index 97% rename from src/EcoCode.Core/Analyzers/EC92.UseLengthToTestEmptyStrings.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI92.UseLengthToTestEmptyStrings.Fixer.cs index c8e7f37e..a736284b 100644 --- a/src/EcoCode.Core/Analyzers/EC92.UseLengthToTestEmptyStrings.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI92.UseLengthToTestEmptyStrings.Fixer.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC92 fixer: Use Length to test empty strings.</summary> +/// <summary>GCI92 fixer: Use Length to test empty strings.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UseLengthToTestEmptyStringsFixer)), Shared] public sealed class UseLengthToTestEmptyStringsFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC92.UseLengthToTestEmptyStrings.cs b/src/EcoCode.Core/Analyzers/GCI92.UseLengthToTestEmptyStrings.cs similarity index 94% rename from src/EcoCode.Core/Analyzers/EC92.UseLengthToTestEmptyStrings.cs rename to src/EcoCode.Core/Analyzers/GCI92.UseLengthToTestEmptyStrings.cs index b8e69a35..7220f9c3 100644 --- a/src/EcoCode.Core/Analyzers/EC92.UseLengthToTestEmptyStrings.cs +++ b/src/EcoCode.Core/Analyzers/GCI92.UseLengthToTestEmptyStrings.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC92: Use Length to test empty strings.</summary> +/// <summary>GCI92: Use Length to test empty strings.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class UseLengthToTestEmptyStrings : DiagnosticAnalyzer { @@ -9,7 +9,7 @@ public sealed class UseLengthToTestEmptyStrings : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC92_UseStringEmptyLength, + id: Rule.Ids.GCI92_UseStringEmptyLength, title: "Use Length to test empty strings", message: "Use string.Length instead of comparison with empty string", category: Rule.Categories.Usage, diff --git a/src/EcoCode.Core/Analyzers/EC93.ReturnTaskDirectly.Fixer.cs b/src/EcoCode.Core/Analyzers/GCI93.ReturnTaskDirectly.Fixer.cs similarity index 99% rename from src/EcoCode.Core/Analyzers/EC93.ReturnTaskDirectly.Fixer.cs rename to src/EcoCode.Core/Analyzers/GCI93.ReturnTaskDirectly.Fixer.cs index 28aaecd0..dad9fbd3 100644 --- a/src/EcoCode.Core/Analyzers/EC93.ReturnTaskDirectly.Fixer.cs +++ b/src/EcoCode.Core/Analyzers/GCI93.ReturnTaskDirectly.Fixer.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC93 fixer: Return Task directly.</summary> +/// <summary>GCI93 fixer: Return Task directly.</summary> [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(ReturnTaskDirectly)), Shared] public sealed class ReturnTaskDirectlyFixer : CodeFixProvider { diff --git a/src/EcoCode.Core/Analyzers/EC93.ReturnTaskDirectly.cs b/src/EcoCode.Core/Analyzers/GCI93.ReturnTaskDirectly.cs similarity index 96% rename from src/EcoCode.Core/Analyzers/EC93.ReturnTaskDirectly.cs rename to src/EcoCode.Core/Analyzers/GCI93.ReturnTaskDirectly.cs index a152318d..7be1cca1 100644 --- a/src/EcoCode.Core/Analyzers/EC93.ReturnTaskDirectly.cs +++ b/src/EcoCode.Core/Analyzers/GCI93.ReturnTaskDirectly.cs @@ -1,6 +1,6 @@ namespace EcoCode.Analyzers; -/// <summary>EC93: Return Task directly.</summary> +/// <summary>GCI93: Return Task directly.</summary> [DiagnosticAnalyzer(LanguageNames.CSharp)] public sealed class ReturnTaskDirectly : DiagnosticAnalyzer { @@ -8,7 +8,7 @@ public sealed class ReturnTaskDirectly : DiagnosticAnalyzer /// <summary>The diagnostic descriptor.</summary> public static DiagnosticDescriptor Descriptor { get; } = Rule.CreateDescriptor( - id: Rule.Ids.EC93_ReturnTaskDirectly, + id: Rule.Ids.GCI93_ReturnTaskDirectly, title: "Consider returning Task directly", message: "Consider returning a Task directly instead of awaiting a single statement", category: Rule.Categories.Performance, diff --git a/src/EcoCode.Core/Models/Rule.cs b/src/EcoCode.Core/Models/Rule.cs index 75ca6e15..4a067e6e 100644 --- a/src/EcoCode.Core/Models/Rule.cs +++ b/src/EcoCode.Core/Models/Rule.cs @@ -11,21 +11,21 @@ public static class Categories public static class Ids { - public const string EC69_DontCallFunctionsInLoopConditions = "EC69"; - public const string EC72_DontExecuteSqlCommandsInLoops = "EC72"; - public const string EC75_DontConcatenateStringsInLoops = "EC75"; - public const string EC81_UseStructLayout = "EC81"; - public const string EC82_VariableCanBeMadeConstant = "EC82"; - public const string EC83_ReplaceEnumToStringWithNameOf = "EC83"; - public const string EC84_AvoidAsyncVoidMethods = "EC84"; - public const string EC85_MakeTypeSealed = "EC85"; - public const string EC86_GCCollectShouldNotBeCalled = "EC86"; - public const string EC87_UseCollectionIndexer = "EC87"; - public const string EC88_DisposeResourceAsynchronously = "EC88"; - public const string EC89_DoNotPassMutableStructAsRefReadonly = "EC89"; - public const string EC91_UseWhereBeforeOrderBy = "EC91"; - public const string EC92_UseStringEmptyLength = "EC92"; - public const string EC93_ReturnTaskDirectly = "EC93"; + public const string GCI69_DontCallFunctionsInLoopConditions = "GCI69"; + public const string GCI72_DontExecuteSqlCommandsInLoops = "GCI72"; + public const string GCI75_DontConcatenateStringsInLoops = "GCI75"; + public const string GCI81_UseStructLayout = "GCI81"; + public const string GCI82_VariableCanBeMadeConstant = "GCI82"; + public const string GCI83_ReplaceEnumToStringWithNameOf = "GCI83"; + public const string GCI84_AvoidAsyncVoidMethods = "GCI84"; + public const string GCI85_MakeTypeSealed = "GCI85"; + public const string GCI86_GCCollectShouldNotBeCalled = "GCI86"; + public const string GCI87_UseCollectionIndexer = "GCI87"; + public const string GCI88_DisposeResourceAsynchronously = "GCI88"; + public const string GCI89_DoNotPassMutableStructAsRefReadonly = "GCI89"; + public const string GCI91_UseWhereBeforeOrderBy = "GCI91"; + public const string GCI92_UseStringEmptyLength = "GCI92"; + public const string GCI93_ReturnTaskDirectly = "GCI93"; } /// <summary>Creates a diagnostic descriptor.</summary> diff --git a/src/EcoCode.Tests/Tests/EC69.DontCallFunctionsInLoopConditions.Tests.cs b/src/EcoCode.Tests/Tests/GCI69.DontCallFunctionsInLoopConditions.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC69.DontCallFunctionsInLoopConditions.Tests.cs rename to src/EcoCode.Tests/Tests/GCI69.DontCallFunctionsInLoopConditions.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC72.DontExecuteSqlCommandsInLoops.Tests.cs b/src/EcoCode.Tests/Tests/GCI72.DontExecuteSqlCommandsInLoops.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC72.DontExecuteSqlCommandsInLoops.Tests.cs rename to src/EcoCode.Tests/Tests/GCI72.DontExecuteSqlCommandsInLoops.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC75.DontConcatenateStringsInLoops.Tests.cs b/src/EcoCode.Tests/Tests/GCI75.DontConcatenateStringsInLoops.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC75.DontConcatenateStringsInLoops.Tests.cs rename to src/EcoCode.Tests/Tests/GCI75.DontConcatenateStringsInLoops.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC81.SpecifyStructLayout.Tests.cs b/src/EcoCode.Tests/Tests/GCI81.SpecifyStructLayout.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC81.SpecifyStructLayout.Tests.cs rename to src/EcoCode.Tests/Tests/GCI81.SpecifyStructLayout.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC82.VariableCanBeMadeConstant.Tests.cs b/src/EcoCode.Tests/Tests/GCI82.VariableCanBeMadeConstant.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC82.VariableCanBeMadeConstant.Tests.cs rename to src/EcoCode.Tests/Tests/GCI82.VariableCanBeMadeConstant.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC83.ReplaceEnumToStringWithNameOf.Tests.cs b/src/EcoCode.Tests/Tests/GCI83.ReplaceEnumToStringWithNameOf.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC83.ReplaceEnumToStringWithNameOf.Tests.cs rename to src/EcoCode.Tests/Tests/GCI83.ReplaceEnumToStringWithNameOf.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC84.AvoidAsyncVoidMethods.Tests.cs b/src/EcoCode.Tests/Tests/GCI84.AvoidAsyncVoidMethods.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC84.AvoidAsyncVoidMethods.Tests.cs rename to src/EcoCode.Tests/Tests/GCI84.AvoidAsyncVoidMethods.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC85.MakeTypeSealed.Tests.cs b/src/EcoCode.Tests/Tests/GCI85.MakeTypeSealed.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC85.MakeTypeSealed.Tests.cs rename to src/EcoCode.Tests/Tests/GCI85.MakeTypeSealed.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC86.GCCollectShouldNotBeCalled.Tests.cs b/src/EcoCode.Tests/Tests/GCI86.GCCollectShouldNotBeCalled.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC86.GCCollectShouldNotBeCalled.Tests.cs rename to src/EcoCode.Tests/Tests/GCI86.GCCollectShouldNotBeCalled.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC87.UseListIndexer.Tests.cs b/src/EcoCode.Tests/Tests/GCI87.UseListIndexer.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC87.UseListIndexer.Tests.cs rename to src/EcoCode.Tests/Tests/GCI87.UseListIndexer.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC88.DisposeResourceAsynchronously.Tests.cs b/src/EcoCode.Tests/Tests/GCI88.DisposeResourceAsynchronously.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC88.DisposeResourceAsynchronously.Tests.cs rename to src/EcoCode.Tests/Tests/GCI88.DisposeResourceAsynchronously.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC91.UseWhereBeforeOrderBy.Tests.cs b/src/EcoCode.Tests/Tests/GCI91.UseWhereBeforeOrderBy.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC91.UseWhereBeforeOrderBy.Tests.cs rename to src/EcoCode.Tests/Tests/GCI91.UseWhereBeforeOrderBy.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC92.UseStringsEmptyLength.Tests.cs b/src/EcoCode.Tests/Tests/GCI92.UseStringsEmptyLength.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC92.UseStringsEmptyLength.Tests.cs rename to src/EcoCode.Tests/Tests/GCI92.UseStringsEmptyLength.Tests.cs diff --git a/src/EcoCode.Tests/Tests/EC93.ReturnTaskDirectly.Tests.cs b/src/EcoCode.Tests/Tests/GCI93.ReturnTaskDirectly.Tests.cs similarity index 100% rename from src/EcoCode.Tests/Tests/EC93.ReturnTaskDirectly.Tests.cs rename to src/EcoCode.Tests/Tests/GCI93.ReturnTaskDirectly.Tests.cs