Skip to content

Commit

Permalink
Auto merge of #87462 - ibraheemdev:tidy-file-length-ignore-comment, r…
Browse files Browse the repository at this point in the history
…=Mark-Simulacrum

Ignore comments in tidy-filelength

Ref #60302 (comment)
  • Loading branch information
bors committed Aug 6, 2021
2 parents e2f7957 + 3171bd5 commit 7129033
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 19 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore-tidy-filelength
use crate::def::{CtorKind, DefKind, Res};
use crate::def_id::{DefId, CRATE_DEF_ID};
crate use crate::hir_id::{HirId, ItemLocalId};
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore-tidy-filelength

//! Lints in the Rust compiler.
//!
//! This contains lints which can feasibly be implemented as their own
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore-tidy-filelength

//! Some lints that are built in to the compiler.
//!
//! These are the built-in lints that are emitted direct in the main
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/layout.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore-tidy-filelength
use crate::ich::StableHashingContext;
use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags;
use crate::mir::{GeneratorLayout, GeneratorSavedLocal};
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_typeck/src/collect.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore-tidy-filelength
//! "Collection" is the process of determining the type and other external
//! details of each item in Rust. Collection is specifically concerned
//! with *inter-procedural* things -- for example, for a function
Expand All @@ -15,8 +14,6 @@
//! At present, however, we do run collection across all items in the
//! crate as a kind of pass. This should eventually be factored away.

// ignore-tidy-filelength

use crate::astconv::{AstConv, SizedByDefault};
use crate::bounds::Bounds;
use crate::check::intrinsic::intrinsic_operation_unsafety;
Expand Down
4 changes: 0 additions & 4 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// ignore-tidy-filelength
// This file almost exclusively consists of the definition of `Iterator`. We
// can't split that into multiple files.

use crate::cmp::{self, Ordering};
use crate::ops::{ControlFlow, Try};

Expand Down
1 change: 0 additions & 1 deletion library/core/src/slice/iter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore-tidy-filelength
//! Definitions of a bunch of iterators for `[T]`.

#[macro_use] // import iterator! and forward_iterator!
Expand Down
2 changes: 0 additions & 2 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore-tidy-filelength

//! Slice management and manipulation.
//!
//! For more details see [`std::slice`].
Expand Down
2 changes: 0 additions & 2 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// ignore-tidy-filelength

#[cfg(test)]
mod tests;

Expand Down
5 changes: 4 additions & 1 deletion src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ pub fn check(path: &Path, bad: &mut bool) {
} else {
trailing_new_lines = 0;
}
lines = i;

if !line.trim().starts_with("//") {
lines += 1;
}
}
if leading_new_lines {
tidy_error!(bad, "{}: leading newline", file.display());
Expand Down

0 comments on commit 7129033

Please sign in to comment.