Skip to content

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

Merged
bors merged 4 commits into
rust-lang:masterfrom
varkor:tidy-filelength
Apr 26, 2019
Merged

Add a tidy check for files with over 3,000 lines#60167
bors merged 4 commits into
rust-lang:masterfrom
varkor:tidy-filelength

Conversation

@varkor

@varkor varkor commented Apr 22, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

varkor commented Apr 22, 2019

Copy link
Copy Markdown
Contributor Author

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

@estebank

Copy link
Copy Markdown
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

Centril commented Apr 22, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@bors

bors commented Apr 23, 2019

Copy link
Copy Markdown
Collaborator

☔ 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

varkor commented Apr 24, 2019

Copy link
Copy Markdown
Contributor Author

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

@Centril

Centril commented Apr 25, 2019

Copy link
Copy Markdown
Contributor

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

varkor commented Apr 25, 2019

Copy link
Copy Markdown
Contributor Author

@bors r=matthewjasper

@bors

bors commented Apr 25, 2019

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Apr 26, 2019

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Apr 26, 2019

Copy link
Copy Markdown
Collaborator

☀️ 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