Skip to content

Commit 2a19c5b

Browse files
committed
Add RSxxxx diagnostic for compilation end diagnostic descriptors without CompilationEnd custom tag
Closes #6282
1 parent b7bb138 commit 2a19c5b

21 files changed

+814
-17
lines changed

src/Microsoft.CodeAnalysis.Analyzers/Core/AnalyzerReleases.Unshipped.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Rule ID | Category | Severity | Notes
66
--------|----------|----------|-------
77
RS1035 | MicrosoftCodeAnalysisCorrectness | Error | SymbolIsBannedInAnalyzersAnalyzer
88
RS1036 | MicrosoftCodeAnalysisCorrectness | Warning | SymbolIsBannedInAnalyzersAnalyzer
9+
RS1037 | MicrosoftCodeAnalysisDesign | Warning | DiagnosticDescriptorCreationAnalyzer

src/Microsoft.CodeAnalysis.Analyzers/Core/CodeAnalysisDiagnosticsResources.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,15 @@
514514
<data name="DefineDiagnosticDescriptionCorrectlyTitle" xml:space="preserve">
515515
<value>Define diagnostic description correctly</value>
516516
</data>
517+
<data name="AddCompilationEndCustomTagDescription" xml:space="preserve">
518+
<value>'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</value>
519+
</data>
520+
<data name="AddCompilationEndCustomTagMessage" xml:space="preserve">
521+
<value>Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</value>
522+
</data>
523+
<data name="AddCompilationEndCustomTagTitle" xml:space="preserve">
524+
<value>Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</value>
525+
</data>
517526
<data name="CompareSymbolsCorrectlyDescriptionGetHashCode" xml:space="preserve">
518527
<value>Symbols should be compared for equality, not identity. An explicit call to 'GetHashCode' will likely result in the wrong behavior.</value>
519528
</data>

src/Microsoft.CodeAnalysis.Analyzers/Core/DiagnosticIds.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ internal static class DiagnosticIds
4040
public const string PreferIsKindRuleId = "RS1034";
4141
public const string SymbolIsBannedInAnalyzersRuleId = "RS1035";
4242
public const string NoSettingSpecifiedSymbolIsBannedInAnalyzersRuleId = "RS1036";
43+
public const string AddCompilationEndCustomTagRuleId = "RS1037";
4344

4445
// Release tracking analyzer IDs
4546
public const string DeclareDiagnosticIdInAnalyzerReleaseRuleId = "RS2000";

src/Microsoft.CodeAnalysis.Analyzers/Core/MetaAnalyzers/DiagnosticDescriptorCreationAnalyzer.cs

Lines changed: 193 additions & 17 deletions
Large diffs are not rendered by default.

src/Microsoft.CodeAnalysis.Analyzers/Core/xlf/CodeAnalysisDiagnosticsResources.cs.xlf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
33
<file datatype="xml" source-language="en" target-language="cs" original="../CodeAnalysisDiagnosticsResources.resx">
44
<body>
5+
<trans-unit id="AddCompilationEndCustomTagDescription">
6+
<source>'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</source>
7+
<target state="new">'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="AddCompilationEndCustomTagMessage">
11+
<source>Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</source>
12+
<target state="new">Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</target>
13+
<note />
14+
</trans-unit>
15+
<trans-unit id="AddCompilationEndCustomTagTitle">
16+
<source>Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</source>
17+
<target state="new">Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</target>
18+
<note />
19+
</trans-unit>
520
<trans-unit id="AddEntryForDiagnosticIdInAnalyzerReleaseCodeFixTitle">
621
<source>Add rule entry to unshipped release file</source>
722
<target state="translated">Přidat položku pravidla k nevydanému souboru verze</target>

src/Microsoft.CodeAnalysis.Analyzers/Core/xlf/CodeAnalysisDiagnosticsResources.de.xlf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
33
<file datatype="xml" source-language="en" target-language="de" original="../CodeAnalysisDiagnosticsResources.resx">
44
<body>
5+
<trans-unit id="AddCompilationEndCustomTagDescription">
6+
<source>'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</source>
7+
<target state="new">'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="AddCompilationEndCustomTagMessage">
11+
<source>Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</source>
12+
<target state="new">Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</target>
13+
<note />
14+
</trans-unit>
15+
<trans-unit id="AddCompilationEndCustomTagTitle">
16+
<source>Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</source>
17+
<target state="new">Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</target>
18+
<note />
19+
</trans-unit>
520
<trans-unit id="AddEntryForDiagnosticIdInAnalyzerReleaseCodeFixTitle">
621
<source>Add rule entry to unshipped release file</source>
722
<target state="translated">Regeleintrag der nicht veröffentlichten Releasedatei hinzufügen</target>

src/Microsoft.CodeAnalysis.Analyzers/Core/xlf/CodeAnalysisDiagnosticsResources.es.xlf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
33
<file datatype="xml" source-language="en" target-language="es" original="../CodeAnalysisDiagnosticsResources.resx">
44
<body>
5+
<trans-unit id="AddCompilationEndCustomTagDescription">
6+
<source>'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</source>
7+
<target state="new">'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="AddCompilationEndCustomTagMessage">
11+
<source>Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</source>
12+
<target state="new">Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</target>
13+
<note />
14+
</trans-unit>
15+
<trans-unit id="AddCompilationEndCustomTagTitle">
16+
<source>Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</source>
17+
<target state="new">Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</target>
18+
<note />
19+
</trans-unit>
520
<trans-unit id="AddEntryForDiagnosticIdInAnalyzerReleaseCodeFixTitle">
621
<source>Add rule entry to unshipped release file</source>
722
<target state="translated">Agregar una entrada de regla a un archivo de versión no incluido</target>

src/Microsoft.CodeAnalysis.Analyzers/Core/xlf/CodeAnalysisDiagnosticsResources.fr.xlf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
33
<file datatype="xml" source-language="en" target-language="fr" original="../CodeAnalysisDiagnosticsResources.resx">
44
<body>
5+
<trans-unit id="AddCompilationEndCustomTagDescription">
6+
<source>'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</source>
7+
<target state="new">'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="AddCompilationEndCustomTagMessage">
11+
<source>Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</source>
12+
<target state="new">Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</target>
13+
<note />
14+
</trans-unit>
15+
<trans-unit id="AddCompilationEndCustomTagTitle">
16+
<source>Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</source>
17+
<target state="new">Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</target>
18+
<note />
19+
</trans-unit>
520
<trans-unit id="AddEntryForDiagnosticIdInAnalyzerReleaseCodeFixTitle">
621
<source>Add rule entry to unshipped release file</source>
722
<target state="translated">Ajouter une entrée de règle au fichier de version non fourni</target>

src/Microsoft.CodeAnalysis.Analyzers/Core/xlf/CodeAnalysisDiagnosticsResources.it.xlf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
33
<file datatype="xml" source-language="en" target-language="it" original="../CodeAnalysisDiagnosticsResources.resx">
44
<body>
5+
<trans-unit id="AddCompilationEndCustomTagDescription">
6+
<source>'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</source>
7+
<target state="new">'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="AddCompilationEndCustomTagMessage">
11+
<source>Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</source>
12+
<target state="new">Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</target>
13+
<note />
14+
</trans-unit>
15+
<trans-unit id="AddCompilationEndCustomTagTitle">
16+
<source>Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</source>
17+
<target state="new">Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</target>
18+
<note />
19+
</trans-unit>
520
<trans-unit id="AddEntryForDiagnosticIdInAnalyzerReleaseCodeFixTitle">
621
<source>Add rule entry to unshipped release file</source>
722
<target state="translated">Aggiungere la voce della regola per il file di versione non distribuito</target>

src/Microsoft.CodeAnalysis.Analyzers/Core/xlf/CodeAnalysisDiagnosticsResources.ja.xlf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
33
<file datatype="xml" source-language="en" target-language="ja" original="../CodeAnalysisDiagnosticsResources.resx">
44
<body>
5+
<trans-unit id="AddCompilationEndCustomTagDescription">
6+
<source>'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</source>
7+
<target state="new">'DiagnosticDescriptor' assigned to field is used to report a compilation end diagnostic, but the 'DiagnosticDescriptor' constructor used to initialize it does not pass in the required custom tag "CompilationEnd". See documentation for 'WellKnownDiagnosticTags.CompilationEnd' for details.</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="AddCompilationEndCustomTagMessage">
11+
<source>Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</source>
12+
<target state="new">Add "CompilationEnd" custom tag to the diagnostic descriptor used to initialize field '{0}' as it is used to report a compilation end diagnostic</target>
13+
<note />
14+
</trans-unit>
15+
<trans-unit id="AddCompilationEndCustomTagTitle">
16+
<source>Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</source>
17+
<target state="new">Add "CompilationEnd" custom tag to compilation end diagnostic descriptor</target>
18+
<note />
19+
</trans-unit>
520
<trans-unit id="AddEntryForDiagnosticIdInAnalyzerReleaseCodeFixTitle">
621
<source>Add rule entry to unshipped release file</source>
722
<target state="translated">未出荷のリリース ファイルへのルール エントリの追加</target>

0 commit comments

Comments
 (0)