Skip to content

Do not reformat on input error #3989

@dhardy

Description

@dhardy

Could rustfmt not reformat on error, but with command-line option to override, please?

Rationale: I enter some invalid code (e.g. #![rustfmt::max_width(120)], which is not a valid rustfmt attribute), run cargo fmt, and get an error. Because rustfmt still changed the file in question I lose my editor's history (unless overriding its desire to reload a changed file), thus adjusting the invalid item becomes harder.

(BTW, is per-file/item configuration a thing? It would be nice sometimes.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions