Skip to content

Clarify internal programming style #49567

Closed
@varkor

Description

@varkor

Every so often someone will submit a pull request that is the result of running rustfmt on a particular file, or set of files (examples: #49360, #38567, #30684).

Presumably we want to encourage fixing mistakes in the code style, though at the moment rustfmt can produce undesirable changes (e.g. see the comments in #37349). Without guidelines, these can either be merged directly, or it left up to the individual reviewer to decide which changes are preferred.

It seems to me it would be better to do one of two things:

  • Add rustfmt to tidy and ensure code always adheres to one style.
  • Explicate style guidelines, and then only allow PRs fixing mistakes that haven't been spotted from earlier changes (for example, if rustfmt is too strict or not good enough). I.e. not changing style choices that were the original intention of the author if they're not specified by the style guide.

At the moment, I think style changes are being made, through blind use of rustfmt, that leave the code in a worse state than before. I think it'd be preferable if we could avoid this; does anyone else have thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions