Skip to content

Commit e903b4c

Browse files
committed
Fix matadata collection configuration formatting
1 parent 0828c0b commit e903b4c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clippy_lints/src/utils/internal_lints/metadata_collector.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,15 @@ fn parse_config_field_doc(doc_comment: &str) -> Option<(Vec<String>, String)> {
344344
if let Some(split_pos) = doc_comment.find('.');
345345
then {
346346
let mut doc_comment = doc_comment.to_string();
347-
let documentation = doc_comment.split_off(split_pos);
347+
let mut documentation = doc_comment.split_off(split_pos);
348348

349349
doc_comment.make_ascii_lowercase();
350350
let lints: Vec<String> = doc_comment.split_off(DOC_START.len()).split(", ").map(str::to_string).collect();
351351

352+
// Format documentation correctly
353+
// split off leading `.` from lint name list and indent for correct formatting
354+
documentation = documentation.trim_start_matches('.').trim().replace("\n ", "\n ");
355+
352356
Some((lints, documentation))
353357
} else {
354358
None
@@ -781,8 +785,6 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for ApplicabilityResolver<'a, 'hir> {
781785
}
782786
};
783787

784-
// TODO xFrednet 2021-03-01: support function arguments?
785-
786788
intravisit::walk_expr(self, expr);
787789
}
788790
}

0 commit comments

Comments
 (0)