Skip to content

Commit

Permalink
Fix matadata collection configuration formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xFrednet committed Aug 28, 2021
1 parent 0828c0b commit e903b4c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clippy_lints/src/utils/internal_lints/metadata_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,15 @@ fn parse_config_field_doc(doc_comment: &str) -> Option<(Vec<String>, String)> {
if let Some(split_pos) = doc_comment.find('.');
then {
let mut doc_comment = doc_comment.to_string();
let documentation = doc_comment.split_off(split_pos);
let mut documentation = doc_comment.split_off(split_pos);

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

// Format documentation correctly
// split off leading `.` from lint name list and indent for correct formatting
documentation = documentation.trim_start_matches('.').trim().replace("\n ", "\n ");

Some((lints, documentation))
} else {
None
Expand Down Expand Up @@ -781,8 +785,6 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for ApplicabilityResolver<'a, 'hir> {
}
};

// TODO xFrednet 2021-03-01: support function arguments?

intravisit::walk_expr(self, expr);
}
}
Expand Down

0 comments on commit e903b4c

Please sign in to comment.