Skip to content

Commit 94fe671

Browse files
committed
Allow running lintcheck with a renamed rust-clippy dir
1 parent 92048f4 commit 94fe671

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lintcheck/src/main.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -665,16 +665,6 @@ fn lintcheck_needs_rerun(lintcheck_logs_path: &Path) -> bool {
665665
logs_modified < clippy_modified
666666
}
667667

668-
fn is_in_clippy_root() -> bool {
669-
if let Ok(pb) = std::env::current_dir() {
670-
if let Some(file) = pb.file_name() {
671-
return file == PathBuf::from("rust-clippy");
672-
}
673-
}
674-
675-
false
676-
}
677-
678668
/// lintchecks `main()` function
679669
///
680670
/// # Panics
@@ -683,7 +673,7 @@ fn is_in_clippy_root() -> bool {
683673
/// or if lintcheck is executed from the wrong directory (aka none-repo-root)
684674
pub fn main() {
685675
// assert that we launch lintcheck from the repo root (via cargo lintcheck)
686-
if !is_in_clippy_root() {
676+
if std::fs::metadata("lintcheck/Cargo.toml").is_err() {
687677
eprintln!("lintcheck needs to be run from clippys repo root!\nUse `cargo lintcheck` alternatively.");
688678
std::process::exit(3);
689679
}

0 commit comments

Comments
 (0)