Skip to content

[Bug] Running formatter with Rust-Stable can cause problems #47

Description

@mbfm

Description

The Format and Clippy action uses unstable rustfmt options, which require a Nightly toolchain to be used.

When run with a Stable toolchain, these options are simply ignored.
For now, this seems to not cause major problems:

  • If a user runs the Action exclusively with Stable toolchain, the formatting will just be slightly different from what we intended.
  • If a user runs the Action with both a Stable toolchain and a Nightly toolchain (like in classic-diagnostic-adapter), then the Nightly formatter applies its stricter formatting, which the Stable formatter seems to also be fine with. At least, this has been the observation in classic-diagnostic-adapter so far.

Running with both, Nightly and Stable, could result in thrashing however, where one formatter changes it in one way and the other wants to change it back, which would cause the CI/CD run to fail.

Solution options

From what I can tell, to keep using the unstable formatter options, we should block execution when a user tries to run the formatter with Rust-Stable.

For that, we can either:

  1. Add a flag to the Action to skip the format run.
    Pro: Keep unified Action, which might be extended in future.
    Con: Users likely need at least Format+Nightly and Clippy+Stable, which requires two mutually exclusive configuration blocks.

  2. Split the "Format and Clippy" action into two actions/workflows.
    If we do this, we should also mind Improvement: convert linter composite into action #19.
    Pro: Allows individual configuration in intuitive fashion.
    Con: Breaking Change.

Important

Link the pull request that addresses this bug once created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions