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

Add a tidy check for files with over 3,000 lines #60167

Merged
merged 4 commits into from
Apr 26, 2019

Conversation

varkor
Copy link
Member

@varkor varkor commented Apr 22, 2019

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).

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 22, 2019
@varkor
Copy link
Member Author

varkor commented Apr 22, 2019

cc @rust-lang/compiler to check this is something we actually want to do.

@estebank
Copy link
Contributor

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).

@Centril
Copy link
Contributor

Centril commented Apr 22, 2019

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.

@bors

This comment has been minimized.

@matthewjasper
Copy link
Contributor

r=me once the compiler team is happy with this.

@bors
Copy link
Contributor

bors commented Apr 23, 2019

☔ The latest upstream changes (presumably #60211) made this pull request unmergeable. Please resolve the merge conflicts.

@varkor varkor added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 24, 2019
@varkor
Copy link
Member Author

varkor commented Apr 24, 2019

Let's very quickly check everyone's happy with this in tomorrow's meeting.

@Centril
Copy link
Contributor

Centril commented Apr 25, 2019

The consensus from the T-compiler meeting seems to be that everyone's happy with this.

@Centril Centril removed I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 25, 2019
@varkor
Copy link
Member Author

varkor commented Apr 25, 2019

@bors r=matthewjasper

@bors
Copy link
Contributor

bors commented Apr 25, 2019

📌 Commit 8c30687 has been approved by matthewjasper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2019
@bors
Copy link
Contributor

bors commented Apr 26, 2019

⌛ Testing commit 8c30687 with merge e8310a7...

bors added a commit that referenced this pull request Apr 26, 2019
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).
@bors
Copy link
Contributor

bors commented Apr 26, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: matthewjasper
Pushing e8310a7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 26, 2019
@bors bors merged commit 8c30687 into rust-lang:master Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants