Skip to content

Commit 52ae262

Browse files
committed
Auto merge of #12088 - granddaifuku:fix/metadata-collector-lint-listing, r=Manishearth
fix: metadata-collector lists wrong affected lints fixes #12042 This PR addresses the issue where the `metadata collector` incorrectly generates the `Affected Lints` section when a comma is included in the configuration documentation. I made adjustments; however, if the `/// Lint: SOMETHING` section ends with `.` it always produces the correct output. For example, ```rust /// Lint: PUB_UNDERSCORE_FIELDS ``` should be ```rust /// Lint: PUB_UNDERSCORE_FIELDS. ``` changelog: none
2 parents 0bf0b88 + 9dcf926 commit 52ae262

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

clippy_config/src/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ define_Conf! {
550550
/// Lint: PUB_UNDERSCORE_FIELDS
551551
///
552552
/// Lint "public" fields in a struct that are prefixed with an underscore based on their
553-
/// exported visibility; or whether they are marked as "pub".
553+
/// exported visibility, or whether they are marked as "pub".
554554
(pub_underscore_fields_behavior: PubUnderscoreFieldsBehaviour = PubUnderscoreFieldsBehaviour::PublicallyExported),
555555
}
556556

clippy_config/src/metadata.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ fn parse_config_field_doc(doc_comment: &str) -> Option<(Vec<String>, String)> {
9696
doc_comment.make_ascii_lowercase();
9797
let lints: Vec<String> = doc_comment
9898
.split_off(DOC_START.len())
99+
.lines()
100+
.next()
101+
.unwrap()
99102
.split(", ")
100103
.map(str::to_string)
101104
.collect();

0 commit comments

Comments
 (0)