Skip to content

Commit 77effb7

Browse files
committed
Auto merge of rust-lang#8809 - Alexendoo:metadata-collection-expect, r=xFrednet
Ignore unfulfilled_lint_expectations in metadata collection r? `@xFrednet` When metadata collection is enabled the regular early/late pass registrations are skipped, which the `#[expect()]`s were no fan of: https://github.com/rust-lang/rust-clippy/runs/6356675328?check_suite_focus=true changelog: none
2 parents aa03344 + 6edf0b4 commit 77effb7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/dogfood.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn dogfood_clippy() {
2121

2222
// "" is the root package
2323
for package in &["", "clippy_dev", "clippy_lints", "clippy_utils", "rustc_tools_util"] {
24-
run_clippy_for_package(package);
24+
run_clippy_for_package(package, &[]);
2525
}
2626
}
2727

@@ -38,7 +38,7 @@ fn run_metadata_collection_lint() {
3838

3939
// Run collection as is
4040
std::env::set_var("ENABLE_METADATA_COLLECTION", "1");
41-
run_clippy_for_package("clippy_lints");
41+
run_clippy_for_package("clippy_lints", &["-A", "unfulfilled_lint_expectations"]);
4242

4343
// Check if cargo caching got in the way
4444
if let Ok(file) = File::open(metadata_output_path) {
@@ -61,10 +61,10 @@ fn run_metadata_collection_lint() {
6161
.unwrap();
6262

6363
// Running the collection again
64-
run_clippy_for_package("clippy_lints");
64+
run_clippy_for_package("clippy_lints", &["-A", "unfulfilled_lint_expectations"]);
6565
}
6666

67-
fn run_clippy_for_package(project: &str) {
67+
fn run_clippy_for_package(project: &str, args: &[&str]) {
6868
let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
6969

7070
let mut command = Command::new(&*test_utils::CARGO_CLIPPY_PATH);
@@ -76,6 +76,7 @@ fn run_clippy_for_package(project: &str) {
7676
.arg("--all-targets")
7777
.arg("--all-features")
7878
.arg("--")
79+
.args(args)
7980
.args(&["-D", "clippy::all"])
8081
.args(&["-D", "clippy::pedantic"])
8182
.arg("-Cdebuginfo=0"); // disable debuginfo to generate less data in the target dir

0 commit comments

Comments
 (0)