Skip to content

Commit e8310a7

Browse files
committed
Auto merge of #60167 - varkor:tidy-filelength, r=matthewjasper
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).
2 parents 180edc2 + 8c30687 commit e8310a7

File tree

26 files changed

+76
-3
lines changed

26 files changed

+76
-3
lines changed

src/liballoc/collections/vec_deque.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! A double-ended queue implemented with a growable ring buffer.
24
//!
35
//! This queue has `O(1)` amortized inserts and removals from both ends of the

src/libcore/num/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! Numeric traits and functions for the built-in numeric types.
24
35
#![stable(feature = "rust1", since = "1.0.0")]

src/libcore/ptr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! Manually manage memory through raw pointers.
24
//!
35
//! *[See also the pointer primitive types](../../std/primitive.pointer.html).*

src/libcore/slice/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! Slice management and manipulation.
24
//!
35
//! For more details see [`std::slice`].

src/libcore/str/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! String manipulation.
24
//!
35
//! For more details, see the `std::str` module.

src/librustc/hir/lowering.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! Lowers the AST to the HIR.
24
//!
35
//! Since the AST and HIR are fairly similar, this is mostly a simple procedure,

src/librustc/mir/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! MIR datatypes and passes. See the [rustc guide] for more info.
24
//!
35
//! [rustc guide]: https://rust-lang.github.io/rustc-guide/mir/index.html

src/librustc/session/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! Contains infrastructure for configuring the compiler, including parsing
24
//! command line options.
35

src/librustc/traits/select.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! Candidate selection. See the [rustc guide] for more information on how this works.
24
//!
35
//! [rustc guide]: https://rust-lang.github.io/rustc-guide/traits/resolution.html#selection

src/librustc/ty/context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// ignore-tidy-filelength
2+
13
//! Type context book-keeping.
24
35
use crate::arena::Arena;

0 commit comments

Comments
 (0)