Skip to content

Commit d6344b6

Browse files
committed
Merge pull request #2084 from vweijsters/fix-1602
Added indexes for the documentation.
2 parents 3cdcb61 + d047447 commit d6344b6

12 files changed

Lines changed: 280 additions & 7 deletions

DOCUMENTATION.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
StyleCop.Analyzers provides warnings that indicate style and consistency rule violations in C# code. The warnings are organized into rule areas such as documentation, layout, naming, ordering, readability, spacing, and so forth. Each warning signifies a violation of a style or consistency rule. This section provides an explanation of each of the default StyleCop.Analyzers rules.
2+
3+
### Rule areas
4+
**[Special Rules (SA0000-)](documentation/SpecialRules.md)**
5+
6+
Rules which provide special functionality like workarounds, configuration errors, etc.
7+
8+
**[Spacing Rules (SA1000-)](documentation/SpacingRules.md)**
9+
10+
Rules which enforce spacing requirements around keywords and symbols in the code.
11+
12+
**[Readability Rules (SA1100-)](documentation/ReadabilityRules.md)**
13+
14+
Rules which ensure that the code is well-formatted and readable.
15+
16+
**[Ordering Rules (SA1200-)](documentation/OrderingRules.md)**
17+
18+
Rules which enforce a standard ordering scheme for code contents.
19+
20+
**[Naming Rules (SA1300-)](documentation/NamingRules.md)**
21+
22+
Rules which enforce naming requirements for members, types, and variables.
23+
24+
**[Maintainability Rules (SA1400-)](documentation/MaintainabilityRules.md)**
25+
26+
Rules which improve code maintainability.
27+
28+
**[Layout Rules (SA1500-)](documentation/LayoutRules.md)**
29+
30+
Rules which enforce code layout and line spacing.
31+
32+
**[Documentation Rules (SA1600-)](documentation/DocumentationRules.md)**
33+
34+
Rules which verify the content and formatting of code documentation.
35+
36+
### Additional documentation
37+
**[Configuration](documentation/Configuration.md)**
38+
39+
Describes the configuration options for StyleCop.Analyzers
40+
41+
**[How to enable the configuration](documentation/EnableConfiguration.md)**
42+
43+
Describes how to enable the **stylecop.json** file for usage.
44+
45+
**[Known changes](documentation/KnownChanges.md)**
46+
47+
Describes the known differences between StyleCop Analyzers and StyleCop Classic.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
### Documentation Rules (SA1600-)
2+
Rules which verify the content and formatting of code documentation.
3+
4+
Identifier | Name | Description
5+
-----------|------|------------
6+
[SA1600](SA1600.md) | ElementsMustBeDocumented | A C# code element is missing a documentation header.
7+
[SA1601](SA1601.md) | PartialElementsMustBeDocumented | A C# partial element is missing a documentation header.
8+
[SA1602](SA1602.md) | EnumerationItemsMustBeDocumented | An item within a C# enumeration is missing an Xml documentation header.
9+
[SA1603](SA1603.md) | DocumentationMustContainValidXml | The Xml within a C# element's document header is badly formed.
10+
[SA1604](SA1604.md) | ElementDocumentationMustHaveSummary | The Xml header documentation for a C# element is missing a `<summary>` tag.
11+
[SA1605](SA1605.md) | PartialElementDocumentationMustHaveSummary | The `<summary>` or `<content>` tag within the documentation header for a C# code element is missing or empty.
12+
[SA1606](SA1606.md) | ElementDocumentationMustHaveSummaryText | The `<summary>` tag within the documentation header for a C# code element is empty.
13+
[SA1607](SA1607.md) | PartialElementDocumentationMustHaveSummaryText | The `<summary>` or `<content>` tag within the documentation header for a C# code element is empty.
14+
[SA1608](SA1608.md) | ElementDocumentationMustNotHaveDefaultSummary | The `<summary>` tag within an element's Xml header documentation contains the default text generated by Visual Studio during the creation of the element.
15+
[SA1609](SA1609.md) | PropertyDocumentationMustHaveValue | The Xml header documentation for a C# property does not contain a `<value>` tag.
16+
[SA1610](SA1610.md) | PropertyDocumentationMustHaveValueText | The Xml header documentation for a C# property contains an empty `<value>` tag.
17+
[SA1611](SA1611.md) | ElementParametersMustBeDocumented | A C# method, constructor, delegate or indexer element is missing documentation for one or more of its parameters.
18+
[SA1612](SA1612.md) | ElementParameterDocumentationMustMatchElementParameters | The documentation describing the parameters to a C# method, constructor, delegate or indexer element does not match the actual parameters on the element.
19+
[SA1613](SA1613.md) | ElementParameterDocumentationMustDeclareParameterName | A `<param>` tag within a C# element's documentation header is missing a name attribute containing the name of the parameter.
20+
[SA1614](SA1614.md) | ElementParameterDocumentationMustHaveText | A `<param>` tag within a C# element's documentation header is empty.
21+
[SA1615](SA1615.md) | ElementReturnValueMustBeDocumented | A C# element is missing documentation for its return value.
22+
[SA1616](SA1616.md) | ElementReturnValueDocumentationMustHaveText | The `<returns>` tag within a C# element's documentation header is empty.
23+
[SA1617](SA1617.md) | VoidReturnValueMustNotBeDocumented | A C# code element does not contain a return value, or returns void, but the documentation header for the element contains a `<returns>` tag.
24+
[SA1618](SA1618.md) | GenericTypeParametersMustBeDocumented | A generic C# element is missing documentation for one or more of its generic type parameters.
25+
[SA1619](SA1619.md) | GenericTypeParametersMustBeDocumentedPartialClass | 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.
26+
[SA1620](SA1620.md) | GenericTypeParameterDocumentationMustMatchTypeParameters | The `<typeparam>` tags within the Xml header documentation for a generic C# element do not match the generic type parameters on the element.
27+
[SA1621](SA1621.md) | GenericTypeParameterDocumentationMustDeclareParameterName | A `<typeparam>` tag within the Xml header documentation for a generic C# element is missing a name attribute, or contains an empty name attribute.
28+
[SA1622](SA1622.md) | GenericTypeParameterDocumentationMustHaveText | A `<typeparam>` tag within the Xml header documentation for a generic C# element is empty.
29+
[SA1623](SA1623.md) | PropertySummaryDocumentationMustMatchAccessors | The documentation text within a C# property's `<summary>` tag does not match the accessors within the property.
30+
[SA1624](SA1624.md) | PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess | 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.
31+
[SA1625](SA1625.md) | ElementDocumentationMustNotBeCopiedAndPasted | The Xml documentation for a C# element contains two or more identical entries, indicating that the documentation has been copied and pasted.
32+
[SA1626](SA1626.md) | SingleLineCommentsMustNotUseDocumentationStyleSlashes | The C# code contains a single-line comment which begins with three forward slashes in a row.
33+
[SA1627](SA1627.md) | DocumentationTextMustNotBeEmpty | The Xml header documentation for a C# code element contains an empty tag.
34+
[SA1628](SA1628.md) | DocumentationTextMustBeginWithACapitalLetter | A section of the Xml header documentation for a C# element does not begin with a capital letter.
35+
[SA1629](SA1629.md) | DocumentationTextMustEndWithAPeriod | A section of the Xml header documentation for a C# element does not end with a period (also known as a full stop).
36+
[SA1630](SA1630.md) | DocumentationTextMustContainWhitespace | A section of the Xml header documentation for a C# element does not contain any whitespace between words.
37+
[SA1631](SA1631.md) | DocumentationMustMeetCharacterPercentage | A section of the Xml header documentation for a C# element does not contain enough alphabetic characters.
38+
[SA1632](SA1632.md) | DocumentationTextMustMeetMinimumCharacterLength | From StyleCop 4.5 this rule is disabled by default.
39+
[SA1633](SA1633.md) | FileMustHaveHeader | A C# code file is missing a standard file header.
40+
[SA1634](SA1634.md) | FileHeaderMustShowCopyright | The file header at the top of a C# code file is missing a copyright tag.
41+
[SA1635](SA1635.md) | FileHeaderMustHaveCopyrightText | The file header at the top of a C# code file is missing copyright text.
42+
[SA1636](SA1636.md) | FileHeaderCopyrightTextMustMatch | The file header at the top of a C# code file does not contain the appropriate copyright text.
43+
[SA1637](SA1637.md) | FileHeaderMustContainFileName | The file header at the top of a C# code file is missing the file name.
44+
[SA1638](SA1638.md) | FileHeaderFileNameDocumentationMustMatchFileName | The file tag within the file header at the top of a C# code file does not contain the name of the file.
45+
[SA1639](SA1639.md) | FileHeaderMustHaveSummary | The file header at the top of a C# code file does not contain a filled-in summary tag.
46+
[SA1640](SA1640.md) | FileHeaderMustHaveValidCompanyText | The file header at the top of a C# code file does not contain company name text.
47+
[SA1641](SA1641.md) | FileHeaderCompanyNameTextMustMatch | The file header at the top of a C# code file does not contain the appropriate company name text.
48+
[SA1642](SA1642.md) | ConstructorSummaryDocumentationMustBeginWithStandardText | The XML documentation header for a C# constructor does not contain the appropriate summary text.
49+
[SA1643](SA1643.md) | DestructorSummaryDocumentationMustBeginWithStandardText | The Xml documentation header for a C# finalizer does not contain the appropriate summary text.
50+
[SA1644](SA1644.md) | DocumentationHeadersMustNotContainBlankLines | A section within the Xml documentation header for a C# element contains blank lines.
51+
[SA1645](SA1645.md) | IncludedDocumentationFileDoesNotExist | An included Xml documentation file does not exist.
52+
[SA1646](SA1646.md) | IncludedDocumentationXPathDoesNotExist | An included Xml documentation link contains an invalid path.
53+
[SA1647](SA1647.md) | IncludeNodeDoesNotContainValidFileAndPath | An include tag within an Xml documentation header does not contain valid file and path attribute.
54+
[SA1648](SA1648.md) | InheritDocMustBeUsedWithInheritingClass | `<inheritdoc>` has been used on an element that doesn't inherit from a base class or implement an interface.
55+
[SA1649](SA1649.md) | FileNameMustMatchTypeName | The file name of a C# code file does not match the first type declared in the file.
56+
[SA1650](SA1650.md) | ElementDocumentationMustBeSpelledCorrectly | The element documentation for the element contains one or more spelling mistakes or unrecognized words.
57+
[SA1651](SA1651.md) | DoNotUsePlaceholderElements | The documentation for the element contains one or more `<placeholder>` elements.
58+
[SA1652](SA1652.md) | EnableXmlDocumentationOutput | This rule was moved to [SA0001](SA0001.md)

