Skip to content

FR: make disabling format_generated_files work with stdin input #6620

@ilyagr

Description

@ilyagr

Currently, rustfmt formats generated files if they are passed via stdin, even if format_generated_files=false. I think it's nice to have an issue tracking this problem specifically.

See #5080 (comment) for an overview with a few more details, and #5172 for the reason for the current behavior.

IMO, if format_generated_files=false, rustfmt should act like cat on generated files passed via stdin. I'm unsure whether there are any issues with such a plan. This is already what happens when disable_all_formatting=true.


I'll link to #5137 which I think is spiritually related; if that were fixed, it would be a workaround for this issue as well (and vice-versa, as far as generated files are concerned, which is currently my main use-case for #5137).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions