Skip to content

Commit 7129033

Browse files
committed
Auto merge of #87462 - ibraheemdev:tidy-file-length-ignore-comment, r=Mark-Simulacrum
Ignore comments in tidy-filelength Ref #60302 (comment)
2 parents e2f7957 + 3171bd5 commit 7129033

File tree

10 files changed

+4
-19
lines changed

10 files changed

+4
-19
lines changed

compiler/rustc_hir/src/hir.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-tidy-filelength
21
use crate::def::{CtorKind, DefKind, Res};
32
use crate::def_id::{DefId, CRATE_DEF_ID};
43
crate use crate::hir_id::{HirId, ItemLocalId};

compiler/rustc_lint/src/builtin.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore-tidy-filelength
2-
31
//! Lints in the Rust compiler.
42
//!
53
//! This contains lints which can feasibly be implemented as their own

compiler/rustc_lint_defs/src/builtin.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore-tidy-filelength
2-
31
//! Some lints that are built in to the compiler.
42
//!
53
//! These are the built-in lints that are emitted direct in the main

compiler/rustc_middle/src/ty/layout.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-tidy-filelength
21
use crate::ich::StableHashingContext;
32
use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags;
43
use crate::mir::{GeneratorLayout, GeneratorSavedLocal};

compiler/rustc_typeck/src/collect.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-tidy-filelength
21
//! "Collection" is the process of determining the type and other external
32
//! details of each item in Rust. Collection is specifically concerned
43
//! with *inter-procedural* things -- for example, for a function
@@ -15,8 +14,6 @@
1514
//! At present, however, we do run collection across all items in the
1615
//! crate as a kind of pass. This should eventually be factored away.
1716
18-
// ignore-tidy-filelength
19-
2017
use crate::astconv::{AstConv, SizedByDefault};
2118
use crate::bounds::Bounds;
2219
use crate::check::intrinsic::intrinsic_operation_unsafety;

library/core/src/iter/traits/iterator.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
// ignore-tidy-filelength
2-
// This file almost exclusively consists of the definition of `Iterator`. We
3-
// can't split that into multiple files.
4-
51
use crate::cmp::{self, Ordering};
62
use crate::ops::{ControlFlow, Try};
73

library/core/src/slice/iter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-tidy-filelength
21
//! Definitions of a bunch of iterators for `[T]`.
32
43
#[macro_use] // import iterator! and forward_iterator!

library/core/src/slice/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore-tidy-filelength
2-
31
//! Slice management and manipulation.
42
//!
53
//! For more details see [`std::slice`].

library/std/src/collections/hash/map.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore-tidy-filelength
2-
31
#[cfg(test)]
42
mod tests;
53

src/tools/tidy/src/style.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,10 @@ pub fn check(path: &Path, bad: &mut bool) {
344344
} else {
345345
trailing_new_lines = 0;
346346
}
347-
lines = i;
347+
348+
if !line.trim().starts_with("//") {
349+
lines += 1;
350+
}
348351
}
349352
if leading_new_lines {
350353
tidy_error!(bad, "{}: leading newline", file.display());

0 commit comments

Comments
 (0)