-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Move code generated by update_lints
to includes
#7673
Conversation
r? @giraffate (rust-highfive has picked a reviewer for you, use r? to override) |
The idea with this pull request is to move code generated out of The benefit is that moves a lot of clutter out of Some things still be done are:
This is a big change and it might be a bad idea. Feel free to close. I'll finish this off if it gets a thumbs up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change. This will also make syncing with rustc easier, since conflicts in those auto-generated files can just be ignored and lib.rs
won't have as much churn.
Agree on the format of the generated code (e.g. comment at the top, end in new line etc.)
I would add a newline at the end of the file and keep the format consistent. Some files have indentation, some don't. I would format those files as close as possible to what rustfmt would do. (see comments below)
Before you continue working on this, I'd wait for more feedback from @rust-lang/clippy though
I like the idea, +1 from me. If we continue this, could you please make sure to also include the automatically generated files in our pre-commit hook? 🙃 rust-clippy/util/etc/pre-commit.sh Lines 7 to 8 in 2316f4d
|
Sounds like a good idea, I like it. |
☔ The latest upstream changes (presumably #7653) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #7693) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #7715) made this pull request unmergeable. Please resolve the merge conflicts. |
Do we want to move this PR forward once it was rebased? There seems to be no objections so far 🙃 |
Sorry for the late reviewing. I've been a bit busy. Please give me a few more days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generated files LGTM. I didn't review the clippy_dev changes.
There were no objections to this in the last meeting, so once @giraffate is done with the review, this can be merged.
☔ The latest upstream changes (presumably #7692) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #7608) made this pull request unmergeable. Please resolve the merge conflicts. |
Also change the generation functions to return `String` instead of `Vec<String>`. This makes sense now as the updates aren't line oriented anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review, again.
Over all looks good, Thanks! I made one minor comment.
Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
@bors r+ Thanks! |
📌 Commit debb1f0 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Ooh, this has made rustfmt stop working for the entire codebase since the modules are |
Trying to fix that in #7773 |
Move module declarations back into lib.rs With #7673 we moved a lot of things from lib.rs to lib.foo.rs. Unfortunately, rustfmt doesn't seem to work when module declarations are included via `include!` (and trying the `mod foo; use foo::*;` trick doesn't seem to work much either in our specific case). With this PR we continue generating everything in subfiles except for module declarations, which are now generated within lib.rs.
Move module declarations back into lib.rs With #7673 we moved a lot of things from lib.rs to lib.foo.rs. Unfortunately, rustfmt doesn't seem to work when module declarations are included via `include!` (and trying the `mod foo; use foo::*;` trick doesn't seem to work much either in our specific case). With this PR we continue generating everything in subfiles except for module declarations, which are now generated within lib.rs. changelog: none
Move code generated by
update_lints
to includeschangelog: none