mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 04:45:01 +00:00
Promote lint.
settings over top-level settings (#9476)
This commit is contained in:
parent
6996ff7b1e
commit
c3b33e9c4d
62 changed files with 389 additions and 310 deletions
|
@ -116,7 +116,7 @@ fn process_documentation(documentation: &str, out: &mut String, rule_name: &str)
|
|||
}
|
||||
}
|
||||
|
||||
let anchor = option.replace('.', "-");
|
||||
let anchor = option.replace('.', "_");
|
||||
out.push_str(&format!("- [`{option}`][{option}]\n"));
|
||||
after.push_str(&format!("[{option}]: ../settings.md#{anchor}\n"));
|
||||
|
||||
|
@ -142,13 +142,13 @@ mod tests {
|
|||
let mut output = String::new();
|
||||
process_documentation(
|
||||
"
|
||||
See also [`mccabe.max-complexity`] and [`task-tags`].
|
||||
See also [`lint.mccabe.max-complexity`] and [`lint.task-tags`].
|
||||
Something [`else`][other].
|
||||
|
||||
## Options
|
||||
|
||||
- `task-tags`
|
||||
- `mccabe.max-complexity`
|
||||
- `lint.task-tags`
|
||||
- `lint.mccabe.max-complexity`
|
||||
|
||||
[other]: http://example.com.",
|
||||
&mut output,
|
||||
|
@ -157,18 +157,18 @@ Something [`else`][other].
|
|||
assert_eq!(
|
||||
output,
|
||||
"
|
||||
See also [`mccabe.max-complexity`][mccabe.max-complexity] and [`task-tags`][task-tags].
|
||||
See also [`lint.mccabe.max-complexity`][lint.mccabe.max-complexity] and [`lint.task-tags`][lint.task-tags].
|
||||
Something [`else`][other].
|
||||
|
||||
## Options
|
||||
|
||||
- [`task-tags`][task-tags]
|
||||
- [`mccabe.max-complexity`][mccabe.max-complexity]
|
||||
- [`lint.task-tags`][lint.task-tags]
|
||||
- [`lint.mccabe.max-complexity`][lint.mccabe.max-complexity]
|
||||
|
||||
[other]: http://example.com.
|
||||
|
||||
[task-tags]: ../settings.md#task-tags
|
||||
[mccabe.max-complexity]: ../settings.md#mccabe-max-complexity
|
||||
[lint.task-tags]: ../settings.md#lint_task-tags
|
||||
[lint.mccabe.max-complexity]: ../settings.md#lint_mccabe_max-complexity
|
||||
"
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue