Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c1fa110

Browse files
committed
ENABLE_METADATA_COLLECTION env-value to disable default metadata collection
1 parent 4fc9603 commit c1fa110

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

clippy_lints/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
10051005
store.register_late_pass(|| box utils::internal_lints::OuterExpnDataPass);
10061006
}
10071007
#[cfg(feature = "metadata-collector-lint")]
1008-
store.register_late_pass(|| box utils::internal_lints::metadata_collector::MetadataCollector::default());
1008+
{
1009+
if std::env::var("ENABLE_METADATA_COLLECTION").eq(&Ok("1".to_string())) {
1010+
store.register_late_pass(|| box utils::internal_lints::metadata_collector::MetadataCollector::default());
1011+
}
1012+
}
10091013

10101014
store.register_late_pass(|| box utils::author::Author);
10111015
store.register_late_pass(|| box await_holding_invalid::AwaitHolding);

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,24 +148,6 @@ struct LintMetadata {
148148
applicability: Option<ApplicabilityInfo>,
149149
}
150150

151-
// impl Ord for LintMetadata {
152-
// fn cmp(&self, other: &Self) -> Ordering {
153-
// self.id.cmp(&other.id)
154-
// }
155-
// }
156-
//
157-
// impl PartialOrd for LintMetadata {
158-
// fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
159-
// Some(self.cmp(other))
160-
// }
161-
// }
162-
//
163-
// impl PartialEq for LintMetadata {
164-
// fn eq(&self, other: &Self) -> bool {
165-
// self.id == other.id
166-
// }
167-
// }
168-
169151
impl LintMetadata {
170152
fn new(id: String, id_span: SerializableSpan, group: String, docs: String) -> Self {
171153
Self {

tests/dogfood.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ fn dogfood_clippy() {
2222
return;
2323
}
2424
let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
25+
let enable_metadata_collection = std::env::var("ENABLE_METADATA_COLLECTION").unwrap_or_else(|_| "0".to_string());
2526

2627
let mut command = Command::new(&*CLIPPY_PATH);
2728
command
2829
.current_dir(root_dir)
2930
.env("CLIPPY_DOGFOOD", "1")
3031
.env("CARGO_INCREMENTAL", "0")
32+
.env("ENABLE_METADATA_COLLECTION", &enable_metadata_collection)
3133
.arg("clippy")
3234
.arg("--all-targets")
3335
.arg("--all-features")

0 commit comments

Comments
 (0)