Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change .fixed files to .fixed.rs #288

Open
BD103 opened this issue Oct 13, 2024 · 2 comments
Open

Change .fixed files to .fixed.rs #288

BD103 opened this issue Oct 13, 2024 · 2 comments

Comments

@BD103
Copy link

BD103 commented Oct 13, 2024

While implementing UI tests for a custom linter, a reviewer noted that it would easier to review rustfix'd files if they had a .rs extension, since that would enable code highlighting when reviewing on Github or other code editors. This would be useful, but would be a breaking change for existing users.

I believe the extension for rustfix'd files is currently hardcoded here:

vec![config.check_output(single.as_bytes(), &mut errors, "fixed")]
}
_ => fixes
.iter()
.enumerate()
.map(|(i, fix)| {
config.check_output(fix.as_bytes(), &mut errors, &format!("{}.fixed", i + 1))

Additionally, this would probably require default_file_filter() to be updated to skip .fixed.rs files.

Thanks!

@oli-obk
Copy link
Owner

oli-obk commented Oct 13, 2024

Oh yea, that has annoyed me before, too.
Makes total sense. I think I just replicated what compiletest did without questioning it.

@flip1995 would this work for clippy, too? It'll cause a bit of churn, so I could make it configurable for a few releases so you can update when you feel like it instead of being forced at the next major bump

@flip1995
Copy link

FWIW, GitHub already highlights the .fixed files correctly, also during review (at least the non-expanded parts of the file)

But I think this would be useful to look at those files in your local editor.

I would use this format in Clippy then as well 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants