Skip to content

Apply Clippy's --fix to a single file. #5613

Open
@JeanMertz

Description

@JeanMertz

I've been testing clippy --fix since #5363 got merged, and it's working great ❤️.

I've been thinking on integrating it into my editor similar to how rustfmt runs when I save a file.

Currently, clippy --fix fixes all issues in a project. Running clippy against a single file isn't useful (or supported), since it needs the context of a single crate to be able to report certain problems (e.g. unused variables, etc).

However, a combination of "check entire crate", combined with "apply fixes for this one file", would make it possible to integrate Clippy in an editor by applying fixes to the active file, while still checking the entire crate for contextual information it needs.

I'm curious if this is something that sounds interesting to pursuit. I'm not sure what the UX around this feature would be, but I guess it would be to provide --fix, and also some kind of repeatable --fix-file to fix any issues in one or more files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions