-
Notifications
You must be signed in to change notification settings - Fork 72
Enable Rustfmt & Clippy for cg_gcc #457
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
Comments
Yes, good idea, I'll accept a PR doing that. Ideally, we should use the same rustfmt config used by the rust project, if any. |
What about using your rustfmt?(Since you contribute the most code). |
I tried once to get the formatting I wanted with rustfmt, but I was unable to because some settings were missing. |
I once noticed that in some cases, Rustfmt may behave differently on different machines. A friend of mine used VSCode and our rustfmt seemed to behaved differently, causing our code to be reformatted over and over again. Still not sure about why and how. |
Apparently, one cause is because formatting a selection of code only sends the code to be formatted to rustfmt, not the filename, so it cannot find the config. |
By the way, have you switched back to vim? Is VSCode rustfmt-related behavior still a problem for you? |
Oh, I never used VS Code. It's some people contributing to cg_gcc via the Rust repo that have this issue. I've been using neovim (and vim before) for many years. |
I formatted the code in #458. |
By the way, is adding a full rustfmt specification useful? |
You probably want to use the same file as upstream https://github.com/rust-lang/rust/blob/6f435eb0eb2926cdb6640b3382b9e3e21ef05f07/rustfmt.toml, the Fyi, if these wind up being large changes it's often a good idea to crosscheck. Two people run the same rustfmt commands then Adding the hash of the formatting commit to |
Completed by #469. |
It takes a long time to manually adjust the code format and style, so I advice to enable the Rustfmt for this project to avoid potential bad styling.
As for clippy, it may be a good idea to reduce the poorly behaved code in Rust to improve code quality.
Tasks
The text was updated successfully, but these errors were encountered: