Skip to content
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

Merged

Commits on Jul 21, 2023

  1. 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.
    joshtriplett committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    715efa4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cf4b20d View commit details
    Browse the repository at this point in the history
  3. 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.
    joshtriplett committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    615b58b View commit details
    Browse the repository at this point in the history
  4. 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.
    joshtriplett committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    081e15a View commit details
    Browse the repository at this point in the history
  5. 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.
    joshtriplett committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    ce5aca9 View commit details
    Browse the repository at this point in the history
  6. 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.
    joshtriplett committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    9ccc104 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    69d29a7 View commit details
    Browse the repository at this point in the history
  8. 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.
    joshtriplett committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    144e8a3 View commit details
    Browse the repository at this point in the history
  9. Clarify wording on breaking arrays across lines

    Co-authored-by: Caleb Cartwright <[email protected]>
    joshtriplett and calebcartwright committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    77d09cb View commit details
    Browse the repository at this point in the history