-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style-guide: clean up "must"/"should"/"may" #113380
style-guide: clean up "must"/"should"/"may" #113380
Commits on Jul 21, 2023
-
style-guide: Remove material about tool configurability
The style guide discusses the default Rust style. Configurability of Rust formatting tools are not the domain of the style guide.
Configuration menu - View commit details
-
Copy full SHA for 715efa4 - Browse repository at this point
Copy the full SHA 715efa4View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf4b20d - Browse repository at this point
Copy the full SHA cf4b20dView commit details -
style-guide: Fix an example to match the style
The style guide requires a trailing comma on where clause components, but then gives an example that doesn't include one. Add the missing trailing comma.
Configuration menu - View commit details
-
Copy full SHA for 615b58b - Browse repository at this point
Copy the full SHA 615b58bView commit details -
style-guide: Simplify the structure of a recommendation (no semantic …
…change) Avoid putting a sentence fragment after a list; integrate it with the sentence before the list.
Configuration menu - View commit details
-
Copy full SHA for 081e15a - Browse repository at this point
Copy the full SHA 081e15aView commit details -
style-guide: Avoid using "should" or "may" for required parts of the …
…default style The style guide inconsistently used language like "there should be a space" or "it should be on its own line", or "may be written on a single line", for things that are required components of the default Rust style. "should" and especially "may" come across as optional. While the style guide overall now has a statement at the top that the default style itself is a *recommendation*, the *definition* of the default style should not be ambiguous about what's part of the default style. Rewrite language in the style guide to only use "should" and "may" and similar for truly optional components of the style (e.g. things a tool cannot or should not enforce in its default configuration). In their place, either use "must", or rewrite in imperative style ("put a space", "start it on the same line"). The latter also substantially reduces the use of passive voice. This is a purely editorial change, and does not affect the semantic definition of the Rust style.
Configuration menu - View commit details
-
Copy full SHA for ce5aca9 - Browse repository at this point
Copy the full SHA ce5aca9View commit details -
style-guide: Add an additional chaining example
Make it clear the rule for stacking the second line on the first applies recursively, as long as the condition holds.
Configuration menu - View commit details
-
Copy full SHA for 9ccc104 - Browse repository at this point
Copy the full SHA 9ccc104View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69d29a7 - Browse repository at this point
Copy the full SHA 69d29a7View commit details -
style-guide: Fix example to match the rule it exemplifies (and match …
…rustfmt) An example immediately following "Put each bound on its own line." did not put each bound on its own line.
Configuration menu - View commit details
-
Copy full SHA for 144e8a3 - Browse repository at this point
Copy the full SHA 144e8a3View commit details -
Clarify wording on breaking arrays across lines
Co-authored-by: Caleb Cartwright <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 77d09cb - Browse repository at this point
Copy the full SHA 77d09cbView commit details