You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/authoring.md
+20-19Lines changed: 20 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -76,28 +76,29 @@ Rules can be linked to by their ID using markdown such as `[foo.bar]`. There are
76
76
In the HTML, the rules are clickable just like headers.
77
77
78
78
When assigning rules to new paragraphs, or when modifying rule names, use the following guidelines:
79
-
1. A rule applies to one core idea, which should be easily determined when reading the paragraph it is applied to,
80
-
2. Other than the "intro" paragraph, purely explanatory, expository, or exemplary content does not need a rule. If the expository paragraph isn't directly related to the previous, separate it with a hard (rendered) line break
79
+
80
+
1. A rule applies to one core idea, which should be easily determined when reading the paragraph it is applied to.
81
+
2. Other than the "intro" paragraph, purely explanatory, expository, or exemplary content does not need a rule. If the expository paragraph isn't directly related to the previous, separate it with a hard (rendered) line break.
81
82
* This content will be moved to `[!NOTE]` or more specific admonitions in the future.
82
-
3. Rust code examples and tests do not need their own rules
83
-
4. Notes do not need rules. For other admonition types, use the following guidelines:
83
+
3. Rust code examples and tests do not need their own rules.
84
+
4. Use the following guidelines for admonitions:
85
+
* Notes: Do not include a rule.
84
86
* Warning: Omit the rule if the warning follows from the previous paragraph or if the warning is explanatory and doesn't introduce any new rules.
85
-
* Target specific behaviour: Always include the rule
86
-
* Edition differences: Always include the rule
87
-
* Version history: Omit the rule if the present behaviour is explained in the immediately preceeding rule.
88
-
4. The following keywords should be used to identify paragraphs when unambiguous:
87
+
* Target specific behavior: Always include the rule.
88
+
* Edition differences: Always include the rule.
89
+
* Version history: Omit the rule if the present behavior is explained in the immediately preceding rule.
90
+
5. The following keywords should be used to identify paragraphs when unambiguous:
89
91
*`intro`: The beginning paragraph of each section - should explain the construct being defined overall.
90
-
*`syntax`: Syntax definitions or explanations when BNF syntax definitions are not used
91
-
*`namespace`: For items only, specifies the namespace(s) the item introduces a name in. May also be used elsewhere when defining a namespace (e.g. `r[attribute.diagnostic.namespace]`)
92
-
5. When a rule doesn't fall under the above keywords. or for section rule ids, name the subrule as follows:
93
-
* If the rule is naming a specific Rust language construct (e.g. an attribute, standard library type/function, or keyword-introduced concept), use the construct as named in the language, appropriately case-adjusted (but do not replace `_`s with `-`s)
94
-
* Other than rust language concepts with `_`s in the name, use `-` characters to separate words within a "subrule"
95
-
* Whenever possible, do not repeat previous components of the rule
96
-
* Prefer using singular forms of words over plural unless the rule applies to a list or the construct is named as plural in the language (e.g. `r[attribute.diagnostic.lint.group])
97
-
* Edition differences admonitions should typically be named by the edition referenced directly by the rule. If multiple editions are named, use the one for which the behaviour is defined by the admonition, and not by a previous paragraph
98
-
* Target Specific admonitions should typically be named by the least specific target property to which they apply (e.g. if a rule affects all x86 cpus, the rule name should include `x86` rather than separately listing `i586`, `i686` and `x86_64`, and if a rule applies to all ELF platforms, it should be named `elf` rather than listing every ELF os)
99
-
* Use an appropriately discriptive, but short, name if the language does not provide one.
100
-
92
+
*`syntax`: Syntax definitions or explanations when BNF syntax definitions are not used.
93
+
*`namespace`: For items only, specifies the namespace(s) the item introduces a name in. May also be used elsewhere when defining a namespace (e.g. `r[attribute.diagnostic.namespace]`).
94
+
6. When a rule doesn't fall under the above keywords, or for section rule ids, name the subrule as follows:
95
+
* If the rule is naming a specific Rust language construct (e.g. an attribute, standard library type/function, or keyword-introduced concept), use the construct as named in the language, appropriately case-adjusted (but do not replace `_`s with `-`s).
96
+
* Other than Rust language concepts with `_`s in the name, use `-` characters to separate words within a "subrule".
97
+
* Whenever possible, do not repeat previous components of the rule.
98
+
* Prefer using singular forms of words over plural unless the rule applies to a list or the construct is named as plural in the language (e.g. `r[attribute.diagnostic.lint.group]).
99
+
* Edition differences admonitions should typically be named by the edition referenced directly by the rule. If multiple editions are named, use the one for which the behavior is defined by the admonition, and not by a previous paragraph.
100
+
* Target specific admonitions should typically be named by the least specific target property to which they apply (e.g. if a rule affects all x86 CPUs, the rule name should include `x86` rather than separately listing `i586`, `i686` and `x86_64`, and if a rule applies to all ELF platforms, it should be named `elf` rather than listing every ELF OS).
101
+
* Use an appropriately descriptive, but short, name if the language does not provide one.
0 commit comments