mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
Enable pycodestyle
rules under new "nursery" category (#4407)
This commit is contained in:
parent
39fa38cb35
commit
6b1062ccc3
12 changed files with 882 additions and 722 deletions
|
@ -43,6 +43,17 @@ pub(crate) fn main(args: &Args) -> Result<()> {
|
|||
output.push('\n');
|
||||
}
|
||||
|
||||
if rule.is_nursery() {
|
||||
output.push_str(&format!(
|
||||
r#"This rule is part of the **nursery**, a collection of newer lints that are
|
||||
still under development. As such, it must be enabled by explicitly selecting
|
||||
{}."#,
|
||||
rule.noqa_code()
|
||||
));
|
||||
output.push('\n');
|
||||
output.push('\n');
|
||||
}
|
||||
|
||||
process_documentation(explanation.trim(), &mut output);
|
||||
|
||||
let filename = PathBuf::from(ROOT_DIR)
|
||||
|
@ -116,7 +127,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_process_documentation() {
|
||||
let mut out = String::new();
|
||||
let mut output = String::new();
|
||||
process_documentation(
|
||||
"
|
||||
See also [`mccabe.max-complexity`].
|
||||
|
@ -127,10 +138,10 @@ Something [`else`][other].
|
|||
- `mccabe.max-complexity`
|
||||
|
||||
[other]: http://example.com.",
|
||||
&mut out,
|
||||
&mut output,
|
||||
);
|
||||
assert_eq!(
|
||||
out,
|
||||
output,
|
||||
"
|
||||
See also [`mccabe.max-complexity`][mccabe.max-complexity].
|
||||
Something [`else`][other].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue