Skip to content

Commit

Permalink
Rollup merge of rust-lang#81401 - ehuss:tidy-cleanup, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
tidy: Some code cleanup.

This is just some cleanup that shouldn't have any change in behavior.  (See commit messages for more details.)

* Remove cargo check. This test wasn't working, and is no longer valid.
* Remove edition filter exceptions. They are no longer necessary.
* Remove unnecessary trailing semicolon.  Otherwise the warning will prevent tidy from building after the beta branch.
  • Loading branch information
JohnTitor authored Jan 26, 2021
2 parents 9da3608 + 6f22f51 commit 24a1081
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 111 deletions.
90 changes: 0 additions & 90 deletions src/tools/tidy/src/cargo.rs

This file was deleted.

16 changes: 1 addition & 15 deletions src/tools/tidy/src/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@
use std::path::Path;

fn filter_dirs(path: &Path) -> bool {
// FIXME: just use super::filter_dirs after the submodules are updated.
if super::filter_dirs(path) {
return true;
}
let skip = [
"src/doc/book/second-edition",
"src/doc/book/2018-edition",
"src/doc/book/ci/stable-check",
"src/doc/reference/stable-check",
];
skip.iter().any(|p| path.ends_with(p))
}

fn is_edition_2018(mut line: &str) -> bool {
line = line.trim();
line == "edition = \"2018\"" || line == "edition = \'2018\'"
Expand All @@ -24,7 +10,7 @@ fn is_edition_2018(mut line: &str) -> bool {
pub fn check(path: &Path, bad: &mut bool) {
super::walk(
path,
&mut |path| filter_dirs(path) || path.ends_with("src/test"),
&mut |path| super::filter_dirs(path) || path.ends_with("src/test"),
&mut |entry, contents| {
let file = entry.path();
let filename = file.file_name().unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn map_lib_features(
mf(Err($msg), file, i + 1);
continue;
}};
};
}
if let Some((ref name, ref mut f)) = becoming_feature {
if f.tracking_issue.is_none() {
f.tracking_issue = find_attr_val(line, "issue").and_then(handle_issue_none);
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ macro_rules! tidy_error {
}

pub mod bins;
pub mod cargo;
pub mod debug_artifacts;
pub mod deps;
pub mod edition;
Expand Down
4 changes: 0 additions & 4 deletions src/tools/tidy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ fn main() {
style::check(&compiler_path, &mut bad);
style::check(&library_path, &mut bad);

cargo::check(&src_path, &mut bad);
cargo::check(&compiler_path, &mut bad);
cargo::check(&library_path, &mut bad);

edition::check(&src_path, &mut bad);
edition::check(&compiler_path, &mut bad);
edition::check(&library_path, &mut bad);
Expand Down

0 comments on commit 24a1081

Please sign in to comment.