documentation/LayoutRules.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
### Layout Rules (SA1500-)
2+
Rules which enforce code layout and line spacing.
3+
4+
Identifier | Name | Description
5+
-----------|------|------------
6+
[SA1500](SA1500.md) | BracesForMultiLineStatementsMustNotShareLine | The opening or closing brace within a C# statement, element, or expression is not placed on its own line.
7+
[SA1501](SA1501.md) | StatementMustNotBeOnSingleLine | A C# statement containing opening and closing braces is written completely on a single line.
8+
[SA1502](SA1502.md) | ElementMustNotBeOnSingleLine | A C# element containing opening and closing braces is written completely on a single line.
9+
[SA1503](SA1503.md) | BracesMustNotBeOmitted | The opening and closing braces for a C# statement have been omitted.
10+
[SA1504](SA1504.md) | AllAccessorsMustBeSingleLineOrMultiLine | 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.
11+
[SA1505](SA1505.md) | OpeningBracesMustNotBeFollowedByBlankLine | An opening brace within a C# element, statement, or expression is followed by a blank line.
12+
[SA1506](SA1506.md) | ElementDocumentationHeadersMustNotBeFollowedByBlankLine | An element documentation header above a C# element is followed by a blank line.
13+
[SA1507](SA1507.md) | CodeMustNotContainMultipleBlankLinesInARow | The C# code contains multiple blank lines in a row.
14+
[SA1508](SA1508.md) | ClosingBracesMustNotBePrecededByBlankLine | A closing brace within a C# element, statement, or expression is preceded by a blank line.
15+
[SA1509](SA1509.md) | OpeningBracesMustNotBePrecededByBlankLine | An opening brace within a C# element, statement, or expression is preceded by a blank line.
16+
[SA1510](SA1510.md) | ChainedStatementBlocksMustNotBePrecededByBlankLine | Chained C# statements are separated by a blank line.
17+
[SA1511](SA1511.md) | WhileDoFooterMustNotBePrecededByBlankLine | The while footer at the bottom of a do-while statement is separated from the statement by a blank line.
18+
[SA1512](SA1512.md) | SingleLineCommentsMustNotBeFollowedByBlankLine | A single-line comment within C# code is followed by a blank line.
19+
[SA1513](SA1513.md) | ClosingBraceMustBeFollowedByBlankLine | A closing brace within a C# element, statement, or expression is not followed by a blank line.
20+
[SA1514](SA1514.md) | ElementDocumentationHeaderMustBePrecededByBlankLine | An element documentation header above a C# element is not preceded by a blank line.
21+
[SA1515](SA1515.md) | SingleLineCommentMustBePrecededByBlankLine | A single-line comment within C# code is not preceded by a blank line.
22+
[SA1516](SA1516.md) | ElementsMustBeSeparatedByBlankLine | Adjacent C# elements are not separated by a blank line.
23+
[SA1517](SA1517.md) | CodeMustNotContainBlankLinesAtStartOfFile | The code file has blank lines at the start.
24+
[SA1518](SA1518.md) | UseLineEndingsCorrectlyAtEndOfFile | The line endings at the end of a file do not match the settings for the project.
25+
[SA1519](SA1519.md) | BracesMustNotBeOmittedFromMultiLineChildStatement | The opening and closing braces for a multi-line C# statement have been omitted.
26+
[SA1520](SA1520.md) | UseBracesConsistently | The opening and closing braces of a chained `if`/`else if`/`else` construct were included for some clauses, but omitted for others.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### Maintainability Rules (SA1400-)
2+
Rules which improve code maintainability.
3+
4+
Identifier | Name | Description
5+
-----------|------|------------
6+
[SA1119](SA1119.md) | StatementMustNotUseUnnecessaryParenthesis | A C# statement contains parenthesis which are unnecessary and should be removed.
7+
[SA1400](SA1400.md) | AccessModifierMustBeDeclared | The access modifier for a C# element has not been explicitly defined.
8+
[SA1401](SA1401.md) | FieldsMustBePrivate | A field within a C# class has an access modifier other than private.
9+
[SA1402](SA1402.md) | FileMayOnlyContainASingleClass | A C# code file contains more than one unique class.
10+
[SA1403](SA1403.md) | FileMayOnlyContainASingleNamespace | A C# code file contains more than one namespace.
11+
[SA1404](SA1404.md) | CodeAnalysisSuppressionMustHaveJustification | A Code Analysis SuppressMessage attribute does not include a justification.
12+
[SA1405](SA1405.md) | DebugAssertMustProvideMessageText | A call to Debug.Assert in C# code does not include a descriptive message.
13+
[SA1406](SA1406.md) | DebugFailMustProvideMessageText | A call to Debug.Fail in C# code does not include a descriptive message.
14+
[SA1407](SA1407.md) | ArithmeticExpressionsMustDeclarePrecedence | A C# statement contains a complex arithmetic expression which omits parenthesis around operators.
15+
[SA1408](SA1408.md) | ConditionalExpressionsMustDeclarePrecedence | A C# statement contains a complex conditional expression which omits parenthesis around operators.
16+
[SA1409](SA1409.md) | RemoveUnnecessaryCode | A C# file contains code which is unnecessary and can be removed without changing the overall logic of the code.
17+
[SA1410](SA1410.md) | RemoveDelegateParenthesisWhenPossible | A call to a C# anonymous method does not contain any method parameters, yet the statement still includes parenthesis.
18+
[SA1411](SA1411.md) | AttributeConstructorMustNotUseUnnecessaryParenthesis | An attribute declaration does not contain any parameters, yet it still includes parenthesis.
19+
[SA1412](SA1412.md) | StoreFilesAsUtf8 | The encoding of the file is not UTF-8 with byte order mark.

documentation/NamingRules.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
### Naming Rules (SA1300-)
2+
Rules which enforce naming requirements for members, types, and variables.
3+
4+
Identifier | Name | Description
5+
-----------|------|------------
6+
[SA1300](SA1300.md) | ElementMustBeginWithUpperCaseLetter | The name of a C# element does not begin with an upper-case letter.
7+
[SA1301](SA1301.md) | ElementMustBeginWithLowerCaseLetter | There are currently no situations in which this rule will fire.
8+
[SA1302](SA1302.md) | InterfaceNamesMustBeginWithI | The name of a C# interface does not begin with the capital letter I.
9+
[SA1303](SA1303.md) | ConstFieldNamesMustBeginWithUpperCaseLetter | The name of a constant C# field must begin with an upper-case letter.
10+
[SA1304](SA1304.md) | NonPrivateReadonlyFieldsMustBeginWithUpperCaseLetter | The name of a non-private readonly C# field must being with an upper-case letter.
11+
[SA1305](SA1305.md) | FieldNamesMustNotUseHungarianNotation | The name of a field or variable in C# uses Hungarian notation.
12+
[SA1306](SA1306.md) | FieldNamesMustBeginWithLowerCaseLetter | The name of a field in C# does not begin with a lower-case letter.
13+
[SA1307](SA1307.md) | AccessibleFieldsMustBeginWithUpperCaseLetter | The name of a public or internal field in C# does not begin with an upper-case letter.
14+
[SA1308](SA1308.md) | VariableNamesMustNotBePrefixed | A field name in C# is prefixed with *m_* or *s_*.
15+
[SA1309](SA1309.md) | FieldNamesMustNotBeginWithUnderscore | A field name in C# begins with an underscore.
16+
[SA1310](SA1310.md) | FieldNamesMustNotContainUnderscore | A field name in C# contains an underscore.
17+
[SA1311](SA1311.md) | StaticReadonlyFieldsMustBeginWithUpperCaseLetter | The name of a static readonly field does not begin with an upper-case letter.
18+
[SA1312](SA1312.md) | VariableNamesMustBeginWithLowerCaseLetter | The name of a variable in C# does not begin with a lower-case letter.
19+
[SA1313](SA1313.md) | ParameterNamesMustBeginWithLowerCaseLetter | The name of a parameter in C# does not begin with a lower-case letter.

0 commit comments

Comments
 (0)