From 271f1d485634951ea3adf60adebbc9f01fe55182 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 28 Sep 2023 09:57:25 -0500 Subject: [PATCH 1/2] Update analyzers --- .gitignore | 1 - StyleCop.Analyzers/Directory.Build.props | 10 +- .../StyleCop.Analyzers.Internal.ruleset | 6 + .../DocumentationResources.Designer.cs | 407 ++++++++++++++++++ .../HelpersResources.Designer.cs | 25 ++ .../LayoutResources.Designer.cs | 207 +++++++++ .../MaintainabilityResources.Designer.cs | 131 ++++++ .../NamingResources.Designer.cs | 135 ++++++ .../OrderingResources.Designer.cs | 137 ++++++ .../ReadabilityResources.Designer.cs | 323 ++++++++++++++ .../SettingsResources.Designer.cs | 21 + .../SpacingResources.Designer.cs | 249 +++++++++++ .../SpecialResources.Designer.cs | 33 ++ .../StyleCop.Analyzers.csproj | 2 +- 14 files changed, 1682 insertions(+), 5 deletions(-) create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/DocumentationResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/HelpersResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/LayoutResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/MaintainabilityResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/NamingResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/OrderingResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/ReadabilityResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SettingsResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpacingResources.Designer.cs create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpecialResources.Designer.cs diff --git a/.gitignore b/.gitignore index 9b845092f..3fe9dd0d8 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ OpenCover.Symbols/ .nuget/NuGet.exe build/nuget/ *.log -StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/ # Visual Studio performance tools *.psess diff --git a/StyleCop.Analyzers/Directory.Build.props b/StyleCop.Analyzers/Directory.Build.props index 0dfa64be9..f3a08336b 100644 --- a/StyleCop.Analyzers/Directory.Build.props +++ b/StyleCop.Analyzers/Directory.Build.props @@ -40,6 +40,10 @@ $(NoWarn),1573,1591,1712 + + 3.11.0-beta1.23472.1 + + @@ -48,12 +52,12 @@ - + - + @@ -63,7 +67,7 @@ - + diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Internal.ruleset b/StyleCop.Analyzers/StyleCop.Analyzers.Internal.ruleset index 0233d4b16..133bfd9d4 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Internal.ruleset +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Internal.ruleset @@ -13,6 +13,12 @@ + + + + + + \ No newline at end of file diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/DocumentationResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/DocumentationResources.Designer.cs new file mode 100644 index 000000000..78415df23 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/DocumentationResources.Designer.cs @@ -0,0 +1,407 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.DocumentationRules +{ + internal static partial class DocumentationResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(DocumentationResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Generate constructor documentation + public static string @ConstructorDocumentationCodeFix => GetResourceString("ConstructorDocumentationCodeFix")!; + /// Generate destructor documentation + public static string @DestructorDocumentationCodeFix => GetResourceString("DestructorDocumentationCodeFix")!; + /// Finalizes an instance of the + public static string @DestructorStandardTextFirstPart => GetResourceString("DestructorStandardTextFirstPart")!; + /// class. + public static string @DestructorStandardTextSecondPart => GetResourceString("DestructorStandardTextSecondPart")!; + /// Inherit documentation + public static string @InheritdocCodeFix => GetResourceString("InheritdocCodeFix")!; + /// Generate method documentation + public static string @MethodDocumentationCodeFix => GetResourceString("MethodDocumentationCodeFix")!; + /// Initializes a new instance of the + public static string @NonPrivateConstructorStandardTextFirstPart => GetResourceString("NonPrivateConstructorStandardTextFirstPart")!; + /// {0} + public static string @NonPrivateConstructorStandardTextSecondPart => GetResourceString("NonPrivateConstructorStandardTextSecondPart")!; + /// The parameter is not used. + public static string @ParameterNotUsed => GetResourceString("ParameterNotUsed")!; + /// Prevents a default instance of the + public static string @PrivateConstructorStandardTextFirstPart => GetResourceString("PrivateConstructorStandardTextFirstPart")!; + /// {0} from being created + public static string @PrivateConstructorStandardTextSecondPart => GetResourceString("PrivateConstructorStandardTextSecondPart")!; + /// Add standard text + public static string @PropertySummaryStartTextCodeFix => GetResourceString("PropertySummaryStartTextCodeFix")!; + /// A C# code element is missing a documentation header. + public static string @SA1600Description => GetResourceString("SA1600Description")!; + /// Elements should be documented + public static string @SA1600MessageFormat => GetResourceString("SA1600MessageFormat")!; + /// Elements should be documented + public static string @SA1600Title => GetResourceString("SA1600Title")!; + /// A C# partial element is missing a documentation header. + public static string @SA1601Description => GetResourceString("SA1601Description")!; + /// Partial elements should be documented + public static string @SA1601MessageFormat => GetResourceString("SA1601MessageFormat")!; + /// Partial elements should be documented + public static string @SA1601Title => GetResourceString("SA1601Title")!; + /// An item within a C# enumeration is missing an Xml documentation header. + public static string @SA1602Description => GetResourceString("SA1602Description")!; + /// Enumeration items should be documented + public static string @SA1602MessageFormat => GetResourceString("SA1602MessageFormat")!; + /// Enumeration items should be documented + public static string @SA1602Title => GetResourceString("SA1602Title")!; + /// The XML within a C# element’s document header is badly formed. + public static string @SA1603Description => GetResourceString("SA1603Description")!; + /// The documentation header is composed of invalid XML: {0} + public static string @SA1603MessageFormat => GetResourceString("SA1603MessageFormat")!; + /// Documentation should contain valid XML + public static string @SA1603Title => GetResourceString("SA1603Title")!; + /// The XML header documentation for a C# element is missing a <summary> tag. + public static string @SA1604Description => GetResourceString("SA1604Description")!; + /// Element documentation should have summary + public static string @SA1604MessageFormat => GetResourceString("SA1604MessageFormat")!; + /// Element documentation should have summary + public static string @SA1604Title => GetResourceString("SA1604Title")!; + /// The <summary> or <content> tag within the documentation header for a C# code element is missing or empty. + public static string @SA1605Description => GetResourceString("SA1605Description")!; + /// Partial element documentation should have summary + public static string @SA1605MessageFormat => GetResourceString("SA1605MessageFormat")!; + /// Partial element documentation should have summary + public static string @SA1605Title => GetResourceString("SA1605Title")!; + /// The <summary> tag within the documentation header for a C# code element is empty. + public static string @SA1606Description => GetResourceString("SA1606Description")!; + /// Element documentation should have summary text + public static string @SA1606MessageFormat => GetResourceString("SA1606MessageFormat")!; + /// Element documentation should have summary text + public static string @SA1606Title => GetResourceString("SA1606Title")!; + /// The <summary> or <content> tag within the documentation header for a C# code element is empty. + public static string @SA1607Description => GetResourceString("SA1607Description")!; + /// Partial element documentation should have summary text + public static string @SA1607MessageFormat => GetResourceString("SA1607MessageFormat")!; + /// Partial element documentation should have summary text + public static string @SA1607Title => GetResourceString("SA1607Title")!; + /// The <summary> tag within an element's XML header documentation contains the default text generated by Visual Studio during the creation of the element. + public static string @SA1608Description => GetResourceString("SA1608Description")!; + /// Element documentation should not have default summary + public static string @SA1608MessageFormat => GetResourceString("SA1608MessageFormat")!; + /// Element documentation should not have default summary + public static string @SA1608Title => GetResourceString("SA1608Title")!; + /// The XML header documentation for a C# property does not contain a <value> tag. + public static string @SA1609Description => GetResourceString("SA1609Description")!; + /// Property documentation should have value + public static string @SA1609MessageFormat => GetResourceString("SA1609MessageFormat")!; + /// Document value from summary + public static string @SA1609SA1610CodeFix => GetResourceString("SA1609SA1610CodeFix")!; + /// Property documentation should have value + public static string @SA1609Title => GetResourceString("SA1609Title")!; + /// The XML header documentation for a C# property contains an empty <value> tag. + public static string @SA1610Description => GetResourceString("SA1610Description")!; + /// Property documentation should have value text + public static string @SA1610MessageFormat => GetResourceString("SA1610MessageFormat")!; + /// Property documentation should have value text + public static string @SA1610Title => GetResourceString("SA1610Title")!; + /// A C# method, constructor, delegate or indexer element is missing documentation for one or more of its parameters. + public static string @SA1611Description => GetResourceString("SA1611Description")!; + /// The documentation for parameter '{0}' is missing + public static string @SA1611MessageFormat => GetResourceString("SA1611MessageFormat")!; + /// Element parameters should be documented + public static string @SA1611Title => GetResourceString("SA1611Title")!; + /// The documentation describing the parameters to a C# method, constructor, delegate or indexer element does not match the actual parameters on the element. + public static string @SA1612Description => GetResourceString("SA1612Description")!; + /// The parameter '{0}' does not exist + public static string @SA1612MissingParamForDocumentationMessageFormat => GetResourceString("SA1612MissingParamForDocumentationMessageFormat")!; + /// The parameter documentation for '{0}' should be at position {1} + public static string @SA1612ParamWrongOrderMessageFormat => GetResourceString("SA1612ParamWrongOrderMessageFormat")!; + /// Element parameter documentation should match element parameters + public static string @SA1612Title => GetResourceString("SA1612Title")!; + /// A <param> tag within a C# element's documentation header is missing a name attribute containing the name of the parameter. + public static string @SA1613Description => GetResourceString("SA1613Description")!; + /// Element parameter documentation should declare parameter name + public static string @SA1613MessageFormat => GetResourceString("SA1613MessageFormat")!; + /// Element parameter documentation should declare parameter name + public static string @SA1613Title => GetResourceString("SA1613Title")!; + /// A <param> tag within a C# element's documentation header is empty. + public static string @SA1614Description => GetResourceString("SA1614Description")!; + /// Element parameter documentation should have text + public static string @SA1614MessageFormat => GetResourceString("SA1614MessageFormat")!; + /// Element parameter documentation should have text + public static string @SA1614Title => GetResourceString("SA1614Title")!; + /// A C# element is missing documentation for its return value. + public static string @SA1615Description => GetResourceString("SA1615Description")!; + /// Element return value should be documented + public static string @SA1615MessageFormat => GetResourceString("SA1615MessageFormat")!; + /// Document return value + public static string @SA1615SA1616CodeFix => GetResourceString("SA1615SA1616CodeFix")!; + /// Element return value should be documented + public static string @SA1615Title => GetResourceString("SA1615Title")!; + /// The <returns> tag within a C# element's documentation header is empty. + public static string @SA1616Description => GetResourceString("SA1616Description")!; + /// Element return value documentation should have text + public static string @SA1616MessageFormat => GetResourceString("SA1616MessageFormat")!; + /// Element return value documentation should have text + public static string @SA1616Title => GetResourceString("SA1616Title")!; + /// Remove <returns> XML comment + public static string @SA1617CodeFix => GetResourceString("SA1617CodeFix")!; + /// A C# code element does not contain a return value, or returns void, but the documentation header for the element contains a <returns> tag. + public static string @SA1617Description => GetResourceString("SA1617Description")!; + /// Void return value should not be documented + public static string @SA1617MessageFormat => GetResourceString("SA1617MessageFormat")!; + /// Void return value should not be documented + public static string @SA1617Title => GetResourceString("SA1617Title")!; + /// A generic C# element is missing documentation for one or more of its generic type parameters. + public static string @SA1618Description => GetResourceString("SA1618Description")!; + /// The documentation for type parameter '{0}' is missing + public static string @SA1618MessageFormat => GetResourceString("SA1618MessageFormat")!; + /// Generic type parameters should be documented + public static string @SA1618Title => GetResourceString("SA1618Title")!; + /// A generic, partial C# element is missing documentation for one or more of its generic type parameters, and the documentation for the element contains a <summary> tag. + public static string @SA1619Description => GetResourceString("SA1619Description")!; + /// The documentation for type parameter '{0}' is missing + public static string @SA1619MessageFormat => GetResourceString("SA1619MessageFormat")!; + /// Generic type parameters should be documented partial class + public static string @SA1619Title => GetResourceString("SA1619Title")!; + /// The <typeparam> tags within the Xml header documentation for a generic C# element do not match the generic type parameters on the element. + public static string @SA1620Description => GetResourceString("SA1620Description")!; + /// The type parameter '{0}' does not exist. + public static string @SA1620MissingMessageFormat => GetResourceString("SA1620MissingMessageFormat")!; + /// Generic type parameter documentation should match type parameters + public static string @SA1620Title => GetResourceString("SA1620Title")!; + /// The type parameter documentation for '{0}' should be at position {1}. + public static string @SA1620WrongOrderMessageFormat => GetResourceString("SA1620WrongOrderMessageFormat")!; + /// A <typeparam> tag within the XML header documentation for a generic C# element is missing a name attribute, or contains an empty name attribute. + public static string @SA1621Description => GetResourceString("SA1621Description")!; + /// Generic type parameter documentation should declare parameter name. + public static string @SA1621MessageFormat => GetResourceString("SA1621MessageFormat")!; + /// Generic type parameter documentation should declare parameter name + public static string @SA1621Title => GetResourceString("SA1621Title")!; + /// A <typeparam> tag within the Xml header documentation for a generic C# element is empty. + public static string @SA1622Description => GetResourceString("SA1622Description")!; + /// Generic type parameter documentation should have text. + public static string @SA1622MessageFormat => GetResourceString("SA1622MessageFormat")!; + /// Generic type parameter documentation should have text + public static string @SA1622Title => GetResourceString("SA1622Title")!; + /// The documentation text within a C# property’s <summary> tag does not match the accessors within the property. + public static string @SA1623Description => GetResourceString("SA1623Description")!; + /// The property's documentation summary text should begin with: '{0}' + public static string @SA1623MessageFormat => GetResourceString("SA1623MessageFormat")!; + /// Property summary documentation should match accessors + public static string @SA1623Title => GetResourceString("SA1623Title")!; + /// The documentation text within a C# property’s <summary> tag takes into account all of the accessors within the property, but one of the accessors has limited access. + public static string @SA1624Description => GetResourceString("SA1624Description")!; + /// Because the property only contains a visible {0} accessor, the documentation summary text should begin with '{1}'. + public static string @SA1624MessageFormat => GetResourceString("SA1624MessageFormat")!; + /// Property summary documentation should omit accessor with restricted access + public static string @SA1624Title => GetResourceString("SA1624Title")!; + /// The Xml documentation for a C# element contains two or more identical entries, indicating that the documentation has been copied and pasted. This can sometimes indicate invalid or poorly written documentation. + public static string @SA1625Description => GetResourceString("SA1625Description")!; + /// Element documentation should not be copied and pasted + public static string @SA1625MessageFormat => GetResourceString("SA1625MessageFormat")!; + /// Element documentation should not be copied and pasted + public static string @SA1625Title => GetResourceString("SA1625Title")!; + /// Convert to line comment + public static string @SA1626CodeFix => GetResourceString("SA1626CodeFix")!; + /// The C# code contains a single-line comment which begins with three forward slashes in a row. + public static string @SA1626Description => GetResourceString("SA1626Description")!; + /// Single-line comments should not use documentation style slashes + public static string @SA1626MessageFormat => GetResourceString("SA1626MessageFormat")!; + /// Single-line comments should not use documentation style slashes + public static string @SA1626Title => GetResourceString("SA1626Title")!; + /// The XML header documentation for a C# code element contains an empty tag. + public static string @SA1627Description => GetResourceString("SA1627Description")!; + /// The documentation text within the '{0}' tag should not be empty + public static string @SA1627MessageFormat => GetResourceString("SA1627MessageFormat")!; + /// Documentation text should not be empty + public static string @SA1627Title => GetResourceString("SA1627Title")!; + /// A section of the XML header documentation for a C# element does not begin with a capital letter. + public static string @SA1628Description => GetResourceString("SA1628Description")!; + /// TODO: Message format + public static string @SA1628MessageFormat => GetResourceString("SA1628MessageFormat")!; + /// Documentation text should begin with a capital letter + public static string @SA1628Title => GetResourceString("SA1628Title")!; + /// Add period + public static string @SA1629CodeFix => GetResourceString("SA1629CodeFix")!; + /// A section of the XML header documentation for a C# element does not end with a period. + public static string @SA1629Description => GetResourceString("SA1629Description")!; + /// Documentation text should end with a period + public static string @SA1629MessageFormat => GetResourceString("SA1629MessageFormat")!; + /// Documentation text should end with a period + public static string @SA1629Title => GetResourceString("SA1629Title")!; + /// A section of the XML header documentation for a C# element does not contain any whitespace between words. + public static string @SA1630Description => GetResourceString("SA1630Description")!; + /// TODO: Message format + public static string @SA1630MessageFormat => GetResourceString("SA1630MessageFormat")!; + /// Documentation text should contain whitespace + public static string @SA1630Title => GetResourceString("SA1630Title")!; + /// A section of the Xml header documentation for a C# element does not contain enough alphabetic characters. + public static string @SA1631Description => GetResourceString("SA1631Description")!; + /// TODO: Message format + public static string @SA1631MessageFormat => GetResourceString("SA1631MessageFormat")!; + /// Documentation should meet character percentage + public static string @SA1631Title => GetResourceString("SA1631Title")!; + /// A section of the Xml header documentation for a C# element is too short. + public static string @SA1632Description => GetResourceString("SA1632Description")!; + /// TODO: Message format + public static string @SA1632MessageFormat => GetResourceString("SA1632MessageFormat")!; + /// Documentation text should meet minimum character length + public static string @SA1632Title => GetResourceString("SA1632Title")!; + /// Add file header + public static string @SA1633CodeFix => GetResourceString("SA1633CodeFix")!; + /// A C# code file is missing a standard file header. + public static string @SA1633Description => GetResourceString("SA1633Description")!; + /// The file header XML is invalid. + public static string @SA1633MessageFormatMalformed => GetResourceString("SA1633MessageFormatMalformed")!; + /// The file header is missing or not located at the top of the file. + public static string @SA1633MessageFormatMissing => GetResourceString("SA1633MessageFormatMissing")!; + /// File should have header + public static string @SA1633Title => GetResourceString("SA1633Title")!; + /// The file header at the top of a C# code file is missing a copyright tag. + public static string @SA1634Description => GetResourceString("SA1634Description")!; + /// The file header should contain a copyright tag. + public static string @SA1634MessageFormat => GetResourceString("SA1634MessageFormat")!; + /// File header should show copyright + public static string @SA1634Title => GetResourceString("SA1634Title")!; + /// The file header at the top of a C# code file is missing copyright text. + public static string @SA1635Description => GetResourceString("SA1635Description")!; + /// File header should have copyright text + public static string @SA1635MessageFormat => GetResourceString("SA1635MessageFormat")!; + /// File header should have copyright text + public static string @SA1635Title => GetResourceString("SA1635Title")!; + /// The file header at the top of a C# code file does not contain the appropriate copyright text. + public static string @SA1636Description => GetResourceString("SA1636Description")!; + /// The file header copyright text should match the copyright text from the settings. + public static string @SA1636MessageFormat => GetResourceString("SA1636MessageFormat")!; + /// File header copyright text should match + public static string @SA1636Title => GetResourceString("SA1636Title")!; + /// The file header at the top of a C# code file is missing the file name. + public static string @SA1637Description => GetResourceString("SA1637Description")!; + /// File header should contain file name. + public static string @SA1637MessageFormat => GetResourceString("SA1637MessageFormat")!; + /// File header should contain file name + public static string @SA1637Title => GetResourceString("SA1637Title")!; + /// The file attribute within copyright tag of the file header at the top of a C# code file does not contain the name of the file. + public static string @SA1638Description => GetResourceString("SA1638Description")!; + /// File header file name documentation should match file name. + public static string @SA1638MessageFormat => GetResourceString("SA1638MessageFormat")!; + /// File header file name documentation should match file name + public static string @SA1638Title => GetResourceString("SA1638Title")!; + /// The file header at the top of a C# code file does not contain a filled-in summary tag. + public static string @SA1639Description => GetResourceString("SA1639Description")!; + /// File header should have summary + public static string @SA1639MessageFormat => GetResourceString("SA1639MessageFormat")!; + /// File header should have summary + public static string @SA1639Title => GetResourceString("SA1639Title")!; + /// The file header at the top of a C# code file does not contain company name text. + public static string @SA1640Description => GetResourceString("SA1640Description")!; + /// The copyright tag should contain a non-empty company attribute. + public static string @SA1640MessageFormat => GetResourceString("SA1640MessageFormat")!; + /// File header should have valid company text + public static string @SA1640Title => GetResourceString("SA1640Title")!; + /// The file header at the top of a C# code file does not contain the appropriate company name text. + public static string @SA1641Description => GetResourceString("SA1641Description")!; + /// The file header company name should match the company name from the settings. + public static string @SA1641MessageFormat => GetResourceString("SA1641MessageFormat")!; + /// File header company name text should match + public static string @SA1641Title => GetResourceString("SA1641Title")!; + /// The XML documentation header for a C# constructor does not contain the appropriate summary text. + public static string @SA1642Description => GetResourceString("SA1642Description")!; + /// Constructor summary documentation should begin with standard text + public static string @SA1642MessageFormat => GetResourceString("SA1642MessageFormat")!; + /// Add standard text + public static string @SA1642SA1643CodeFix => GetResourceString("SA1642SA1643CodeFix")!; + /// Constructor summary documentation should begin with standard text + public static string @SA1642Title => GetResourceString("SA1642Title")!; + /// The XML documentation header for a C# finalizer does not contain the appropriate summary text. + public static string @SA1643Description => GetResourceString("SA1643Description")!; + /// Destructor summary documentation should begin with standard text + public static string @SA1643MessageFormat => GetResourceString("SA1643MessageFormat")!; + /// Destructor summary documentation should begin with standard text + public static string @SA1643Title => GetResourceString("SA1643Title")!; + /// A section within the XML documentation header for a C# element contains blank lines. + public static string @SA1644Description => GetResourceString("SA1644Description")!; + /// TODO: Message format + public static string @SA1644MessageFormat => GetResourceString("SA1644MessageFormat")!; + /// Documentation headers should not contain blank lines + public static string @SA1644Title => GetResourceString("SA1644Title")!; + /// An included XML documentation file does not exist. + public static string @SA1645Description => GetResourceString("SA1645Description")!; + /// TODO: Message format + public static string @SA1645MessageFormat => GetResourceString("SA1645MessageFormat")!; + /// Included documentation file does not exist + public static string @SA1645Title => GetResourceString("SA1645Title")!; + /// An included XML documentation link contains an invalid path. + public static string @SA1646Description => GetResourceString("SA1646Description")!; + /// TODO: Message format + public static string @SA1646MessageFormat => GetResourceString("SA1646MessageFormat")!; + /// Included documentation XPath does not exist + public static string @SA1646Title => GetResourceString("SA1646Title")!; + /// An include tag within an XML documentation header does not contain valid file and path attribute. + public static string @SA1647Description => GetResourceString("SA1647Description")!; + /// TODO: Message format + public static string @SA1647MessageFormat => GetResourceString("SA1647MessageFormat")!; + /// Include node does not contain valid file and path + public static string @SA1647Title => GetResourceString("SA1647Title")!; + /// <inheritdoc> has been used on an element that doesn't inherit from a base class or implement an interface. + public static string @SA1648Description => GetResourceString("SA1648Description")!; + /// inheritdoc should be used with inheriting class + public static string @SA1648MessageFormat => GetResourceString("SA1648MessageFormat")!; + /// inheritdoc should be used with inheriting class + public static string @SA1648Title => GetResourceString("SA1648Title")!; + /// Rename file to match first type name + public static string @SA1649CodeFix => GetResourceString("SA1649CodeFix")!; + /// The file name of a C# code file does not match the first type declared in the file. + public static string @SA1649Description => GetResourceString("SA1649Description")!; + /// File name should match first type name + public static string @SA1649MessageFormat => GetResourceString("SA1649MessageFormat")!; + /// File name should match first type name + public static string @SA1649Title => GetResourceString("SA1649Title")!; + /// The element documentation for the element contains one or more spelling mistakes or unrecognized words. + public static string @SA1650Description => GetResourceString("SA1650Description")!; + /// TODO: Message format + public static string @SA1650MessageFormat => GetResourceString("SA1650MessageFormat")!; + /// Element documentation should be spelled correctly + public static string @SA1650Title => GetResourceString("SA1650Title")!; + /// Finalize placeholder text + public static string @SA1651CodeFix => GetResourceString("SA1651CodeFix")!; + /// The element documentation contains a <placeholder> element. + public static string @SA1651Description => GetResourceString("SA1651Description")!; + /// Do not use placeholder elements + public static string @SA1651MessageFormat => GetResourceString("SA1651MessageFormat")!; + /// Do not use placeholder elements + public static string @SA1651Title => GetResourceString("SA1651Title")!; + /// Gets + public static string @StartingTextGets => GetResourceString("StartingTextGets")!; + /// Gets or sets + public static string @StartingTextGetsOrSets => GetResourceString("StartingTextGetsOrSets")!; + /// Gets or sets a value indicating whether + public static string @StartingTextGetsOrSetsWhether => GetResourceString("StartingTextGetsOrSetsWhether")!; + /// Gets a value indicating whether + public static string @StartingTextGetsWhether => GetResourceString("StartingTextGetsWhether")!; + /// Returns + public static string @StartingTextReturns => GetResourceString("StartingTextReturns")!; + /// Returns a value indicating whether + public static string @StartingTextReturnsWhether => GetResourceString("StartingTextReturnsWhether")!; + /// Sets + public static string @StartingTextSets => GetResourceString("StartingTextSets")!; + /// Sets a value indicating whether + public static string @StartingTextSetsWhether => GetResourceString("StartingTextSetsWhether")!; + /// Initializes static members of the + public static string @StaticConstructorStandardTextFirstPart => GetResourceString("StaticConstructorStandardTextFirstPart")!; + /// {0} + public static string @StaticConstructorStandardTextSecondPart => GetResourceString("StaticConstructorStandardTextSecondPart")!; + /// A + public static string @TaskReturnElementFirstPart => GetResourceString("TaskReturnElementFirstPart")!; + /// representing the result of the asynchronous operation. + public static string @TaskReturnElementSecondPart => GetResourceString("TaskReturnElementSecondPart")!; + /// class + public static string @TypeTextClass => GetResourceString("TypeTextClass")!; + /// struct + public static string @TypeTextStruct => GetResourceString("TypeTextStruct")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/HelpersResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/HelpersResources.Designer.cs new file mode 100644 index 000000000..126525ea1 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/HelpersResources.Designer.cs @@ -0,0 +1,25 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.Helpers +{ + internal static partial class HelpersResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(HelpersResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Fix all '{0}' + public static string @FixAllOccurrencesOfDiagnostic => GetResourceString("FixAllOccurrencesOfDiagnostic")!; + /// Fix all '{0}' in '{1}' + public static string @FixAllOccurrencesOfDiagnosticInScope => GetResourceString("FixAllOccurrencesOfDiagnosticInScope")!; + /// Fix all '{0}' in Solution + public static string @FixAllOccurrencesOfDiagnosticInSolution => GetResourceString("FixAllOccurrencesOfDiagnosticInSolution")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/LayoutResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/LayoutResources.Designer.cs new file mode 100644 index 000000000..b261b244e --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/LayoutResources.Designer.cs @@ -0,0 +1,207 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.LayoutRules +{ + internal static partial class LayoutResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(LayoutResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Align braces + public static string @SA1500CodeFix => GetResourceString("SA1500CodeFix")!; + /// The opening or closing brace within a C# statement, element, or expression is not placed on its own line. + public static string @SA1500Description => GetResourceString("SA1500Description")!; + /// Braces for multi-line statements should not share line + public static string @SA1500MessageFormat => GetResourceString("SA1500MessageFormat")!; + /// Braces for multi-line statements should not share line + public static string @SA1500Title => GetResourceString("SA1500Title")!; + /// Expand single line block + public static string @SA1501CodeFix => GetResourceString("SA1501CodeFix")!; + /// Expand all single line blocks + public static string @SA1501CodeFixAll => GetResourceString("SA1501CodeFixAll")!; + /// A C# statement containing opening and closing braces is written completely on a single line. + public static string @SA1501Description => GetResourceString("SA1501Description")!; + /// Statement should not be on a single line + public static string @SA1501MessageFormat => GetResourceString("SA1501MessageFormat")!; + /// Statement should not be on a single line + public static string @SA1501Title => GetResourceString("SA1501Title")!; + /// Expand element + public static string @SA1502CodeFix => GetResourceString("SA1502CodeFix")!; + /// A C# element containing opening and closing braces is written completely on a single line. + public static string @SA1502Description => GetResourceString("SA1502Description")!; + /// Element should not be on a single line + public static string @SA1502MessageFormat => GetResourceString("SA1502MessageFormat")!; + /// Element should not be on a single line + public static string @SA1502Title => GetResourceString("SA1502Title")!; + /// Wrap with braces + public static string @SA1503CodeFix => GetResourceString("SA1503CodeFix")!; + /// The opening and closing braces for a C# statement have been omitted. + public static string @SA1503Description => GetResourceString("SA1503Description")!; + /// Braces should not be omitted + public static string @SA1503MessageFormat => GetResourceString("SA1503MessageFormat")!; + /// Braces should not be omitted + public static string @SA1503Title => GetResourceString("SA1503Title")!; + /// Reformat accessors to multiple lines style + public static string @SA1504CodeFixMultipleLines => GetResourceString("SA1504CodeFixMultipleLines")!; + /// Reformat accessors to single line style + public static string @SA1504CodeFixSingleLine => GetResourceString("SA1504CodeFixSingleLine")!; + /// Within a C# property, indexer or event, at least one of the child accessors is written on a single line, and at least one of the child accessors is written across multiple lines. + public static string @SA1504Description => GetResourceString("SA1504Description")!; + /// All accessors should be single-line or multi-line + public static string @SA1504MessageFormat => GetResourceString("SA1504MessageFormat")!; + /// All accessors should be single-line or multi-line + public static string @SA1504Title => GetResourceString("SA1504Title")!; + /// Remove blank lines following this brace + public static string @SA1505CodeFix => GetResourceString("SA1505CodeFix")!; + /// An opening brace within a C# element, statement, or expression is followed by a blank line. + public static string @SA1505Description => GetResourceString("SA1505Description")!; + /// An opening brace should not be followed by a blank line + public static string @SA1505MessageFormat => GetResourceString("SA1505MessageFormat")!; + /// Opening braces should not be followed by blank line + public static string @SA1505Title => GetResourceString("SA1505Title")!; + /// Remove blank line(s) after documentation header + public static string @SA1506CodeFix => GetResourceString("SA1506CodeFix")!; + /// An element documentation header above a C# element is followed by a blank line. + public static string @SA1506Description => GetResourceString("SA1506Description")!; + /// Element documentation headers should not be followed by blank line + public static string @SA1506MessageFormat => GetResourceString("SA1506MessageFormat")!; + /// Element documentation headers should not be followed by blank line + public static string @SA1506Title => GetResourceString("SA1506Title")!; + /// Remove multiple blank lines + public static string @SA1507CodeFix => GetResourceString("SA1507CodeFix")!; + /// The C# code contains multiple blank lines in a row. + public static string @SA1507Description => GetResourceString("SA1507Description")!; + /// Code should not contain multiple blank lines in a row + public static string @SA1507MessageFormat => GetResourceString("SA1507MessageFormat")!; + /// Code should not contain multiple blank lines in a row + public static string @SA1507Title => GetResourceString("SA1507Title")!; + /// Remove blank lines preceding this brace + public static string @SA1508CodeFix => GetResourceString("SA1508CodeFix")!; + /// A closing brace within a C# element, statement, or expression is preceded by a blank line. + public static string @SA1508Description => GetResourceString("SA1508Description")!; + /// A closing brace should not be preceded by a blank line + public static string @SA1508MessageFormat => GetResourceString("SA1508MessageFormat")!; + /// Closing braces should not be preceded by blank line + public static string @SA1508Title => GetResourceString("SA1508Title")!; + /// Remove blank lines preceding this brace + public static string @SA1509CodeFix => GetResourceString("SA1509CodeFix")!; + /// An opening brace within a C# element, statement, or expression is preceded by a blank line. + public static string @SA1509Description => GetResourceString("SA1509Description")!; + /// Opening braces should not be preceded by blank line + public static string @SA1509MessageFormat => GetResourceString("SA1509MessageFormat")!; + /// Opening braces should not be preceded by blank line + public static string @SA1509Title => GetResourceString("SA1509Title")!; + /// Remove blank line before chained statement + public static string @SA1510CodeFix => GetResourceString("SA1510CodeFix")!; + /// Chained C# statements are separated by a blank line. + public static string @SA1510Description => GetResourceString("SA1510Description")!; + /// '{0}' statement should not be preceded by a blank line + public static string @SA1510MessageFormat => GetResourceString("SA1510MessageFormat")!; + /// Chained statement blocks should not be preceded by blank line + public static string @SA1510Title => GetResourceString("SA1510Title")!; + /// Remove blank line before while + public static string @SA1511CodeFix => GetResourceString("SA1511CodeFix")!; + /// The while footer at the bottom of a do-while statement is separated from the statement by a blank line. + public static string @SA1511Description => GetResourceString("SA1511Description")!; + /// While-do footer should not be preceded by blank line + public static string @SA1511MessageFormat => GetResourceString("SA1511MessageFormat")!; + /// While-do footer should not be preceded by blank line + public static string @SA1511Title => GetResourceString("SA1511Title")!; + /// Remove blank line after comment + public static string @SA1512CodeFix => GetResourceString("SA1512CodeFix")!; + /// A single-line comment within C# code is followed by a blank line. + public static string @SA1512Description => GetResourceString("SA1512Description")!; + /// Single-line comments should not be followed by blank line + public static string @SA1512MessageFormat => GetResourceString("SA1512MessageFormat")!; + /// Single-line comments should not be followed by blank line + public static string @SA1512Title => GetResourceString("SA1512Title")!; + /// Insert blank line after brace + public static string @SA1513CodeFix => GetResourceString("SA1513CodeFix")!; + /// A closing brace within a C# element, statement, or expression is not followed by a blank line. + public static string @SA1513Description => GetResourceString("SA1513Description")!; + /// Closing brace should be followed by blank line + public static string @SA1513MessageFormat => GetResourceString("SA1513MessageFormat")!; + /// Closing brace should be followed by blank line + public static string @SA1513Title => GetResourceString("SA1513Title")!; + /// Insert blank line before documentation header + public static string @SA1514CodeFix => GetResourceString("SA1514CodeFix")!; + /// An element documentation header above a C# element is not preceded by a blank line. + public static string @SA1514Description => GetResourceString("SA1514Description")!; + /// Element documentation header should be preceded by blank line + public static string @SA1514MessageFormat => GetResourceString("SA1514MessageFormat")!; + /// Element documentation header should be preceded by blank line + public static string @SA1514Title => GetResourceString("SA1514Title")!; + /// Insert blank line before comment + public static string @SA1515CodeFix => GetResourceString("SA1515CodeFix")!; + /// A single-line comment within C# code is not preceded by a blank line. + public static string @SA1515Description => GetResourceString("SA1515Description")!; + /// Single-line comment should be preceded by blank line + public static string @SA1515MessageFormat => GetResourceString("SA1515MessageFormat")!; + /// Single-line comment should be preceded by blank line + public static string @SA1515Title => GetResourceString("SA1515Title")!; + /// Fix blank lines + public static string @SA1516CodeFixAll => GetResourceString("SA1516CodeFixAll")!; + /// Insert new line + public static string @SA1516CodeFixInsert => GetResourceString("SA1516CodeFixInsert")!; + /// Remove blank line + public static string @SA1516CodeFixRemove => GetResourceString("SA1516CodeFixRemove")!; + /// Adjacent C# elements are not separated by a blank line. + public static string @SA1516Description => GetResourceString("SA1516Description")!; + /// Adjacent using directives should not be separated by a blank line. + public static string @SA1516DescriptionOmit => GetResourceString("SA1516DescriptionOmit")!; + /// Adjacent using directives should be separated by a blank line. + public static string @SA1516DescriptionRequire => GetResourceString("SA1516DescriptionRequire")!; + /// Elements should be separated by blank line + public static string @SA1516MessageFormat => GetResourceString("SA1516MessageFormat")!; + /// Using directives should not be separated by blank line + public static string @SA1516MessageFormatOmit => GetResourceString("SA1516MessageFormatOmit")!; + /// Using directives should be separated by blank line + public static string @SA1516MessageFormatRequire => GetResourceString("SA1516MessageFormatRequire")!; + /// Elements should be separated by blank line + public static string @SA1516Title => GetResourceString("SA1516Title")!; + /// Remove blank lines at the start of the file + public static string @SA1517CodeFix => GetResourceString("SA1517CodeFix")!; + /// The code file has blank lines at the start. + public static string @SA1517Description => GetResourceString("SA1517Description")!; + /// Code should not contain blank lines at start of file + public static string @SA1517MessageFormat => GetResourceString("SA1517MessageFormat")!; + /// Code should not contain blank lines at start of file + public static string @SA1517Title => GetResourceString("SA1517Title")!; + /// Fix whitespace at the end of the file + public static string @SA1518CodeFix => GetResourceString("SA1518CodeFix")!; + /// Code should not contain blank lines at the end of the file. + public static string @SA1518DescriptionAllow => GetResourceString("SA1518DescriptionAllow")!; + /// File may not end with a newline character. + public static string @SA1518DescriptionOmit => GetResourceString("SA1518DescriptionOmit")!; + /// File is required to end with a single newline character. + public static string @SA1518DescriptionRequire => GetResourceString("SA1518DescriptionRequire")!; + /// Code should not contain blank lines at the end of the file + public static string @SA1518MessageFormatAllow => GetResourceString("SA1518MessageFormatAllow")!; + /// File may not end with a newline character + public static string @SA1518MessageFormatOmit => GetResourceString("SA1518MessageFormatOmit")!; + /// File is required to end with a single newline character + public static string @SA1518MessageFormatRequire => GetResourceString("SA1518MessageFormatRequire")!; + /// Use line endings correctly at end of file + public static string @SA1518Title => GetResourceString("SA1518Title")!; + /// The opening and closing braces for a multi-line C# statement have been omitted. + public static string @SA1519Description => GetResourceString("SA1519Description")!; + /// Braces should not be omitted from multi-line child statement + public static string @SA1519MessageFormat => GetResourceString("SA1519MessageFormat")!; + /// Braces should not be omitted from multi-line child statement + public static string @SA1519Title => GetResourceString("SA1519Title")!; + /// The opening and closing braces of a chained if/else if/else construct were included for some clauses, but omitted for others. + public static string @SA1520Description => GetResourceString("SA1520Description")!; + /// Use braces consistently + public static string @SA1520MessageFormat => GetResourceString("SA1520MessageFormat")!; + /// Use braces consistently + public static string @SA1520Title => GetResourceString("SA1520Title")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/MaintainabilityResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/MaintainabilityResources.Designer.cs new file mode 100644 index 000000000..c704b6b44 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/MaintainabilityResources.Designer.cs @@ -0,0 +1,131 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.MaintainabilityRules +{ + internal static partial class MaintainabilityResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(MaintainabilityResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Remove parentheses + public static string @SA1119CodeFix => GetResourceString("SA1119CodeFix")!; + /// A C# statement contains parenthesis which are unnecessary and should be removed. + public static string @SA1119Description => GetResourceString("SA1119Description")!; + /// Statement should not use unnecessary parenthesis + public static string @SA1119MessageFormat => GetResourceString("SA1119MessageFormat")!; + /// Statement should not use unnecessary parenthesis + public static string @SA1119Title => GetResourceString("SA1119Title")!; + /// Declare accessibility + public static string @SA1400CodeFix => GetResourceString("SA1400CodeFix")!; + /// The access modifier for a C# element has not been explicitly defined. + public static string @SA1400Description => GetResourceString("SA1400Description")!; + /// Element '{0}' should declare an access modifier + public static string @SA1400MessageFormat => GetResourceString("SA1400MessageFormat")!; + /// Access modifier should be declared + public static string @SA1400Title => GetResourceString("SA1400Title")!; + /// A field within a C# class has an access modifier other than private. + public static string @SA1401Description => GetResourceString("SA1401Description")!; + /// Field should be private + public static string @SA1401MessageFormat => GetResourceString("SA1401MessageFormat")!; + /// Fields should be private + public static string @SA1401Title => GetResourceString("SA1401Title")!; + /// Move type to new file + public static string @SA1402CodeFix => GetResourceString("SA1402CodeFix")!; + /// A C# code file contains more than one unique type. + public static string @SA1402Description => GetResourceString("SA1402Description")!; + /// File may only contain a single type + public static string @SA1402MessageFormat => GetResourceString("SA1402MessageFormat")!; + /// File may only contain a single type + public static string @SA1402Title => GetResourceString("SA1402Title")!; + /// A C# code file contains more than one namespace. + public static string @SA1403Description => GetResourceString("SA1403Description")!; + /// File may only contain a single namespace + public static string @SA1403MessageFormat => GetResourceString("SA1403MessageFormat")!; + /// File may only contain a single namespace + public static string @SA1403Title => GetResourceString("SA1403Title")!; + /// Fix justification + public static string @SA1404CodeFix => GetResourceString("SA1404CodeFix")!; + /// A Code Analysis SuppressMessage attribute does not include a justification. + public static string @SA1404Description => GetResourceString("SA1404Description")!; + /// Code analysis suppression should have justification + public static string @SA1404MessageFormat => GetResourceString("SA1404MessageFormat")!; + /// Code analysis suppression should have justification + public static string @SA1404Title => GetResourceString("SA1404Title")!; + /// A call to Debug.Assert in C# code does not include a descriptive message. + public static string @SA1405Description => GetResourceString("SA1405Description")!; + /// Debug.Assert should provide message text + public static string @SA1405MessageFormat => GetResourceString("SA1405MessageFormat")!; + /// Debug.Assert should provide message text + public static string @SA1405Title => GetResourceString("SA1405Title")!; + /// A call to Debug.Fail in C# code does not include a descriptive message. + public static string @SA1406Description => GetResourceString("SA1406Description")!; + /// Debug.Fail should provide message text + public static string @SA1406MessageFormat => GetResourceString("SA1406MessageFormat")!; + /// Debug.Fail should provide message text + public static string @SA1406Title => GetResourceString("SA1406Title")!; + /// A C# statement contains a complex arithmetic expression which omits parenthesis around operators. + public static string @SA1407Description => GetResourceString("SA1407Description")!; + /// Arithmetic expressions should declare precedence + public static string @SA1407MessageFormat => GetResourceString("SA1407MessageFormat")!; + /// Add parentheses + public static string @SA1407SA1408CodeFix => GetResourceString("SA1407SA1408CodeFix")!; + /// Arithmetic expressions should declare precedence + public static string @SA1407Title => GetResourceString("SA1407Title")!; + /// A C# statement contains a complex conditional expression which omits parenthesis around operators. + public static string @SA1408Description => GetResourceString("SA1408Description")!; + /// Conditional expressions should declare precedence + public static string @SA1408MessageFormat => GetResourceString("SA1408MessageFormat")!; + /// Conditional expressions should declare precedence + public static string @SA1408Title => GetResourceString("SA1408Title")!; + /// A C# file contains code which is unnecessary and can be removed without changing the overall logic of the code. + public static string @SA1409Description => GetResourceString("SA1409Description")!; + /// TODO: Message format + public static string @SA1409MessageFormat => GetResourceString("SA1409MessageFormat")!; + /// Remove unnecessary code + public static string @SA1409Title => GetResourceString("SA1409Title")!; + /// A call to a C# anonymous method does not contain any method parameters, yet the statement still includes parenthesis. + public static string @SA1410Description => GetResourceString("SA1410Description")!; + /// Remove delegate parenthesis when possible + public static string @SA1410MessageFormat => GetResourceString("SA1410MessageFormat")!; + /// Remove parentheses + public static string @SA1410SA1411CodeFix => GetResourceString("SA1410SA1411CodeFix")!; + /// Remove delegate parenthesis when possible + public static string @SA1410Title => GetResourceString("SA1410Title")!; + /// TODO. + public static string @SA1411Description => GetResourceString("SA1411Description")!; + /// Attribute constructor should not use unnecessary parenthesis + public static string @SA1411MessageFormat => GetResourceString("SA1411MessageFormat")!; + /// Attribute constructor should not use unnecessary parenthesis + public static string @SA1411Title => GetResourceString("SA1411Title")!; + /// Change encoding from '{0}' to UTF-8 with byte order mark + public static string @SA1412CodeFix => GetResourceString("SA1412CodeFix")!; + /// Source files should be saved using the UTF-8 encoding with a byte order mark. + public static string @SA1412Description => GetResourceString("SA1412Description")!; + /// Store files as UTF-8 with byte order mark + public static string @SA1412MessageFormat => GetResourceString("SA1412MessageFormat")!; + /// Store files as UTF-8 with byte order mark + public static string @SA1412Title => GetResourceString("SA1412Title")!; + /// Add trailing comma + public static string @SA1413CodeFix => GetResourceString("SA1413CodeFix")!; + /// A multi-line initializer in a C# code file should use a comma on the last line. + public static string @SA1413Description => GetResourceString("SA1413Description")!; + /// Use trailing comma in multi-line initializers + public static string @SA1413MessageFormat => GetResourceString("SA1413MessageFormat")!; + /// Use trailing comma in multi-line initializers + public static string @SA1413Title => GetResourceString("SA1413Title")!; + /// Tuple types appearing in member declarations should have explicitly named tuple elements. + public static string @SA1414Description => GetResourceString("SA1414Description")!; + /// Tuple types in signatures should have element names + public static string @SA1414MessageFormat => GetResourceString("SA1414MessageFormat")!; + /// Tuple types in signatures should have element names + public static string @SA1414Title => GetResourceString("SA1414Title")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/NamingResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/NamingResources.Designer.cs new file mode 100644 index 000000000..6393d2d1b --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/NamingResources.Designer.cs @@ -0,0 +1,135 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.NamingRules +{ + internal static partial class NamingResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(NamingResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Rename To '{0}' + public static string @RenameToCodeFix => GetResourceString("RenameToCodeFix")!; + /// The name of a C# element does not begin with an upper-case letter. + public static string @SA1300Description => GetResourceString("SA1300Description")!; + /// Element '{0}' should begin with an uppercase letter + public static string @SA1300MessageFormat => GetResourceString("SA1300MessageFormat")!; + /// Element should begin with upper-case letter + public static string @SA1300Title => GetResourceString("SA1300Title")!; + /// There are currently no situations in which this rule will fire. + public static string @SA1301Description => GetResourceString("SA1301Description")!; + /// Element should begin with lower-case letter + public static string @SA1301MessageFormat => GetResourceString("SA1301MessageFormat")!; + /// Element should begin with lower-case letter + public static string @SA1301Title => GetResourceString("SA1301Title")!; + /// Prefix interface name with 'I' + public static string @SA1302CodeFix => GetResourceString("SA1302CodeFix")!; + /// The name of a C# interface does not begin with the capital letter I. + public static string @SA1302Description => GetResourceString("SA1302Description")!; + /// Interface names should begin with I + public static string @SA1302MessageFormat => GetResourceString("SA1302MessageFormat")!; + /// Interface names should begin with I + public static string @SA1302Title => GetResourceString("SA1302Title")!; + /// The name of a constant C# field should begin with an upper-case letter. + public static string @SA1303Description => GetResourceString("SA1303Description")!; + /// Const field names should begin with upper-case letter + public static string @SA1303MessageFormat => GetResourceString("SA1303MessageFormat")!; + /// Const field names should begin with upper-case letter + public static string @SA1303Title => GetResourceString("SA1303Title")!; + /// The name of a non-private readonly C# field should being with an upper-case letter. + public static string @SA1304Description => GetResourceString("SA1304Description")!; + /// Non-private readonly fields should begin with upper-case letter + public static string @SA1304MessageFormat => GetResourceString("SA1304MessageFormat")!; + /// Non-private readonly fields should begin with upper-case letter + public static string @SA1304Title => GetResourceString("SA1304Title")!; + /// The name of a field or variable in C# uses Hungarian notation. + public static string @SA1305Description => GetResourceString("SA1305Description")!; + /// {0} '{1}' should not use Hungarian notation + public static string @SA1305MessageFormat => GetResourceString("SA1305MessageFormat")!; + /// Field names should not use Hungarian notation + public static string @SA1305Title => GetResourceString("SA1305Title")!; + /// The name of a field in C# does not begin with a lower-case letter. + public static string @SA1306Description => GetResourceString("SA1306Description")!; + /// Field '{0}' should begin with lower-case letter + public static string @SA1306MessageFormat => GetResourceString("SA1306MessageFormat")!; + /// Field names should begin with lower-case letter + public static string @SA1306Title => GetResourceString("SA1306Title")!; + /// The name of a public or internal field in C# does not begin with an upper-case letter. + public static string @SA1307Description => GetResourceString("SA1307Description")!; + /// Field '{0}' should begin with upper-case letter + public static string @SA1307MessageFormat => GetResourceString("SA1307MessageFormat")!; + /// Accessible fields should begin with upper-case letter + public static string @SA1307Title => GetResourceString("SA1307Title")!; + /// A field name in C# is prefixed with 'm_', 's_', or 't_'. + public static string @SA1308Description => GetResourceString("SA1308Description")!; + /// Field '{0}' should not begin with the prefix '{1}' + public static string @SA1308MessageFormat => GetResourceString("SA1308MessageFormat")!; + /// Variable names should not be prefixed + public static string @SA1308Title => GetResourceString("SA1308Title")!; + /// A field name in C# begins with an underscore. + public static string @SA1309Description => GetResourceString("SA1309Description")!; + /// Field '{0}' should not begin with an underscore + public static string @SA1309MessageFormat => GetResourceString("SA1309MessageFormat")!; + /// Field names should not begin with underscore + public static string @SA1309Title => GetResourceString("SA1309Title")!; + /// A field name in C# contains an underscore. + public static string @SA1310Description => GetResourceString("SA1310Description")!; + /// Field '{0}' should not contain an underscore + public static string @SA1310MessageFormat => GetResourceString("SA1310MessageFormat")!; + /// Field names should not contain underscore + public static string @SA1310Title => GetResourceString("SA1310Title")!; + /// The name of a static readonly field does not begin with an upper-case letter. + public static string @SA1311Description => GetResourceString("SA1311Description")!; + /// Static readonly fields should begin with upper-case letter + public static string @SA1311MessageFormat => GetResourceString("SA1311MessageFormat")!; + /// Static readonly fields should begin with upper-case letter + public static string @SA1311Title => GetResourceString("SA1311Title")!; + /// The name of a variable in C# does not begin with a lower-case letter. + public static string @SA1312Description => GetResourceString("SA1312Description")!; + /// Variable '{0}' should begin with lower-case letter + public static string @SA1312MessageFormat => GetResourceString("SA1312MessageFormat")!; + /// Variable names should begin with lower-case letter + public static string @SA1312Title => GetResourceString("SA1312Title")!; + /// The name of a parameter in C# does not begin with a lower-case letter. + public static string @SA1313Description => GetResourceString("SA1313Description")!; + /// Parameter '{0}' should begin with lower-case letter + public static string @SA1313MessageFormat => GetResourceString("SA1313MessageFormat")!; + /// Parameter names should begin with lower-case letter + public static string @SA1313Title => GetResourceString("SA1313Title")!; + /// Prefix type parameter name with 'T' + public static string @SA1314CodeFix => GetResourceString("SA1314CodeFix")!; + /// The name of a C# type parameter does not begin with the capital letter T. + public static string @SA1314Description => GetResourceString("SA1314Description")!; + /// Type parameter names should begin with T + public static string @SA1314MessageFormat => GetResourceString("SA1314MessageFormat")!; + /// Type parameter names should begin with T + public static string @SA1314Title => GetResourceString("SA1314Title")!; + /// Correct tuple element name casing + public static string @SA1316CodeFix => GetResourceString("SA1316CodeFix")!; + /// Element names within a tuple type should have the correct casing. + public static string @SA1316Description => GetResourceString("SA1316Description")!; + /// Tuple element names should use correct casing + public static string @SA1316MessageFormat => GetResourceString("SA1316MessageFormat")!; + /// Tuple element names should use correct casing + public static string @SA1316Title => GetResourceString("SA1316Title")!; + /// A field name in C# does not begin with an underscore. + public static string @SX1309Description => GetResourceString("SX1309Description")!; + /// Field '{0}' should begin with an underscore + public static string @SX1309MessageFormat => GetResourceString("SX1309MessageFormat")!; + /// A static field name in C# does not begin with an underscore. + public static string @SX1309SDescription => GetResourceString("SX1309SDescription")!; + /// Static field '{0}' should begin with an underscore + public static string @SX1309SMessageFormat => GetResourceString("SX1309SMessageFormat")!; + /// Static field names should begin with underscore + public static string @SX1309STitle => GetResourceString("SX1309STitle")!; + /// Field names should begin with underscore + public static string @SX1309Title => GetResourceString("SX1309Title")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/OrderingResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/OrderingResources.Designer.cs new file mode 100644 index 000000000..85eafd3e6 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/OrderingResources.Designer.cs @@ -0,0 +1,137 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.OrderingRules +{ + internal static partial class OrderingResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(OrderingResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Fix element order + public static string @ElementOrderCodeFix => GetResourceString("ElementOrderCodeFix")!; + /// Fix modifier order + public static string @ModifierOrderCodeFix => GetResourceString("ModifierOrderCodeFix")!; + /// A C# using directive is placed outside of a namespace element. + public static string @SA1200DescriptionInside => GetResourceString("SA1200DescriptionInside")!; + /// A C# using directive is placed inside of a namespace declaration. + public static string @SA1200DescriptionOutside => GetResourceString("SA1200DescriptionOutside")!; + /// Using directive should appear within a namespace declaration + public static string @SA1200MessageFormatInside => GetResourceString("SA1200MessageFormatInside")!; + /// Using directive should appear outside a namespace declaration + public static string @SA1200MessageFormatOutside => GetResourceString("SA1200MessageFormatOutside")!; + /// Using directives should be placed correctly + public static string @SA1200Title => GetResourceString("SA1200Title")!; + /// An element within a C# code file is out of order in relation to the other elements in the code. + public static string @SA1201Description => GetResourceString("SA1201Description")!; + /// A {0} should not follow a {1} + public static string @SA1201MessageFormat => GetResourceString("SA1201MessageFormat")!; + /// Elements should appear in the correct order + public static string @SA1201Title => GetResourceString("SA1201Title")!; + /// An element within a C# code file is out of order in relation to other elements in the code. + public static string @SA1202Description => GetResourceString("SA1202Description")!; + /// '{0}' members should come before '{1}' members + public static string @SA1202MessageFormat => GetResourceString("SA1202MessageFormat")!; + /// Elements should be ordered by access + public static string @SA1202Title => GetResourceString("SA1202Title")!; + /// A constant field is placed beneath a non-constant field. + public static string @SA1203Description => GetResourceString("SA1203Description")!; + /// Constant fields should appear before non-constant fields + public static string @SA1203MessageFormat => GetResourceString("SA1203MessageFormat")!; + /// Constants should appear before fields + public static string @SA1203Title => GetResourceString("SA1203Title")!; + /// A static element is positioned beneath an instance element. + public static string @SA1204Description => GetResourceString("SA1204Description")!; + /// Static members should appear before non-static members + public static string @SA1204MessageFormat => GetResourceString("SA1204MessageFormat")!; + /// Static elements should appear before instance elements + public static string @SA1204Title => GetResourceString("SA1204Title")!; + /// Add access modifier + public static string @SA1205CodeFix => GetResourceString("SA1205CodeFix")!; + /// The partial element does not have an access modifier defined. + public static string @SA1205Description => GetResourceString("SA1205Description")!; + /// Partial elements should declare an access modifier + public static string @SA1205MessageFormat => GetResourceString("SA1205MessageFormat")!; + /// Partial elements should declare access + public static string @SA1205Title => GetResourceString("SA1205Title")!; + /// The keywords within the declaration of an element do not follow a standard ordering scheme. + public static string @SA1206Description => GetResourceString("SA1206Description")!; + /// The '{0}' modifier should appear before '{1}' + public static string @SA1206MessageFormat => GetResourceString("SA1206MessageFormat")!; + /// Declaration keywords should follow order + public static string @SA1206Title => GetResourceString("SA1206Title")!; + /// Place keyword 'protected' before keyword 'internal' + public static string @SA1207CodeFix => GetResourceString("SA1207CodeFix")!; + /// The keyword '{0}' is positioned after the keyword '{1}' within the declaration of a {0} {1} C# element. + public static string @SA1207Description => GetResourceString("SA1207Description")!; + /// The keyword '{0}' should come before '{1}' + public static string @SA1207MessageFormat => GetResourceString("SA1207MessageFormat")!; + /// Protected should come before internal + public static string @SA1207Title => GetResourceString("SA1207Title")!; + /// A using directive which declares a member of the 'System' namespace appears after a using directive which declares a member of a different namespace, within a C# code file. + public static string @SA1208Description => GetResourceString("SA1208Description")!; + /// Using directive for '{0}' should appear before directive for '{1}' + public static string @SA1208MessageFormat => GetResourceString("SA1208MessageFormat")!; + /// System using directives should be placed before other using directives + public static string @SA1208Title => GetResourceString("SA1208Title")!; + /// A using-alias directive is positioned before a regular using directive. + public static string @SA1209Description => GetResourceString("SA1209Description")!; + /// Using alias directives should be placed after all using namespace directives + public static string @SA1209MessageFormat => GetResourceString("SA1209MessageFormat")!; + /// Using alias directives should be placed after other using directives + public static string @SA1209Title => GetResourceString("SA1209Title")!; + /// The using directives within a C# code file are not sorted alphabetically by namespace. + public static string @SA1210Description => GetResourceString("SA1210Description")!; + /// Using directives should be ordered alphabetically by the namespaces + public static string @SA1210MessageFormat => GetResourceString("SA1210MessageFormat")!; + /// Using directives should be ordered alphabetically by namespace + public static string @SA1210Title => GetResourceString("SA1210Title")!; + /// The using-alias directives within a C# code file are not sorted alphabetically by alias name. + public static string @SA1211Description => GetResourceString("SA1211Description")!; + /// Using alias directive for '{0}' should appear before using alias directive for '{1}' + public static string @SA1211MessageFormat => GetResourceString("SA1211MessageFormat")!; + /// Using alias directives should be ordered alphabetically by alias name + public static string @SA1211Title => GetResourceString("SA1211Title")!; + /// A get accessor appears after a set accessor within a property or indexer. + public static string @SA1212Description => GetResourceString("SA1212Description")!; + /// A get accessor appears after a set accessor within a property or indexer + public static string @SA1212MessageFormat => GetResourceString("SA1212MessageFormat")!; + /// Property accessors should follow order + public static string @SA1212Title => GetResourceString("SA1212Title")!; + /// Fix accessor order + public static string @SA1213CodeFix => GetResourceString("SA1213CodeFix")!; + /// An add accessor appears after a remove accessor within an event. + public static string @SA1213Description => GetResourceString("SA1213Description")!; + /// Event accessors should follow order + public static string @SA1213MessageFormat => GetResourceString("SA1213MessageFormat")!; + /// Event accessors should follow order + public static string @SA1213Title => GetResourceString("SA1213Title")!; + /// A readonly field is positioned beneath a non-readonly field. + public static string @SA1214Description => GetResourceString("SA1214Description")!; + /// Readonly fields should appear before non-readonly fields + public static string @SA1214MessageFormat => GetResourceString("SA1214MessageFormat")!; + /// Readonly fields should appear before non-readonly fields + public static string @SA1214Title => GetResourceString("SA1214Title")!; + /// A using static directive is positioned before a regular or after an alias using directive. + public static string @SA1216Description => GetResourceString("SA1216Description")!; + /// Using static directives should be placed at the correct location + public static string @SA1216MessageFormat => GetResourceString("SA1216MessageFormat")!; + /// Using static directives should be placed at the correct location + public static string @SA1216Title => GetResourceString("SA1216Title")!; + /// All using static directives should be ordered alphabetically. + public static string @SA1217Description => GetResourceString("SA1217Description")!; + /// The using static directive for '{0}' should appear after the using static directive for '{1}' + public static string @SA1217MessageFormat => GetResourceString("SA1217MessageFormat")!; + /// Using static directives should be ordered alphabetically + public static string @SA1217Title => GetResourceString("SA1217Title")!; + /// Reorder using statements + public static string @UsingCodeFix => GetResourceString("UsingCodeFix")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/ReadabilityResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/ReadabilityResources.Designer.cs new file mode 100644 index 000000000..abcfec0b9 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/ReadabilityResources.Designer.cs @@ -0,0 +1,323 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.ReadabilityRules +{ + internal static partial class ReadabilityResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(ReadabilityResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Fix indentation + public static string @IndentationCodeFix => GetResourceString("IndentationCodeFix")!; + /// Remove region + public static string @RemoveRegionCodeFix => GetResourceString("RemoveRegionCodeFix")!; + /// Replace 'base.' with 'this.' + public static string @SA1100CodeFix => GetResourceString("SA1100CodeFix")!; + /// A call to a member from an inherited class begins with 'base.', and the local class does not contain an override or implementation of the member. + public static string @SA1100Description => GetResourceString("SA1100Description")!; + /// Do not prefix calls with base unless local implementation exists + public static string @SA1100MessageFormat => GetResourceString("SA1100MessageFormat")!; + /// Do not prefix calls with base unless local implementation exists + public static string @SA1100Title => GetResourceString("SA1100Title")!; + /// Prefix reference with 'this.' + public static string @SA1101CodeFix => GetResourceString("SA1101CodeFix")!; + /// A call to an instance member of the local class or a base class is not prefixed with 'this.', within a C# code file. + public static string @SA1101Description => GetResourceString("SA1101Description")!; + /// Prefix local calls with this + public static string @SA1101MessageFormat => GetResourceString("SA1101MessageFormat")!; + /// Prefix local calls with this + public static string @SA1101Title => GetResourceString("SA1101Title")!; + /// Remove separating lines + public static string @SA1102CodeFix => GetResourceString("SA1102CodeFix")!; + /// A C# query clause does not begin on the same line as the previous clause, or on the next line. + public static string @SA1102Description => GetResourceString("SA1102Description")!; + /// Query clause should follow previous clause. + public static string @SA1102MessageFormat => GetResourceString("SA1102MessageFormat")!; + /// Query clause should follow previous clause + public static string @SA1102Title => GetResourceString("SA1102Title")!; + /// Place on multiple lines + public static string @SA1103CodeFixMultipleLines => GetResourceString("SA1103CodeFixMultipleLines")!; + /// Place on single line + public static string @SA1103CodeFixSingleLine => GetResourceString("SA1103CodeFixSingleLine")!; + /// The clauses within a C# query expression are not all placed on the same line, and each clause is not placed on its own line. + public static string @SA1103Description => GetResourceString("SA1103Description")!; + /// Query clauses should be on separate lines or all on one line + public static string @SA1103MessageFormat => GetResourceString("SA1103MessageFormat")!; + /// Query clauses should be on separate lines or all on one line + public static string @SA1103Title => GetResourceString("SA1103Title")!; + /// A clause within a C# query expression begins on the same line as the previous clause, when the previous clause spans across multiple lines. + public static string @SA1104Description => GetResourceString("SA1104Description")!; + /// Query clause should begin on new line when previous clause spans multiple lines + public static string @SA1104MessageFormat => GetResourceString("SA1104MessageFormat")!; + /// Insert new line + public static string @SA1104SA1105CodeFix => GetResourceString("SA1104SA1105CodeFix")!; + /// Query clause should begin on new line when previous clause spans multiple lines + public static string @SA1104Title => GetResourceString("SA1104Title")!; + /// A clause within a C# query expression spans across multiple lines, and does not begin on its own line. + public static string @SA1105Description => GetResourceString("SA1105Description")!; + /// Query clauses spanning multiple lines should begin on own line + public static string @SA1105MessageFormat => GetResourceString("SA1105MessageFormat")!; + /// Query clauses spanning multiple lines should begin on own line + public static string @SA1105Title => GetResourceString("SA1105Title")!; + /// Remove empty statement + public static string @SA1106CodeFix => GetResourceString("SA1106CodeFix")!; + /// The C# code contains an extra semicolon. + public static string @SA1106Description => GetResourceString("SA1106Description")!; + /// Code should not contain empty statements + public static string @SA1106MessageFormat => GetResourceString("SA1106MessageFormat")!; + /// Code should not contain empty statements + public static string @SA1106Title => GetResourceString("SA1106Title")!; + /// Enter new line + public static string @SA1107CodeFix => GetResourceString("SA1107CodeFix")!; + /// The C# code contains more than one statement on a single line. + public static string @SA1107Description => GetResourceString("SA1107Description")!; + /// Code should not contain multiple statements on one line + public static string @SA1107MessageFormat => GetResourceString("SA1107MessageFormat")!; + /// Code should not contain multiple statements on one line + public static string @SA1107Title => GetResourceString("SA1107Title")!; + /// A C# statement contains a comment between the declaration of the statement and the opening brace of the statement. + public static string @SA1108Description => GetResourceString("SA1108Description")!; + /// Block statements should not contain embedded comments + public static string @SA1108MessageFormat => GetResourceString("SA1108MessageFormat")!; + /// Block statements should not contain embedded comments + public static string @SA1108Title => GetResourceString("SA1108Title")!; + /// A C# statement contains a region tag between the declaration of the statement and the opening brace of the statement. + public static string @SA1109Description => GetResourceString("SA1109Description")!; + /// + public static string @SA1109MessageFormat => GetResourceString("SA1109MessageFormat")!; + /// Block statements should not contain embedded regions + public static string @SA1109Title => GetResourceString("SA1109Title")!; + /// The opening parenthesis or bracket is not placed on the same line as the method/indexer/attribute/array name. + public static string @SA1110Description => GetResourceString("SA1110Description")!; + /// Opening parenthesis or bracket should be on declaration line + public static string @SA1110MessageFormat => GetResourceString("SA1110MessageFormat")!; + /// Opening parenthesis or bracket should be on declaration line + public static string @SA1110Title => GetResourceString("SA1110Title")!; + /// The closing parenthesis or bracket in a call to or declaration of a C# method/indexer/attribute/array/constructor/delegate is not placed on the same line as the last parameter. + public static string @SA1111Description => GetResourceString("SA1111Description")!; + /// Closing parenthesis should be on line of last parameter + public static string @SA1111MessageFormat => GetResourceString("SA1111MessageFormat")!; + /// Closing parenthesis should be on line of last parameter + public static string @SA1111Title => GetResourceString("SA1111Title")!; + /// The closing parenthesis or bracket in a call to a C# method or indexer, or the declaration of a method or indexer, is not placed on the same line as the opening bracket when the element does not take any parameters. + public static string @SA1112Description => GetResourceString("SA1112Description")!; + /// Closing parenthesis should be on line of opening parenthesis + public static string @SA1112MessageFormat => GetResourceString("SA1112MessageFormat")!; + /// Closing parenthesis should be on line of opening parenthesis + public static string @SA1112Title => GetResourceString("SA1112Title")!; + /// A comma between two parameters in a call to a C# method or indexer, or in the declaration of a method or indexer, is not placed on the same line as the previous parameter. + public static string @SA1113Description => GetResourceString("SA1113Description")!; + /// Comma should be on the same line as previous parameter + public static string @SA1113MessageFormat => GetResourceString("SA1113MessageFormat")!; + /// Comma should be on the same line as previous parameter + public static string @SA1113Title => GetResourceString("SA1113Title")!; + /// The start of the parameter list for a method/constructor/indexer/array/operator call or declaration does not begin on the same line as the opening bracket, or on the line after the opening bracket. + public static string @SA1114Description => GetResourceString("SA1114Description")!; + /// Parameter list should follow declaration + public static string @SA1114MessageFormat => GetResourceString("SA1114MessageFormat")!; + /// Parameter list should follow declaration + public static string @SA1114Title => GetResourceString("SA1114Title")!; + /// A parameter within a C# method or indexer call or declaration does not begin on the same line as the previous parameter, or on the next line. + public static string @SA1115Description => GetResourceString("SA1115Description")!; + /// The parameter should begin on the line after the previous parameter + public static string @SA1115MessageFormat => GetResourceString("SA1115MessageFormat")!; + /// Parameter should follow comma + public static string @SA1115Title => GetResourceString("SA1115Title")!; + /// Move first argument to next line + public static string @SA1116CodeFix => GetResourceString("SA1116CodeFix")!; + /// The parameters to a C# method or indexer call or declaration span across multiple lines, but the first parameter does not start on the line after the opening bracket. + public static string @SA1116Description => GetResourceString("SA1116Description")!; + /// The parameters should begin on the line after the declaration, whenever the parameter span across multiple lines + public static string @SA1116MessageFormat => GetResourceString("SA1116MessageFormat")!; + /// Split parameters should start on line after declaration + public static string @SA1116Title => GetResourceString("SA1116Title")!; + /// The parameters to a C# method or indexer call or declaration are not all on the same line or each on a separate line. + public static string @SA1117Description => GetResourceString("SA1117Description")!; + /// The parameters should all be placed on the same line or each parameter should be placed on its own line + public static string @SA1117MessageFormat => GetResourceString("SA1117MessageFormat")!; + /// Parameters should be on same line or separate lines + public static string @SA1117Title => GetResourceString("SA1117Title")!; + /// A parameter to a C# method/indexer/attribute/array, other than the first parameter, spans across multiple lines. If the parameter is short, place the entire parameter on a single line. Otherwise, save the contents of the parameter in a temporary variable a ... + public static string @SA1118Description => GetResourceString("SA1118Description")!; + /// The parameter spans multiple lines + public static string @SA1118MessageFormat => GetResourceString("SA1118MessageFormat")!; + /// Parameter should not span multiple lines + public static string @SA1118Title => GetResourceString("SA1118Title")!; + /// Remove empty comment + public static string @SA1120CodeFix => GetResourceString("SA1120CodeFix")!; + /// The C# comment does not contain any comment text. + public static string @SA1120Description => GetResourceString("SA1120Description")!; + /// Comments should contain text + public static string @SA1120MessageFormat => GetResourceString("SA1120MessageFormat")!; + /// Comments should contain text + public static string @SA1120Title => GetResourceString("SA1120Title")!; + /// Replace with built-in type + public static string @SA1121CodeFix => GetResourceString("SA1121CodeFix")!; + /// The code uses one of the basic C# types, but does not use the built-in alias for the type. + public static string @SA1121Description => GetResourceString("SA1121Description")!; + /// Use built-in type alias + public static string @SA1121MessageFormat => GetResourceString("SA1121MessageFormat")!; + /// Use built-in type alias + public static string @SA1121Title => GetResourceString("SA1121Title")!; + /// Replace with string.Empty + public static string @SA1122CodeFix => GetResourceString("SA1122CodeFix")!; + /// The C# code includes an empty string, written as "". + public static string @SA1122Description => GetResourceString("SA1122Description")!; + /// Use string.Empty for empty strings + public static string @SA1122MessageFormat => GetResourceString("SA1122MessageFormat")!; + /// Use string.Empty for empty strings + public static string @SA1122Title => GetResourceString("SA1122Title")!; + /// The C# code contains a region within the body of a code element. + public static string @SA1123Description => GetResourceString("SA1123Description")!; + /// Region should not be located within a code element + public static string @SA1123MessageFormat => GetResourceString("SA1123MessageFormat")!; + /// Do not place regions within elements + public static string @SA1123Title => GetResourceString("SA1123Title")!; + /// The C# code contains a region. + public static string @SA1124Description => GetResourceString("SA1124Description")!; + /// Do not use regions + public static string @SA1124MessageFormat => GetResourceString("SA1124MessageFormat")!; + /// Do not use regions + public static string @SA1124Title => GetResourceString("SA1124Title")!; + /// The Nullable<T> type has been defined not using the C# shorthand. For example, Nullable<DateTime> has been used instead of the preferred DateTime? + public static string @SA1125Description => GetResourceString("SA1125Description")!; + /// Use shorthand for nullable types + public static string @SA1125MessageFormat => GetResourceString("SA1125MessageFormat")!; + /// Use shorthand for nullable types + public static string @SA1125Title => GetResourceString("SA1125Title")!; + /// A call to a member is not prefixed with the 'this.', 'base.', 'object.' or 'typename.' prefix to indicate the intended method call, within a C# code file. + public static string @SA1126Description => GetResourceString("SA1126Description")!; + /// + public static string @SA1126MessageFormat => GetResourceString("SA1126MessageFormat")!; + /// Prefix calls correctly + public static string @SA1126Title => GetResourceString("SA1126Title")!; + /// Place each type constraint on a new line + public static string @SA1127CodeFix => GetResourceString("SA1127CodeFix")!; + /// Each type constraint clause for a generic type parameter should be listed on a line of code by itself. + public static string @SA1127Description => GetResourceString("SA1127Description")!; + /// Generic type constraints should be on their own line + public static string @SA1127MessageFormat => GetResourceString("SA1127MessageFormat")!; + /// Generic type constraints should be on their own line + public static string @SA1127Title => GetResourceString("SA1127Title")!; + /// Place constructor initializer on own line + public static string @SA1128CodeFix => GetResourceString("SA1128CodeFix")!; + /// A constructor initializer, including the colon character, should be on its own line. + public static string @SA1128Description => GetResourceString("SA1128Description")!; + /// Put constructor initializers on their own line + public static string @SA1128MessageFormat => GetResourceString("SA1128MessageFormat")!; + /// Put constructor initializers on their own line + public static string @SA1128Title => GetResourceString("SA1128Title")!; + /// Replace with default(T) + public static string @SA1129CodeFix => GetResourceString("SA1129CodeFix")!; + /// When creating a new instance of a value type T, the syntax 'default(T)' is functionally equivalent to the syntax 'new T()'. To avoid confusion regarding the behavior of the resulting instance, the first form is preferred. + public static string @SA1129Description => GetResourceString("SA1129Description")!; + /// Do not use default value type constructor + public static string @SA1129MessageFormat => GetResourceString("SA1129MessageFormat")!; + /// Do not use default value type constructor + public static string @SA1129Title => GetResourceString("SA1129Title")!; + /// Replace with lambda. + public static string @SA1130CodeFix => GetResourceString("SA1130CodeFix")!; + /// Lambda expressions are more succinct and easier to read than anonymous methods, so they should are preferred whenever the two are functionally equivalent. + public static string @SA1130Description => GetResourceString("SA1130Description")!; + /// Use lambda syntax + public static string @SA1130MessageFormat => GetResourceString("SA1130MessageFormat")!; + /// Use lambda syntax + public static string @SA1130Title => GetResourceString("SA1130Title")!; + /// Swap operands + public static string @SA1131CodeFix => GetResourceString("SA1131CodeFix")!; + /// When a comparison is made between a variable and a literal, the variable should be placed on the left-hand-side to maximize readability. + public static string @SA1131Description => GetResourceString("SA1131Description")!; + /// Constant values should appear on the right-hand side of comparisons + public static string @SA1131MessageFormat => GetResourceString("SA1131MessageFormat")!; + /// Use readable conditions + public static string @SA1131Title => GetResourceString("SA1131Title")!; + /// Place each field on a new line + public static string @SA1132CodeFix => GetResourceString("SA1132CodeFix")!; + /// Each field should be declared on its own line, in order to clearly see each field of a type and allow for proper documentation of the behavior of each field. + public static string @SA1132Description => GetResourceString("SA1132Description")!; + /// Each field should be declared on its own line + public static string @SA1132MessageFormat => GetResourceString("SA1132MessageFormat")!; + /// Do not combine fields + public static string @SA1132Title => GetResourceString("SA1132Title")!; + /// Give each attribute its own square brackets + public static string @SA1133CodeFix => GetResourceString("SA1133CodeFix")!; + /// Each attribute usage should be placed in its own set of square brackets for maximum readability. + public static string @SA1133Description => GetResourceString("SA1133Description")!; + /// Each attribute should be placed in its own set of square brackets + public static string @SA1133MessageFormat => GetResourceString("SA1133MessageFormat")!; + /// Do not combine attributes + public static string @SA1133Title => GetResourceString("SA1133Title")!; + /// Place attribute on own line. + public static string @SA1134CodeFix => GetResourceString("SA1134CodeFix")!; + /// Each attribute should be placed on its own line of code. + public static string @SA1134Description => GetResourceString("SA1134Description")!; + /// Each attribute should be placed on its own line of code + public static string @SA1134MessageFormat => GetResourceString("SA1134MessageFormat")!; + /// Attributes should not share line + public static string @SA1134Title => GetResourceString("SA1134Title")!; + /// Qualify using directive + public static string @SA1135CodeFix => GetResourceString("SA1135CodeFix")!; + /// All using directives should be qualified. + public static string @SA1135Description => GetResourceString("SA1135Description")!; + /// Using directive for namespace '{0}' should be qualified + public static string @SA1135MessageFormatNamespace => GetResourceString("SA1135MessageFormatNamespace")!; + /// Using directive for type '{0}' should be qualified + public static string @SA1135MessageFormatType => GetResourceString("SA1135MessageFormatType")!; + /// Using directives should be qualified + public static string @SA1135Title => GetResourceString("SA1135Title")!; + /// Place enum values own their own lines + public static string @SA1136CodeFix => GetResourceString("SA1136CodeFix")!; + /// Enum values should be placed on their own lines for maximum readability. + public static string @SA1136Description => GetResourceString("SA1136Description")!; + /// Enum values should be on separate lines + public static string @SA1136MessageFormat => GetResourceString("SA1136MessageFormat")!; + /// Enum values should be on separate lines + public static string @SA1136Title => GetResourceString("SA1136Title")!; + /// Elements at the same level in the syntax tree should have the same indentation. + public static string @SA1137Description => GetResourceString("SA1137Description")!; + /// Elements should have the same indentation + public static string @SA1137MessageFormat => GetResourceString("SA1137MessageFormat")!; + /// Elements should have the same indentation + public static string @SA1137Title => GetResourceString("SA1137Title")!; + /// Use literal suffix notation instead of casting + public static string @SA1139CodeFix => GetResourceString("SA1139CodeFix")!; + /// Use literal suffix notation instead of casting, in order to improve readability, avoid bugs related to illegal casts and ensure that optimal IL is produced. + public static string @SA1139Description => GetResourceString("SA1139Description")!; + /// Use literal suffix notation instead of casting + public static string @SA1139MessageFormat => GetResourceString("SA1139MessageFormat")!; + /// Use literal suffix notation instead of casting + public static string @SA1139Title => GetResourceString("SA1139Title")!; + /// Replace with tuple syntax + public static string @SA1141CodeFix => GetResourceString("SA1141CodeFix")!; + /// Use tuple syntax instead of the underlying ValueTuple implementation type. + public static string @SA1141Description => GetResourceString("SA1141Description")!; + /// Use tuple syntax + public static string @SA1141MessageFormat => GetResourceString("SA1141MessageFormat")!; + /// Use tuple syntax + public static string @SA1141Title => GetResourceString("SA1141Title")!; + /// Use tuple field name + public static string @SA1142CodeFix => GetResourceString("SA1142CodeFix")!; + /// A field of a tuple was referenced by its metadata name when a field name is available. + public static string @SA1142Description => GetResourceString("SA1142Description")!; + /// Refer to tuple fields by name + public static string @SA1142MessageFormat => GetResourceString("SA1142MessageFormat")!; + /// Refer to tuple fields by name + public static string @SA1142Title => GetResourceString("SA1142Title")!; + /// Remove 'this.' prefix + public static string @SX1101CodeFix => GetResourceString("SX1101CodeFix")!; + /// A call to an instance member of the local class or a base class is prefixed with `this.`. + public static string @SX1101Description => GetResourceString("SX1101Description")!; + /// Do not prefix local calls with 'this.' + public static string @SX1101MessageFormat => GetResourceString("SX1101MessageFormat")!; + /// Do not prefix local calls with 'this.' + public static string @SX1101Title => GetResourceString("SX1101Title")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SettingsResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SettingsResources.Designer.cs new file mode 100644 index 000000000..978888fdb --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SettingsResources.Designer.cs @@ -0,0 +1,21 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.Settings +{ + internal static partial class SettingsResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(SettingsResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// Add StyleCop settings file to the project + public static string @SettingsFileCodeFix => GetResourceString("SettingsFileCodeFix")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpacingResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpacingResources.Designer.cs new file mode 100644 index 000000000..7d47c696a --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpacingResources.Designer.cs @@ -0,0 +1,249 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.SpacingRules +{ + internal static partial class SpacingResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(SpacingResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// The spacing around a C# keyword is incorrect. + public static string @SA1000Description => GetResourceString("SA1000Description")!; + /// The keyword '{0}' should{1} be followed by a space + public static string @SA1000MessageFormat => GetResourceString("SA1000MessageFormat")!; + /// Keywords should be spaced correctly + public static string @SA1000Title => GetResourceString("SA1000Title")!; + /// The spacing around a comma is incorrect, within a C# code file. + public static string @SA1001Description => GetResourceString("SA1001Description")!; + /// Commas should{0} be {1} by whitespace + public static string @SA1001MessageFormat => GetResourceString("SA1001MessageFormat")!; + /// Commas should be spaced correctly + public static string @SA1001Title => GetResourceString("SA1001Title")!; + /// The spacing around a semicolon is incorrect, within a C# code file. + public static string @SA1002Description => GetResourceString("SA1002Description")!; + /// Semicolons should{0} be {1} by a space + public static string @SA1002MessageFormat => GetResourceString("SA1002MessageFormat")!; + /// Semicolons should be spaced correctly + public static string @SA1002Title => GetResourceString("SA1002Title")!; + /// Fix spacing + public static string @SA1003CodeFix => GetResourceString("SA1003CodeFix")!; + /// The spacing around an operator symbol is incorrect, within a C# code file. + public static string @SA1003Description => GetResourceString("SA1003Description")!; + /// Operator '{0}' should be followed by whitespace. + public static string @SA1003MessageFormatFollowedByWhitespace => GetResourceString("SA1003MessageFormatFollowedByWhitespace")!; + /// Operator '{0}' should not appear at the end of a line. + public static string @SA1003MessageFormatNotAtEndOfLine => GetResourceString("SA1003MessageFormatNotAtEndOfLine")!; + /// Operator '{0}' should not be followed by a comment. + public static string @SA1003MessageFormatNotFollowedByComment => GetResourceString("SA1003MessageFormatNotFollowedByComment")!; + /// Operator '{0}' should not be followed by whitespace. + public static string @SA1003MessageFormatNotFollowedByWhitespace => GetResourceString("SA1003MessageFormatNotFollowedByWhitespace")!; + /// Operator '{0}' should not be preceded by whitespace. + public static string @SA1003MessageFormatNotPrecededByWhitespace => GetResourceString("SA1003MessageFormatNotPrecededByWhitespace")!; + /// Operator '{0}' should be preceded by whitespace. + public static string @SA1003MessageFormatPrecededByWhitespace => GetResourceString("SA1003MessageFormatPrecededByWhitespace")!; + /// Symbols should be spaced correctly + public static string @SA1003Title => GetResourceString("SA1003Title")!; + /// Fix spacing + public static string @SA1004CodeFix => GetResourceString("SA1004CodeFix")!; + /// A line within a documentation header above a C# element does not begin with a single space. + public static string @SA1004Description => GetResourceString("SA1004Description")!; + /// Documentation line should begin with a space + public static string @SA1004MessageFormat => GetResourceString("SA1004MessageFormat")!; + /// Documentation lines should begin with single space + public static string @SA1004Title => GetResourceString("SA1004Title")!; + /// Fix spacing + public static string @SA1005CodeFix => GetResourceString("SA1005CodeFix")!; + /// A single-line comment within a C# code file does not begin with a single space. + public static string @SA1005Description => GetResourceString("SA1005Description")!; + /// Single line comment should begin with a space + public static string @SA1005MessageFormat => GetResourceString("SA1005MessageFormat")!; + /// Single line comments should begin with single space + public static string @SA1005Title => GetResourceString("SA1005Title")!; + /// A C# preprocessor-type keyword is preceded by space. + public static string @SA1006Description => GetResourceString("SA1006Description")!; + /// Preprocessor keyword '{0}' should not be preceded by a space + public static string @SA1006MessageFormat => GetResourceString("SA1006MessageFormat")!; + /// Preprocessor keywords should not be preceded by space + public static string @SA1006Title => GetResourceString("SA1006Title")!; + /// The operator keyword within a C# operator overload method is not followed by any whitespace. + public static string @SA1007Description => GetResourceString("SA1007Description")!; + /// Operator keyword should be followed by a space + public static string @SA1007MessageFormat => GetResourceString("SA1007MessageFormat")!; + /// Operator keyword should be followed by space + public static string @SA1007Title => GetResourceString("SA1007Title")!; + /// Fix spacing + public static string @SA1008CodeFix => GetResourceString("SA1008CodeFix")!; + /// An opening parenthesis within a C# statement is not spaced correctly. + public static string @SA1008Description => GetResourceString("SA1008Description")!; + /// Opening parenthesis should not be followed by a space. + public static string @SA1008MessageNotFollowed => GetResourceString("SA1008MessageNotFollowed")!; + /// Opening parenthesis should not be preceded by a space. + public static string @SA1008MessageNotPreceded => GetResourceString("SA1008MessageNotPreceded")!; + /// Opening parenthesis should be preceded by a space. + public static string @SA1008MessagePreceded => GetResourceString("SA1008MessagePreceded")!; + /// Opening parenthesis should be spaced correctly + public static string @SA1008Title => GetResourceString("SA1008Title")!; + /// A closing parenthesis within a C# statement is not spaced correctly. + public static string @SA1009Description => GetResourceString("SA1009Description")!; + /// Closing parenthesis should be followed by a space + public static string @SA1009MessageFollowed => GetResourceString("SA1009MessageFollowed")!; + /// Closing parenthesis should not be followed by a space + public static string @SA1009MessageNotFollowed => GetResourceString("SA1009MessageNotFollowed")!; + /// Closing parenthesis should not be preceded by a space + public static string @SA1009MessageNotPreceded => GetResourceString("SA1009MessageNotPreceded")!; + /// Closing parenthesis should be spaced correctly + public static string @SA1009Title => GetResourceString("SA1009Title")!; + /// An opening square bracket within a C# statement is not spaced correctly. + public static string @SA1010Description => GetResourceString("SA1010Description")!; + /// Opening square brackets should not be followed by a space + public static string @SA1010MessageNotFollowed => GetResourceString("SA1010MessageNotFollowed")!; + /// Opening square brackets should not be preceded by a space + public static string @SA1010MessageNotPreceded => GetResourceString("SA1010MessageNotPreceded")!; + /// Opening square brackets should be spaced correctly + public static string @SA1010Title => GetResourceString("SA1010Title")!; + /// A closing square bracket within a C# statement is not spaced correctly. + public static string @SA1011Description => GetResourceString("SA1011Description")!; + /// Closing square bracket should{0} be {1} by a space + public static string @SA1011MessageFormat => GetResourceString("SA1011MessageFormat")!; + /// Closing square brackets should be spaced correctly + public static string @SA1011Title => GetResourceString("SA1011Title")!; + /// An opening brace within a C# element is not spaced correctly. + public static string @SA1012Description => GetResourceString("SA1012Description")!; + /// Opening brace should{0} be {1} by a space + public static string @SA1012MessageFormat => GetResourceString("SA1012MessageFormat")!; + /// Opening braces should be spaced correctly + public static string @SA1012Title => GetResourceString("SA1012Title")!; + /// A closing brace within a C# element is not spaced correctly. + public static string @SA1013Description => GetResourceString("SA1013Description")!; + /// Closing brace should{0} be {1} by a space + public static string @SA1013MessageFormat => GetResourceString("SA1013MessageFormat")!; + /// Closing braces should be spaced correctly + public static string @SA1013Title => GetResourceString("SA1013Title")!; + /// An opening generic bracket within a C# element is not spaced correctly. + public static string @SA1014Description => GetResourceString("SA1014Description")!; + /// Opening generic brackets should not be {0} by a space + public static string @SA1014MessageFormat => GetResourceString("SA1014MessageFormat")!; + /// Opening generic brackets should be spaced correctly + public static string @SA1014Title => GetResourceString("SA1014Title")!; + /// A closing generic bracket within a C# element is not spaced correctly. + public static string @SA1015Description => GetResourceString("SA1015Description")!; + /// Closing generic bracket should be followed by a space + public static string @SA1015MessageFollowed => GetResourceString("SA1015MessageFollowed")!; + /// Closing generic bracket should not be followed by a space + public static string @SA1015MessageNotFollowed => GetResourceString("SA1015MessageNotFollowed")!; + /// Closing generic bracket should not be preceded by a space + public static string @SA1015MessageNotPreceded => GetResourceString("SA1015MessageNotPreceded")!; + /// Closing generic brackets should be spaced correctly + public static string @SA1015Title => GetResourceString("SA1015Title")!; + /// An opening attribute bracket within a C# element is not spaced correctly. + public static string @SA1016Description => GetResourceString("SA1016Description")!; + /// Opening attribute brackets should not be followed by a space + public static string @SA1016MessageFormat => GetResourceString("SA1016MessageFormat")!; + /// Opening attribute brackets should be spaced correctly + public static string @SA1016Title => GetResourceString("SA1016Title")!; + /// A closing attribute bracket within a C# element is not spaced correctly. + public static string @SA1017Description => GetResourceString("SA1017Description")!; + /// Closing attribute brackets should not be preceded by a space + public static string @SA1017MessageFormat => GetResourceString("SA1017MessageFormat")!; + /// Closing attribute brackets should be spaced correctly + public static string @SA1017Title => GetResourceString("SA1017Title")!; + /// Fix spacing + public static string @SA1018CodeFix => GetResourceString("SA1018CodeFix")!; + /// A nullable type symbol within a C# element is not spaced correctly. + public static string @SA1018Description => GetResourceString("SA1018Description")!; + /// Nullable type symbol should not be preceded by a space + public static string @SA1018MessageFormat => GetResourceString("SA1018MessageFormat")!; + /// Nullable type symbols should be spaced correctly + public static string @SA1018Title => GetResourceString("SA1018Title")!; + /// The spacing around a member access symbol is incorrect, within a C# code file. + public static string @SA1019Description => GetResourceString("SA1019Description")!; + /// Member access symbol '{0}' should not be followed by a space + public static string @SA1019MessageNotFollowed => GetResourceString("SA1019MessageNotFollowed")!; + /// Member access symbol '{0}' should not be preceded by a space + public static string @SA1019MessageNotPreceded => GetResourceString("SA1019MessageNotPreceded")!; + /// Member access symbols should be spaced correctly + public static string @SA1019Title => GetResourceString("SA1019Title")!; + /// An increment or decrement symbol within a C# element is not spaced correctly. + public static string @SA1020Description => GetResourceString("SA1020Description")!; + /// {0} symbol '{1}' should not be {2} by a space + public static string @SA1020MessageFormat => GetResourceString("SA1020MessageFormat")!; + /// Increment decrement symbols should be spaced correctly + public static string @SA1020Title => GetResourceString("SA1020Title")!; + /// A negative sign within a C# element is not spaced correctly. + public static string @SA1021Description => GetResourceString("SA1021Description")!; + /// Negative sign should{0} be {1} by a space + public static string @SA1021MessageFormat => GetResourceString("SA1021MessageFormat")!; + /// Negative signs should be spaced correctly + public static string @SA1021Title => GetResourceString("SA1021Title")!; + /// A positive sign within a C# element is not spaced correctly. + public static string @SA1022Description => GetResourceString("SA1022Description")!; + /// Positive sign should{0} be {1} by a space + public static string @SA1022MessageFormat => GetResourceString("SA1022MessageFormat")!; + /// Positive signs should be spaced correctly + public static string @SA1022Title => GetResourceString("SA1022Title")!; + /// A dereference symbol or an access-of symbol within a C# element is not spaced correctly. + public static string @SA1023Description => GetResourceString("SA1023Description")!; + /// Dereference symbol '*' should be followed by a space + public static string @SA1023MessageFollowed => GetResourceString("SA1023MessageFollowed")!; + /// Dereference symbol '*' should not appear at the beginning of a line + public static string @SA1023MessageNotAtBeginningOfLine => GetResourceString("SA1023MessageNotAtBeginningOfLine")!; + /// Dereference symbol '*' should not appear at the end of a line + public static string @SA1023MessageNotAtEndOfLine => GetResourceString("SA1023MessageNotAtEndOfLine")!; + /// Dereference symbol '*' should not be followed by a space + public static string @SA1023MessageNotFollowed => GetResourceString("SA1023MessageNotFollowed")!; + /// Dereference symbol '*' should not be preceded by a space + public static string @SA1023MessageNotPreceded => GetResourceString("SA1023MessageNotPreceded")!; + /// Dereference and access of symbols should be spaced correctly + public static string @SA1023Title => GetResourceString("SA1023Title")!; + /// A colon within a C# element is not spaced correctly. + public static string @SA1024Description => GetResourceString("SA1024Description")!; + /// Colon should be followed by a space + public static string @SA1024MessageFollowed => GetResourceString("SA1024MessageFollowed")!; + /// Colon should not be preceded by a space + public static string @SA1024MessageNotPreceded => GetResourceString("SA1024MessageNotPreceded")!; + /// Colon should be preceded by a space + public static string @SA1024MessagePreceded => GetResourceString("SA1024MessagePreceded")!; + /// Colons Should Be Spaced Correctly + public static string @SA1024Title => GetResourceString("SA1024Title")!; + /// Fix spacing + public static string @SA1025CodeFix => GetResourceString("SA1025CodeFix")!; + /// The code contains multiple whitespace characters in a row. + public static string @SA1025Description => GetResourceString("SA1025Description")!; + /// Code should not contain multiple whitespace characters in a row + public static string @SA1025MessageFormat => GetResourceString("SA1025MessageFormat")!; + /// Code should not contain multiple whitespace in a row + public static string @SA1025Title => GetResourceString("SA1025Title")!; + /// An implicitly typed array allocation within a C# code file is not spaced correctly. + public static string @SA1026Description => GetResourceString("SA1026Description")!; + /// The keyword '{0}' should not be followed by a space or a blank line + public static string @SA1026MessageFormat => GetResourceString("SA1026MessageFormat")!; + /// Code should not contain space after new or stackalloc keyword in implicitly typed array allocation + public static string @SA1026Title => GetResourceString("SA1026Title")!; + /// Fix tabs + public static string @SA1027CodeFix => GetResourceString("SA1027CodeFix")!; + /// The code contains a tab or space character which is not consistent with the current project settings. + public static string @SA1027Description => GetResourceString("SA1027Description")!; + /// Tabs and spaces should be used correctly + public static string @SA1027MessageFormat => GetResourceString("SA1027MessageFormat")!; + /// Use tabs correctly + public static string @SA1027Title => GetResourceString("SA1027Title")!; + /// Remove trailing whitespace + public static string @SA1028CodeFix => GetResourceString("SA1028CodeFix")!; + /// There should not be any whitespace at the end of a line of code. + public static string @SA1028Description => GetResourceString("SA1028Description")!; + /// Code should not contain trailing whitespace + public static string @SA1028MessageFormat => GetResourceString("SA1028MessageFormat")!; + /// Code should not contain trailing whitespace + public static string @SA1028Title => GetResourceString("SA1028Title")!; + /// Fix spacing + public static string @TokenSpacingCodeFix => GetResourceString("TokenSpacingCodeFix")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpecialResources.Designer.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpecialResources.Designer.cs new file mode 100644 index 000000000..35f2ba7a9 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Lightup/.generated/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp/Microsoft.CodeAnalysis.ResxSourceGenerator.CSharp.CSharpResxGenerator/SpecialResources.Designer.cs @@ -0,0 +1,33 @@ +// + +#nullable enable +using System.Reflection; + + +namespace StyleCop.Analyzers.SpecialRules +{ + internal static partial class SpecialResources + { + private static global::System.Resources.ResourceManager? s_resourceManager; + public static global::System.Resources.ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new global::System.Resources.ResourceManager(typeof(SpecialResources))); + public static global::System.Globalization.CultureInfo? Culture { get; set; } + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + [return: global::System.Diagnostics.CodeAnalysis.NotNullIfNotNull("defaultValue")] + internal static string? GetResourceString(string resourceKey, string? defaultValue = null) => ResourceManager.GetString(resourceKey, Culture) ?? defaultValue; + /// XML comment analysis can only be performed when the project is configured to parse documentation comments. To enable this functionality, update the project to produce an XML documentation file as part of the build. + public static string @SA0001Description => GetResourceString("SA0001Description")!; + /// XML comment analysis is disabled due to project configuration + public static string @SA0001MessageFormat => GetResourceString("SA0001MessageFormat")!; + /// XML comment analysis disabled + public static string @SA0001Title => GetResourceString("SA0001Title")!; + /// Various errors in the stylecop.json file can prevent the file from being loaded by the analyzers. In this case, the default settings are used instead. + /// + /// {0} + public static string @SA0002Description => GetResourceString("SA0002Description")!; + /// The stylecop.json settings file could not be loaded + public static string @SA0002MessageFormat => GetResourceString("SA0002MessageFormat")!; + /// Invalid settings file + public static string @SA0002Title => GetResourceString("SA0002Title")!; + + } +} diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/StyleCop.Analyzers.csproj b/StyleCop.Analyzers/StyleCop.Analyzers/StyleCop.Analyzers.csproj index 22fda7523..1b7e93789 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/StyleCop.Analyzers.csproj +++ b/StyleCop.Analyzers/StyleCop.Analyzers/StyleCop.Analyzers.csproj @@ -24,7 +24,7 @@ - true + true $(MSBuildProjectDirectory)\Lightup\.generated From b00056d0f4f290823af65c3cbf14d019f8e3b991 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 28 Sep 2023 09:57:45 -0500 Subject: [PATCH 2/2] Fix nullability warnings in source generators --- .../OperationLightupGenerator.cs | 22 +++++++++---------- .../SyntaxLightupGenerator.cs | 15 ++++++++----- .../XElementExtensions.cs | 14 ++++++++++++ 3 files changed, 34 insertions(+), 17 deletions(-) create mode 100644 StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XElementExtensions.cs diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs index ee5af5f55..ef0b54ee4 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/OperationLightupGenerator.cs @@ -921,7 +921,7 @@ public DocumentData(XDocument document) continue; } - if (!operationKinds.TryGetValue(node.Attribute("Name").Value, out var kinds)) + if (!operationKinds.TryGetValue(node.RequiredAttribute("Name").Value, out var kinds)) { kinds = ImmutableArray<(string name, int value, string? extraDescription)>.Empty; } @@ -937,7 +937,7 @@ public DocumentData(XDocument document) continue; } - if (!operationKinds.TryGetValue(node.Attribute("Name").Value, out var kinds)) + if (!operationKinds.TryGetValue(node.RequiredAttribute("Name").Value, out var kinds)) { kinds = ImmutableArray<(string name, int value, string? extraDescription)>.Empty; } @@ -987,11 +987,11 @@ public DocumentData(XDocument document) continue; } - int parsedValue = ParsePrefixHexValue(entry.Attribute("Value").Value); - nodeBuilder.Add((entry.Attribute("Name").Value, parsedValue, entry.Attribute("ExtraDescription")?.Value)); + int parsedValue = ParsePrefixHexValue(entry.RequiredAttribute("Value").Value); + nodeBuilder.Add((entry.RequiredAttribute("Name").Value, parsedValue, entry.Attribute("ExtraDescription")?.Value)); } - builder.Add(node.Attribute("Name").Value, nodeBuilder.ToImmutable()); + builder.Add(node.RequiredAttribute("Name").Value, nodeBuilder.ToImmutable()); continue; } } @@ -1008,7 +1008,7 @@ public DocumentData(XDocument document) operationKind++; } - var nodeName = node.Attribute("Name").Value; + var nodeName = node.RequiredAttribute("Name").Value; var kindName = nodeName.Substring("I".Length, nodeName.Length - "I".Length - "Operation".Length); builder.Add(nodeName, ImmutableArray.Create((kindName, operationKind, (string?)null))); } @@ -1021,12 +1021,12 @@ private static ImmutableHashSet GetSkippedOperationKinds(XDocument document var builder = ImmutableHashSet.CreateBuilder(); foreach (var skippedKind in document.XPathSelectElements("/Tree/UnusedOperationKinds/Entry")) { - builder.Add(ParsePrefixHexValue(skippedKind.Attribute("Value").Value)); + builder.Add(ParsePrefixHexValue(skippedKind.RequiredAttribute("Value").Value)); } foreach (var explicitKind in document.XPathSelectElements("/Tree/*/OperationKind/Entry")) { - builder.Add(ParsePrefixHexValue(explicitKind.Attribute("Value").Value)); + builder.Add(ParsePrefixHexValue(explicitKind.RequiredAttribute("Value").Value)); } return builder.ToImmutable(); @@ -1052,7 +1052,7 @@ public InterfaceData(DocumentData documentData, XElement node, ImmutableArray<(s this.documentData = documentData; this.OperationKinds = operationKinds; - this.InterfaceName = node.Attribute("Name").Value; + this.InterfaceName = node.RequiredAttribute("Name").Value; if (node.Attribute("Namespace") is { } namespaceNode) { @@ -1127,9 +1127,9 @@ private sealed class PropertyData { public PropertyData(XElement node) { - this.Name = node.Attribute("Name").Value; + this.Name = node.RequiredAttribute("Name").Value; this.AccessorName = this.Name + "Accessor"; - this.Type = node.Attribute("Type").Value; + this.Type = node.RequiredAttribute("Type").Value; this.IsNew = node.Attribute("New")?.Value == "true"; this.IsPublicProperty = node.Attribute("Internal")?.Value != "true"; diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs index 7c656a034..2f7987210 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/SyntaxLightupGenerator.cs @@ -1254,9 +1254,12 @@ private sealed class SyntaxData public SyntaxData(CompilationData compilationData, XDocument document) { var nodesBuilder = ImmutableArray.CreateBuilder(); - foreach (var element in document.XPathSelectElement("/Tree[@Root='SyntaxNode']").XPathSelectElements("PredefinedNode|AbstractNode|Node")) + if (document.XPathSelectElement("/Tree[@Root='SyntaxNode']") is { } tree) { - nodesBuilder.Add(new NodeData(compilationData, element)); + foreach (var element in tree.XPathSelectElements("PredefinedNode|AbstractNode|Node")) + { + nodesBuilder.Add(new NodeData(compilationData, element)); + } } this.Nodes = nodesBuilder.ToImmutable(); @@ -1303,7 +1306,7 @@ public NodeData(CompilationData compilationData, XElement element) _ => throw new NotSupportedException($"Unknown element name '{element.Name}'"), }; - this.Name = element.Attribute("Name").Value; + this.Name = element.RequiredAttribute("Name").Value; this.ExistingType = compilationData.ExistingTypes.GetValueOrDefault($"Microsoft.CodeAnalysis.CSharp.Syntax.{this.Name}") ?? compilationData.ExistingTypes.GetValueOrDefault($"Microsoft.CodeAnalysis.CSharp.{this.Name}") @@ -1317,7 +1320,7 @@ public NodeData(CompilationData compilationData, XElement element) this.WrapperName = this.Name + "Wrapper"; } - this.BaseName = element.Attribute("Base").Value; + this.BaseName = element.RequiredAttribute("Base").Value; this.Fields = element.XPathSelectElements("descendant::Field").Select(field => new FieldData(this, field)).ToImmutableArray(); } @@ -1347,9 +1350,9 @@ public FieldData(NodeData nodeData, XElement element) { this.nodeData = nodeData; - this.Name = element.Attribute("Name").Value; + this.Name = element.RequiredAttribute("Name").Value; - var type = element.Attribute("Type").Value; + var type = element.RequiredAttribute("Type").Value; this.Type = type switch { "SyntaxList" => nameof(SyntaxTokenList), diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XElementExtensions.cs b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XElementExtensions.cs new file mode 100644 index 000000000..f8fd96d90 --- /dev/null +++ b/StyleCop.Analyzers/StyleCop.Analyzers.CodeGeneration/XElementExtensions.cs @@ -0,0 +1,14 @@ +// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. + +namespace StyleCop.Analyzers.CodeGeneration +{ + using System; + using System.Xml.Linq; + + internal static class XElementExtensions + { + public static XAttribute RequiredAttribute(this XElement element, XName name) + => element.Attribute(name) ?? throw new InvalidOperationException($"Expected attribute '{name}'"); + } +}