Skip to content

Commit ea06fa3

Browse files
committed
Auto merge of #13177 - GuillaumeGomez:fix-broken-list-lints-config, r=xFrednet
Fix broken list for lints config Follow-up of #13166. Finally figured out that it was a transformation and not the source that was the problem. It now looks like this: ![Screenshot from 2024-07-29 16-29-10](https://github.com/user-attachments/assets/4b89b3fe-8f85-47b8-8d9a-505badeaeac4) r? `@xFrednet` changelog: none
2 parents c6f45df + 712e8f4 commit ea06fa3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clippy_config/src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl fmt::Display for ClippyConfiguration {
1414
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1515
write!(f, "- `{}`: {}", self.name, self.doc)?;
1616
if !self.default.is_empty() {
17-
write!(f, "\n\n(default: `{}`)", self.default)?;
17+
write!(f, "\n\n (default: `{}`)", self.default)?;
1818
}
1919
Ok(())
2020
}

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,11 @@ fn cleanup_docs(docs_collection: &Vec<String>) -> String {
684684
.find(|&s| !matches!(s, "" | "ignore" | "no_run" | "should_panic"))
685685
// if no language is present, fill in "rust"
686686
.unwrap_or("rust");
687+
let len_diff = line.len() - line.trim_start().len();
688+
if len_diff != 0 {
689+
// We put back the indentation.
690+
docs.push_str(&line[..len_diff]);
691+
}
687692
docs.push_str("```");
688693
docs.push_str(lang);
689694

0 commit comments

Comments
 (0)