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
This commit is contained in:
bors 2024-07-31 11:11:39 +00:00
commit ea06fa326d
2 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,7 @@ impl fmt::Display for ClippyConfiguration {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "- `{}`: {}", self.name, self.doc)?; write!(f, "- `{}`: {}", self.name, self.doc)?;
if !self.default.is_empty() { if !self.default.is_empty() {
write!(f, "\n\n(default: `{}`)", self.default)?; write!(f, "\n\n (default: `{}`)", self.default)?;
} }
Ok(()) Ok(())
} }

View File

@ -684,6 +684,11 @@ fn cleanup_docs(docs_collection: &Vec<String>) -> String {
.find(|&s| !matches!(s, "" | "ignore" | "no_run" | "should_panic")) .find(|&s| !matches!(s, "" | "ignore" | "no_run" | "should_panic"))
// if no language is present, fill in "rust" // if no language is present, fill in "rust"
.unwrap_or("rust"); .unwrap_or("rust");
let len_diff = line.len() - line.trim_start().len();
if len_diff != 0 {
// We put back the indentation.
docs.push_str(&line[..len_diff]);
}
docs.push_str("```"); docs.push_str("```");
docs.push_str(lang); docs.push_str(lang);