-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add a tidy check for files with over 3,000 lines #60167
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
cc @rust-lang/compiler to check this is something we actually want to do. |
Let's make sure the error has a blurb about how to disable the check (that way feature work that barely pushes a file over the edge is not stopped, but the signal is sent that the file needs restructuring). |
This seems like an extremely awesome PR and necessary to improve the quality of rustc. In particular, the easy way to disable the check for a file provides a way for us to incrementally improve things and find the problematic files quickly. |
This comment has been minimized.
This comment has been minimized.
r=me once the compiler team is happy with this. |
☔ The latest upstream changes (presumably #60211) made this pull request unmergeable. Please resolve the merge conflicts. |
Let's very quickly check everyone's happy with this in tomorrow's meeting. |
The consensus from the T-compiler meeting seems to be that everyone's happy with this. |
@bors r=matthewjasper |
📌 Commit 8c30687 has been approved by |
Add a tidy check for files with over 3,000 lines Files with a large number of lines can cause issues in GitHub (e.g. #60015) and also tend to be indicative of opportunities to refactor into less monolithic structures. This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in #60015 (comment). (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`. Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in #60015).
☀️ Test successful - checks-travis, status-appveyor |
Files with a large number of lines can cause issues in GitHub (e.g. #60015) and also tend to be indicative of opportunities to refactor into less monolithic structures.
This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in #60015 (comment). (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with
// ignore-tidy-filelength
.Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in #60015).