@@ -44,8 +44,8 @@ fn dogfood() {
44
44
"rustc_tools_util" ,
45
45
] {
46
46
println ! ( "linting {package}" ) ;
47
- if !run_clippy_for_package ( package, & [ "-D" , "clippy::all" , "-D" , "clippy::pedantic" ] ) {
48
- failed_packages. push ( if package. is_empty ( ) { "root" } else { package } ) ;
47
+ if !run_clippy_for_package ( package) {
48
+ failed_packages. push ( package) ;
49
49
}
50
50
}
51
51
@@ -57,7 +57,7 @@ fn dogfood() {
57
57
}
58
58
59
59
#[ must_use]
60
- fn run_clippy_for_package ( project : & str , args : & [ & str ] ) -> bool {
60
+ fn run_clippy_for_package ( project : & str ) -> bool {
61
61
let root_dir = PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) ;
62
62
63
63
let mut command = Command :: new ( & * test_utils:: CARGO_CLIPPY_PATH ) ;
@@ -79,15 +79,17 @@ fn run_clippy_for_package(project: &str, args: &[&str]) -> bool {
79
79
}
80
80
}
81
81
82
- command. arg ( "--" ) . args ( args ) ;
82
+ command. arg ( "--" ) ;
83
83
command. arg ( "-Cdebuginfo=0" ) ; // disable debuginfo to generate less data in the target dir
84
- command. args ( [ "-D" , "clippy::dbg_macro" ] ) ;
85
-
84
+ command. args ( [ "-D" , "clippy::all" , "-D" , "clippy::pedantic" , "-D" , "clippy::dbg_macro" ] ) ;
86
85
if !cfg ! ( feature = "internal" ) {
87
86
// running a clippy built without internal lints on the clippy source
88
- // that contains e.g. `allow(clippy::invalid_paths )`
87
+ // that contains e.g. `allow(clippy::symbol_as_str )`
89
88
command. args ( [ "-A" , "unknown_lints" ] ) ;
90
89
}
91
90
91
+ // Workaround for not being a workspace, add the crate's directory back to the path
92
+ command. args ( [ "--remap-path-prefix" , & format ! ( "={project}" ) ] ) ;
93
+
92
94
command. status ( ) . unwrap ( ) . success ( )
93
95
}
0 commit comments