mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:53 +00:00
Implement autofix for more docstring-related rules (#448)
This commit is contained in:
parent
118a9feec8
commit
206e6463be
46 changed files with 1378 additions and 919 deletions
12
README.md
12
README.md
|
@ -294,7 +294,7 @@ The 🛠 emoji indicates that a rule is automatically fixable by the `--fix` com
|
||||||
| D202 | NoBlankLineAfterFunction | No blank lines allowed after function docstring (found 1) | 🛠 |
|
| D202 | NoBlankLineAfterFunction | No blank lines allowed after function docstring (found 1) | 🛠 |
|
||||||
| D203 | OneBlankLineBeforeClass | 1 blank line required before class docstring | 🛠 |
|
| D203 | OneBlankLineBeforeClass | 1 blank line required before class docstring | 🛠 |
|
||||||
| D204 | OneBlankLineAfterClass | 1 blank line required after class docstring | 🛠 |
|
| D204 | OneBlankLineAfterClass | 1 blank line required after class docstring | 🛠 |
|
||||||
| D205 | NoBlankLineAfterSummary | 1 blank line required between summary line and description | 🛠 |
|
| D205 | BlankLineAfterSummary | 1 blank line required between summary line and description | 🛠 |
|
||||||
| D206 | IndentWithSpaces | Docstring should be indented with spaces, not tabs | |
|
| D206 | IndentWithSpaces | Docstring should be indented with spaces, not tabs | |
|
||||||
| D207 | NoUnderIndentation | Docstring is under-indented | |
|
| D207 | NoUnderIndentation | Docstring is under-indented | |
|
||||||
| D208 | NoOverIndentation | Docstring is over-indented | |
|
| D208 | NoOverIndentation | Docstring is over-indented | |
|
||||||
|
@ -304,7 +304,7 @@ The 🛠 emoji indicates that a rule is automatically fixable by the `--fix` com
|
||||||
| D212 | MultiLineSummaryFirstLine | Multi-line docstring summary should start at the first line | |
|
| D212 | MultiLineSummaryFirstLine | Multi-line docstring summary should start at the first line | |
|
||||||
| D213 | MultiLineSummarySecondLine | Multi-line docstring summary should start at the second line | |
|
| D213 | MultiLineSummarySecondLine | Multi-line docstring summary should start at the second line | |
|
||||||
| D214 | SectionNotOverIndented | Section is over-indented ("Returns") | |
|
| D214 | SectionNotOverIndented | Section is over-indented ("Returns") | |
|
||||||
| D215 | SectionUnderlineNotOverIndented | Section underline is over-indented ("Returns") | |
|
| D215 | SectionUnderlineNotOverIndented | Section underline is over-indented ("Returns") | 🛠 |
|
||||||
| D300 | UsesTripleQuotes | Use """triple double quotes""" | |
|
| D300 | UsesTripleQuotes | Use """triple double quotes""" | |
|
||||||
| D400 | EndsInPeriod | First line should end with a period | |
|
| D400 | EndsInPeriod | First line should end with a period | |
|
||||||
| D402 | NoSignature | First line should not be the function's 'signature' | |
|
| D402 | NoSignature | First line should not be the function's 'signature' | |
|
||||||
|
@ -312,12 +312,12 @@ The 🛠 emoji indicates that a rule is automatically fixable by the `--fix` com
|
||||||
| D404 | NoThisPrefix | First word of the docstring should not be `This` | |
|
| D404 | NoThisPrefix | First word of the docstring should not be `This` | |
|
||||||
| D405 | CapitalizeSectionName | Section name should be properly capitalized ("returns") | |
|
| D405 | CapitalizeSectionName | Section name should be properly capitalized ("returns") | |
|
||||||
| D406 | NewLineAfterSectionName | Section name should end with a newline ("Returns") | |
|
| D406 | NewLineAfterSectionName | Section name should end with a newline ("Returns") | |
|
||||||
| D407 | DashedUnderlineAfterSection | Missing dashed underline after section ("Returns") | |
|
| D407 | DashedUnderlineAfterSection | Missing dashed underline after section ("Returns") | 🛠 |
|
||||||
| D408 | SectionUnderlineAfterName | Section underline should be in the line following the section's name ("Returns") | |
|
| D408 | SectionUnderlineAfterName | Section underline should be in the line following the section's name ("Returns") | |
|
||||||
| D409 | SectionUnderlineMatchesSectionLength | Section underline should match the length of its name ("Returns") | |
|
| D409 | SectionUnderlineMatchesSectionLength | Section underline should match the length of its name ("Returns") | 🛠 |
|
||||||
| D410 | BlankLineAfterSection | Missing blank line after section ("Returns") | 🛠 |
|
| D410 | BlankLineAfterSection | Missing blank line after section ("Returns") | 🛠 |
|
||||||
| D411 | BlankLineBeforeSection | Missing blank line before section ("Returns") | |
|
| D411 | BlankLineBeforeSection | Missing blank line before section ("Returns") | 🛠 |
|
||||||
| D412 | NoBlankLinesBetweenHeaderAndContent | No blank lines allowed between a section header and its content ("Returns") | |
|
| D412 | NoBlankLinesBetweenHeaderAndContent | No blank lines allowed between a section header and its content ("Returns") | 🛠 |
|
||||||
| D413 | BlankLineAfterLastSection | Missing blank line after last section ("Returns") | 🛠 |
|
| D413 | BlankLineAfterLastSection | Missing blank line after last section ("Returns") | 🛠 |
|
||||||
| D414 | NonEmptySection | Section has no content ("Returns") | |
|
| D414 | NonEmptySection | Section has no content ("Returns") | |
|
||||||
| D415 | EndsInPunctuation | First line should end with a period, question mark, or exclamation point | |
|
| D415 | EndsInPunctuation | First line should end with a period, question mark, or exclamation point | |
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
use crate::autofix::Fix;
|
||||||
|
use crate::autofix::Patch;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use rustpython_parser::ast::Location;
|
use rustpython_parser::ast::Location;
|
||||||
|
use std::collections::BTreeSet;
|
||||||
|
|
||||||
use crate::checks::{Check, Fix};
|
use crate::checks::Check;
|
||||||
|
|
||||||
#[derive(Hash)]
|
#[derive(Hash)]
|
||||||
pub enum Mode {
|
pub enum Mode {
|
||||||
|
@ -35,34 +38,44 @@ pub fn fix_file(checks: &mut [Check], contents: &str) -> Option<String> {
|
||||||
fn apply_fixes<'a>(fixes: impl Iterator<Item = &'a mut Fix>, contents: &str) -> String {
|
fn apply_fixes<'a>(fixes: impl Iterator<Item = &'a mut Fix>, contents: &str) -> String {
|
||||||
let lines: Vec<&str> = contents.lines().collect();
|
let lines: Vec<&str> = contents.lines().collect();
|
||||||
|
|
||||||
let mut output = "".to_string();
|
let mut output: String = Default::default();
|
||||||
let mut last_pos: Location = Location::new(0, 0);
|
let mut last_pos: Location = Default::default();
|
||||||
|
let mut applied: BTreeSet<&Patch> = Default::default();
|
||||||
|
|
||||||
for fix in fixes.sorted_by_key(|fix| fix.location) {
|
for fix in fixes.sorted_by_key(|fix| fix.patch.location) {
|
||||||
// Best-effort approach: if this fix overlaps with a fix we've already applied, skip it.
|
// If we already applied an identical fix as part of another correction, skip any
|
||||||
if last_pos > fix.location {
|
// re-application.
|
||||||
|
if applied.contains(&fix.patch) {
|
||||||
|
fix.applied = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if fix.location.row() > last_pos.row() {
|
// Best-effort approach: if this fix overlaps with a fix we've already applied, skip it.
|
||||||
|
if last_pos > fix.patch.location {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if fix.patch.location.row() > last_pos.row() {
|
||||||
if last_pos.row() > 0 || last_pos.column() > 0 {
|
if last_pos.row() > 0 || last_pos.column() > 0 {
|
||||||
output.push_str(&lines[last_pos.row() - 1][last_pos.column() - 1..]);
|
output.push_str(&lines[last_pos.row() - 1][last_pos.column() - 1..]);
|
||||||
output.push('\n');
|
output.push('\n');
|
||||||
}
|
}
|
||||||
for line in &lines[last_pos.row()..fix.location.row() - 1] {
|
for line in &lines[last_pos.row()..fix.patch.location.row() - 1] {
|
||||||
output.push_str(line);
|
output.push_str(line);
|
||||||
output.push('\n');
|
output.push('\n');
|
||||||
}
|
}
|
||||||
output.push_str(&lines[fix.location.row() - 1][..fix.location.column() - 1]);
|
output
|
||||||
output.push_str(&fix.content);
|
.push_str(&lines[fix.patch.location.row() - 1][..fix.patch.location.column() - 1]);
|
||||||
|
output.push_str(&fix.patch.content);
|
||||||
} else {
|
} else {
|
||||||
output.push_str(
|
output.push_str(
|
||||||
&lines[last_pos.row() - 1][last_pos.column() - 1..fix.location.column() - 1],
|
&lines[last_pos.row() - 1][last_pos.column() - 1..fix.patch.location.column() - 1],
|
||||||
);
|
);
|
||||||
output.push_str(&fix.content);
|
output.push_str(&fix.patch.content);
|
||||||
}
|
}
|
||||||
|
last_pos = fix.patch.end_location;
|
||||||
|
|
||||||
last_pos = fix.end_location;
|
applied.insert(&fix.patch);
|
||||||
fix.applied = true;
|
fix.applied = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +102,8 @@ mod tests {
|
||||||
use rustpython_parser::ast::Location;
|
use rustpython_parser::ast::Location;
|
||||||
|
|
||||||
use crate::autofix::fixer::apply_fixes;
|
use crate::autofix::fixer::apply_fixes;
|
||||||
use crate::checks::Fix;
|
use crate::autofix::Fix;
|
||||||
|
use crate::autofix::Patch;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn empty_file() -> Result<()> {
|
fn empty_file() -> Result<()> {
|
||||||
|
@ -105,9 +119,11 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn apply_single_replacement() -> Result<()> {
|
fn apply_single_replacement() -> Result<()> {
|
||||||
let mut fixes = vec![Fix {
|
let mut fixes = vec![Fix {
|
||||||
|
patch: Patch {
|
||||||
content: "Bar".to_string(),
|
content: "Bar".to_string(),
|
||||||
location: Location::new(1, 9),
|
location: Location::new(1, 9),
|
||||||
end_location: Location::new(1, 15),
|
end_location: Location::new(1, 15),
|
||||||
|
},
|
||||||
applied: false,
|
applied: false,
|
||||||
}];
|
}];
|
||||||
let actual = apply_fixes(
|
let actual = apply_fixes(
|
||||||
|
@ -129,9 +145,11 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn apply_single_removal() -> Result<()> {
|
fn apply_single_removal() -> Result<()> {
|
||||||
let mut fixes = vec![Fix {
|
let mut fixes = vec![Fix {
|
||||||
|
patch: Patch {
|
||||||
content: "".to_string(),
|
content: "".to_string(),
|
||||||
location: Location::new(1, 8),
|
location: Location::new(1, 8),
|
||||||
end_location: Location::new(1, 16),
|
end_location: Location::new(1, 16),
|
||||||
|
},
|
||||||
applied: false,
|
applied: false,
|
||||||
}];
|
}];
|
||||||
let actual = apply_fixes(
|
let actual = apply_fixes(
|
||||||
|
@ -154,15 +172,19 @@ mod tests {
|
||||||
fn apply_double_removal() -> Result<()> {
|
fn apply_double_removal() -> Result<()> {
|
||||||
let mut fixes = vec![
|
let mut fixes = vec![
|
||||||
Fix {
|
Fix {
|
||||||
|
patch: Patch {
|
||||||
content: "".to_string(),
|
content: "".to_string(),
|
||||||
location: Location::new(1, 8),
|
location: Location::new(1, 8),
|
||||||
end_location: Location::new(1, 17),
|
end_location: Location::new(1, 17),
|
||||||
|
},
|
||||||
applied: false,
|
applied: false,
|
||||||
},
|
},
|
||||||
Fix {
|
Fix {
|
||||||
|
patch: Patch {
|
||||||
content: "".to_string(),
|
content: "".to_string(),
|
||||||
location: Location::new(1, 17),
|
location: Location::new(1, 17),
|
||||||
end_location: Location::new(1, 24),
|
end_location: Location::new(1, 24),
|
||||||
|
},
|
||||||
applied: false,
|
applied: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -186,15 +208,19 @@ mod tests {
|
||||||
fn ignore_overlapping_fixes() -> Result<()> {
|
fn ignore_overlapping_fixes() -> Result<()> {
|
||||||
let mut fixes = vec![
|
let mut fixes = vec![
|
||||||
Fix {
|
Fix {
|
||||||
|
patch: Patch {
|
||||||
content: "".to_string(),
|
content: "".to_string(),
|
||||||
location: Location::new(1, 8),
|
location: Location::new(1, 8),
|
||||||
end_location: Location::new(1, 16),
|
end_location: Location::new(1, 16),
|
||||||
|
},
|
||||||
applied: false,
|
applied: false,
|
||||||
},
|
},
|
||||||
Fix {
|
Fix {
|
||||||
|
patch: Patch {
|
||||||
content: "ignored".to_string(),
|
content: "ignored".to_string(),
|
||||||
location: Location::new(1, 10),
|
location: Location::new(1, 10),
|
||||||
end_location: Location::new(1, 12),
|
end_location: Location::new(1, 12),
|
||||||
|
},
|
||||||
applied: false,
|
applied: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -9,7 +9,7 @@ use rustpython_parser::token::Tok;
|
||||||
|
|
||||||
use crate::ast::operations::SourceCodeLocator;
|
use crate::ast::operations::SourceCodeLocator;
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
use crate::checks::Fix;
|
use crate::autofix::Fix;
|
||||||
|
|
||||||
/// Convert a location within a file (relative to `base`) to an absolute position.
|
/// Convert a location within a file (relative to `base`) to an absolute position.
|
||||||
fn to_absolute(relative: &Location, base: &Location) -> Location {
|
fn to_absolute(relative: &Location, base: &Location) -> Location {
|
||||||
|
@ -56,12 +56,7 @@ pub fn remove_class_def_base(
|
||||||
}
|
}
|
||||||
|
|
||||||
return match (fix_start, fix_end) {
|
return match (fix_start, fix_end) {
|
||||||
(Some(start), Some(end)) => Some(Fix {
|
(Some(start), Some(end)) => Some(Fix::replacement("".to_string(), start, end)),
|
||||||
content: "".to_string(),
|
|
||||||
location: start,
|
|
||||||
end_location: end,
|
|
||||||
applied: false,
|
|
||||||
}),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -95,12 +90,7 @@ pub fn remove_class_def_base(
|
||||||
}
|
}
|
||||||
|
|
||||||
match (fix_start, fix_end) {
|
match (fix_start, fix_end) {
|
||||||
(Some(start), Some(end)) => Some(Fix {
|
(Some(start), Some(end)) => Some(Fix::replacement("".to_string(), start, end)),
|
||||||
content: "".to_string(),
|
|
||||||
location: start,
|
|
||||||
end_location: end,
|
|
||||||
applied: false,
|
|
||||||
}),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -120,12 +110,7 @@ pub fn remove_class_def_base(
|
||||||
}
|
}
|
||||||
|
|
||||||
match (fix_start, fix_end) {
|
match (fix_start, fix_end) {
|
||||||
(Some(start), Some(end)) => Some(Fix {
|
(Some(start), Some(end)) => Some(Fix::replacement("".to_string(), start, end)),
|
||||||
content: "".to_string(),
|
|
||||||
location: start,
|
|
||||||
end_location: end,
|
|
||||||
applied: false,
|
|
||||||
}),
|
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,12 +135,11 @@ pub fn remove_super_arguments(locator: &mut SourceCodeLocator, expr: &Expr) -> O
|
||||||
let mut state = Default::default();
|
let mut state = Default::default();
|
||||||
tree.codegen(&mut state);
|
tree.codegen(&mut state);
|
||||||
|
|
||||||
return Some(Fix {
|
return Some(Fix::replacement(
|
||||||
content: state.to_string(),
|
state.to_string(),
|
||||||
location: range.location,
|
range.location,
|
||||||
end_location: range.end_location,
|
range.end_location,
|
||||||
applied: false,
|
));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,21 +216,18 @@ pub fn remove_stmt(stmt: &Stmt, parent: Option<&Stmt>, deleted: &[&Stmt]) -> Res
|
||||||
{
|
{
|
||||||
// If removing this node would lead to an invalid syntax tree, replace
|
// If removing this node would lead to an invalid syntax tree, replace
|
||||||
// it with a `pass`.
|
// it with a `pass`.
|
||||||
Ok(Fix {
|
Ok(Fix::replacement(
|
||||||
location: stmt.location,
|
"pass".to_string(),
|
||||||
end_location: stmt.end_location.unwrap(),
|
stmt.location,
|
||||||
content: "pass".to_string(),
|
stmt.end_location.unwrap(),
|
||||||
applied: false,
|
))
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, nuke the entire line.
|
// Otherwise, nuke the entire line.
|
||||||
// TODO(charlie): This logic assumes that there are no multi-statement physical lines.
|
// TODO(charlie): This logic assumes that there are no multi-statement physical lines.
|
||||||
Ok(Fix {
|
Ok(Fix::deletion(
|
||||||
location: Location::new(stmt.location.row(), 1),
|
Location::new(stmt.location.row(), 1),
|
||||||
end_location: Location::new(stmt.end_location.unwrap().row() + 1, 1),
|
Location::new(stmt.end_location.unwrap().row() + 1, 1),
|
||||||
content: "".to_string(),
|
))
|
||||||
applied: false,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,12 +288,11 @@ pub fn remove_unused_imports(
|
||||||
let mut state = Default::default();
|
let mut state = Default::default();
|
||||||
tree.codegen(&mut state);
|
tree.codegen(&mut state);
|
||||||
|
|
||||||
Ok(Fix {
|
Ok(Fix::replacement(
|
||||||
content: state.to_string(),
|
state.to_string(),
|
||||||
location: stmt.location,
|
stmt.location,
|
||||||
end_location: stmt.end_location.unwrap(),
|
stmt.end_location.unwrap(),
|
||||||
applied: false,
|
))
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,11 +362,10 @@ pub fn remove_unused_import_froms(
|
||||||
let mut state = Default::default();
|
let mut state = Default::default();
|
||||||
tree.codegen(&mut state);
|
tree.codegen(&mut state);
|
||||||
|
|
||||||
Ok(Fix {
|
Ok(Fix::replacement(
|
||||||
content: state.to_string(),
|
state.to_string(),
|
||||||
location: stmt.location,
|
stmt.location,
|
||||||
end_location: stmt.end_location.unwrap(),
|
stmt.end_location.unwrap(),
|
||||||
applied: false,
|
))
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,53 @@
|
||||||
|
use rustpython_ast::Location;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub mod fixer;
|
pub mod fixer;
|
||||||
pub mod fixes;
|
pub mod fixes;
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
||||||
|
pub struct Patch {
|
||||||
|
pub content: String,
|
||||||
|
pub location: Location,
|
||||||
|
pub end_location: Location,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
|
pub struct Fix {
|
||||||
|
pub patch: Patch,
|
||||||
|
pub applied: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Fix {
|
||||||
|
pub fn deletion(start: Location, end: Location) -> Self {
|
||||||
|
Self {
|
||||||
|
patch: Patch {
|
||||||
|
content: "".to_string(),
|
||||||
|
location: start,
|
||||||
|
end_location: end,
|
||||||
|
},
|
||||||
|
applied: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn replacement(content: String, start: Location, end: Location) -> Self {
|
||||||
|
Self {
|
||||||
|
patch: Patch {
|
||||||
|
content,
|
||||||
|
location: start,
|
||||||
|
end_location: end,
|
||||||
|
},
|
||||||
|
applied: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn insertion(content: String, at: Location) -> Self {
|
||||||
|
Self {
|
||||||
|
patch: Patch {
|
||||||
|
content,
|
||||||
|
location: at,
|
||||||
|
end_location: at,
|
||||||
|
},
|
||||||
|
applied: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@ use rustpython_parser::ast::Location;
|
||||||
|
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
use crate::checks::{Check, CheckCode, CheckKind, Fix};
|
use crate::autofix::Fix;
|
||||||
|
use crate::checks::{Check, CheckCode, CheckKind};
|
||||||
use crate::noqa;
|
use crate::noqa;
|
||||||
use crate::noqa::Directive;
|
use crate::noqa::Directive;
|
||||||
use crate::settings::Settings;
|
use crate::settings::Settings;
|
||||||
|
@ -166,15 +167,10 @@ pub fn check_lines(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if matches!(autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
check.amend(Fix {
|
check.amend(Fix::deletion(
|
||||||
content: "".to_string(),
|
Location::new(row + 1, start + 1),
|
||||||
location: Location::new(row + 1, start + 1),
|
Location::new(row + 1, lines[row].chars().count() + 1),
|
||||||
end_location: Location::new(
|
));
|
||||||
row + 1,
|
|
||||||
lines[row].chars().count() + 1,
|
|
||||||
),
|
|
||||||
applied: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
line_checks.push(check);
|
line_checks.push(check);
|
||||||
}
|
}
|
||||||
|
@ -200,25 +196,16 @@ pub fn check_lines(
|
||||||
);
|
);
|
||||||
if matches!(autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
if valid_codes.is_empty() {
|
if valid_codes.is_empty() {
|
||||||
check.amend(Fix {
|
check.amend(Fix::deletion(
|
||||||
content: "".to_string(),
|
Location::new(row + 1, start + 1),
|
||||||
location: Location::new(row + 1, start + 1),
|
Location::new(row + 1, lines[row].chars().count() + 1),
|
||||||
end_location: Location::new(
|
));
|
||||||
row + 1,
|
|
||||||
lines[row].chars().count() + 1,
|
|
||||||
),
|
|
||||||
applied: false,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content: format!(" # noqa: {}", valid_codes.join(", ")),
|
format!(" # noqa: {}", valid_codes.join(", ")),
|
||||||
location: Location::new(row + 1, start + 1),
|
Location::new(row + 1, start + 1),
|
||||||
end_location: Location::new(
|
Location::new(row + 1, lines[row].chars().count() + 1),
|
||||||
row + 1,
|
));
|
||||||
lines[row].chars().count() + 1,
|
|
||||||
),
|
|
||||||
applied: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line_checks.push(check);
|
line_checks.push(check);
|
||||||
|
|
|
@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize};
|
||||||
use strum_macros::{AsRefStr, EnumIter, EnumString};
|
use strum_macros::{AsRefStr, EnumIter, EnumString};
|
||||||
|
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::pyupgrade::types::Primitive;
|
use crate::pyupgrade::types::Primitive;
|
||||||
|
|
||||||
#[derive(
|
#[derive(
|
||||||
|
@ -293,6 +294,7 @@ pub enum CheckKind {
|
||||||
// pydocstyle
|
// pydocstyle
|
||||||
BlankLineAfterLastSection(String),
|
BlankLineAfterLastSection(String),
|
||||||
BlankLineAfterSection(String),
|
BlankLineAfterSection(String),
|
||||||
|
BlankLineAfterSummary,
|
||||||
BlankLineBeforeSection(String),
|
BlankLineBeforeSection(String),
|
||||||
CapitalizeSectionName(String),
|
CapitalizeSectionName(String),
|
||||||
DashedUnderlineAfterSection(String),
|
DashedUnderlineAfterSection(String),
|
||||||
|
@ -308,7 +310,6 @@ pub enum CheckKind {
|
||||||
NewLineAfterLastParagraph,
|
NewLineAfterLastParagraph,
|
||||||
NewLineAfterSectionName(String),
|
NewLineAfterSectionName(String),
|
||||||
NoBlankLineAfterFunction(usize),
|
NoBlankLineAfterFunction(usize),
|
||||||
NoBlankLineAfterSummary,
|
|
||||||
NoBlankLineBeforeClass(usize),
|
NoBlankLineBeforeClass(usize),
|
||||||
NoBlankLineBeforeFunction(usize),
|
NoBlankLineBeforeFunction(usize),
|
||||||
NoBlankLinesBetweenHeaderAndContent(String),
|
NoBlankLinesBetweenHeaderAndContent(String),
|
||||||
|
@ -473,7 +474,7 @@ impl CheckCode {
|
||||||
CheckCode::D202 => CheckKind::NoBlankLineAfterFunction(1),
|
CheckCode::D202 => CheckKind::NoBlankLineAfterFunction(1),
|
||||||
CheckCode::D203 => CheckKind::OneBlankLineBeforeClass(0),
|
CheckCode::D203 => CheckKind::OneBlankLineBeforeClass(0),
|
||||||
CheckCode::D204 => CheckKind::OneBlankLineAfterClass(0),
|
CheckCode::D204 => CheckKind::OneBlankLineAfterClass(0),
|
||||||
CheckCode::D205 => CheckKind::NoBlankLineAfterSummary,
|
CheckCode::D205 => CheckKind::BlankLineAfterSummary,
|
||||||
CheckCode::D206 => CheckKind::IndentWithSpaces,
|
CheckCode::D206 => CheckKind::IndentWithSpaces,
|
||||||
CheckCode::D207 => CheckKind::NoUnderIndentation,
|
CheckCode::D207 => CheckKind::NoUnderIndentation,
|
||||||
CheckCode::D208 => CheckKind::NoOverIndentation,
|
CheckCode::D208 => CheckKind::NoOverIndentation,
|
||||||
|
@ -756,7 +757,7 @@ impl CheckKind {
|
||||||
CheckKind::NewLineAfterLastParagraph => &CheckCode::D209,
|
CheckKind::NewLineAfterLastParagraph => &CheckCode::D209,
|
||||||
CheckKind::NewLineAfterSectionName(_) => &CheckCode::D406,
|
CheckKind::NewLineAfterSectionName(_) => &CheckCode::D406,
|
||||||
CheckKind::NoBlankLineAfterFunction(_) => &CheckCode::D202,
|
CheckKind::NoBlankLineAfterFunction(_) => &CheckCode::D202,
|
||||||
CheckKind::NoBlankLineAfterSummary => &CheckCode::D205,
|
CheckKind::BlankLineAfterSummary => &CheckCode::D205,
|
||||||
CheckKind::NoBlankLineBeforeClass(_) => &CheckCode::D211,
|
CheckKind::NoBlankLineBeforeClass(_) => &CheckCode::D211,
|
||||||
CheckKind::NoBlankLineBeforeFunction(_) => &CheckCode::D201,
|
CheckKind::NoBlankLineBeforeFunction(_) => &CheckCode::D201,
|
||||||
CheckKind::NoBlankLinesBetweenHeaderAndContent(_) => &CheckCode::D412,
|
CheckKind::NoBlankLinesBetweenHeaderAndContent(_) => &CheckCode::D412,
|
||||||
|
@ -1053,7 +1054,7 @@ impl CheckKind {
|
||||||
}
|
}
|
||||||
// pydocstyle
|
// pydocstyle
|
||||||
CheckKind::FitsOnOneLine => "One-line docstring should fit on one line".to_string(),
|
CheckKind::FitsOnOneLine => "One-line docstring should fit on one line".to_string(),
|
||||||
CheckKind::NoBlankLineAfterSummary => {
|
CheckKind::BlankLineAfterSummary => {
|
||||||
"1 blank line required between summary line and description".to_string()
|
"1 blank line required between summary line and description".to_string()
|
||||||
}
|
}
|
||||||
CheckKind::NewLineAfterLastParagraph => {
|
CheckKind::NewLineAfterLastParagraph => {
|
||||||
|
@ -1205,19 +1206,24 @@ impl CheckKind {
|
||||||
self,
|
self,
|
||||||
CheckKind::BlankLineAfterLastSection(_)
|
CheckKind::BlankLineAfterLastSection(_)
|
||||||
| CheckKind::BlankLineAfterSection(_)
|
| CheckKind::BlankLineAfterSection(_)
|
||||||
|
| CheckKind::BlankLineAfterSummary
|
||||||
|
| CheckKind::BlankLineBeforeSection(_)
|
||||||
|
| CheckKind::DashedUnderlineAfterSection(_)
|
||||||
| CheckKind::DeprecatedUnittestAlias(_, _)
|
| CheckKind::DeprecatedUnittestAlias(_, _)
|
||||||
| CheckKind::DoNotAssertFalse
|
| CheckKind::DoNotAssertFalse
|
||||||
| CheckKind::DuplicateHandlerException(_)
|
| CheckKind::DuplicateHandlerException(_)
|
||||||
| CheckKind::NewLineAfterLastParagraph
|
| CheckKind::NewLineAfterLastParagraph
|
||||||
| CheckKind::NoBlankLineAfterFunction(_)
|
| CheckKind::NoBlankLineAfterFunction(_)
|
||||||
| CheckKind::NoBlankLineAfterSummary
|
|
||||||
| CheckKind::NoBlankLineBeforeClass(_)
|
| CheckKind::NoBlankLineBeforeClass(_)
|
||||||
| CheckKind::NoBlankLineBeforeFunction(_)
|
| CheckKind::NoBlankLineBeforeFunction(_)
|
||||||
|
| CheckKind::NoBlankLinesBetweenHeaderAndContent(_)
|
||||||
| CheckKind::NoSurroundingWhitespace
|
| CheckKind::NoSurroundingWhitespace
|
||||||
| CheckKind::OneBlankLineAfterClass(_)
|
| CheckKind::OneBlankLineAfterClass(_)
|
||||||
| CheckKind::OneBlankLineBeforeClass(_)
|
| CheckKind::OneBlankLineBeforeClass(_)
|
||||||
| CheckKind::PPrintFound
|
| CheckKind::PPrintFound
|
||||||
| CheckKind::PrintFound
|
| CheckKind::PrintFound
|
||||||
|
| CheckKind::SectionUnderlineMatchesSectionLength(_)
|
||||||
|
| CheckKind::SectionUnderlineNotOverIndented(_)
|
||||||
| CheckKind::SuperCallWithParameters
|
| CheckKind::SuperCallWithParameters
|
||||||
| CheckKind::TypeOfPrimitive(_)
|
| CheckKind::TypeOfPrimitive(_)
|
||||||
| CheckKind::UnnecessaryAbspath
|
| CheckKind::UnnecessaryAbspath
|
||||||
|
@ -1231,43 +1237,6 @@ impl CheckKind {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
||||||
pub struct Fix {
|
|
||||||
pub content: String,
|
|
||||||
pub location: Location,
|
|
||||||
pub end_location: Location,
|
|
||||||
pub applied: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Fix {
|
|
||||||
pub fn deletion(start: Location, end: Location) -> Self {
|
|
||||||
Self {
|
|
||||||
content: "".to_string(),
|
|
||||||
location: start,
|
|
||||||
end_location: end,
|
|
||||||
applied: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn replacement(content: String, start: Location, end: Location) -> Self {
|
|
||||||
Self {
|
|
||||||
content,
|
|
||||||
location: start,
|
|
||||||
end_location: end,
|
|
||||||
applied: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn insertion(content: String, at: Location) -> Self {
|
|
||||||
Self {
|
|
||||||
content,
|
|
||||||
location: at,
|
|
||||||
end_location: at,
|
|
||||||
applied: false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct Check {
|
pub struct Check {
|
||||||
pub kind: CheckKind,
|
pub kind: CheckKind,
|
||||||
|
@ -1277,11 +1246,11 @@ pub struct Check {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Check {
|
impl Check {
|
||||||
pub fn new(kind: CheckKind, rage: Range) -> Self {
|
pub fn new(kind: CheckKind, range: Range) -> Self {
|
||||||
Self {
|
Self {
|
||||||
kind,
|
kind,
|
||||||
location: rage.location,
|
location: range.location,
|
||||||
end_location: rage.end_location,
|
end_location: range.end_location,
|
||||||
fix: None,
|
fix: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@ use rustpython_ast::{Constant, Expr, ExprContext, ExprKind, Stmt, StmtKind};
|
||||||
|
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::{Check, CheckKind, Fix};
|
use crate::checks::{Check, CheckKind};
|
||||||
use crate::code_gen::SourceGenerator;
|
use crate::code_gen::SourceGenerator;
|
||||||
|
|
||||||
fn assertion_error(msg: &Option<Box<Expr>>) -> Stmt {
|
fn assertion_error(msg: &Option<Box<Expr>>) -> Stmt {
|
||||||
|
@ -47,12 +48,11 @@ pub fn assert_false(checker: &mut Checker, stmt: &Stmt, test: &Expr, msg: &Optio
|
||||||
let mut generator = SourceGenerator::new();
|
let mut generator = SourceGenerator::new();
|
||||||
if let Ok(()) = generator.unparse_stmt(&assertion_error(msg)) {
|
if let Ok(()) = generator.unparse_stmt(&assertion_error(msg)) {
|
||||||
if let Ok(content) = generator.generate() {
|
if let Ok(content) = generator.generate() {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content,
|
content,
|
||||||
location: stmt.location,
|
stmt.location,
|
||||||
end_location: stmt.end_location.unwrap(),
|
stmt.end_location.unwrap(),
|
||||||
applied: false,
|
));
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,9 @@ use rustpython_ast::{Excepthandler, ExcepthandlerKind, Expr, ExprContext, ExprKi
|
||||||
use crate::ast::helpers;
|
use crate::ast::helpers;
|
||||||
use crate::ast::types::{CheckLocator, Range};
|
use crate::ast::types::{CheckLocator, Range};
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::{Check, CheckCode, CheckKind, Fix};
|
use crate::checks::{Check, CheckCode, CheckKind};
|
||||||
use crate::code_gen::SourceGenerator;
|
use crate::code_gen::SourceGenerator;
|
||||||
|
|
||||||
fn type_pattern(elts: Vec<&Expr>) -> Expr {
|
fn type_pattern(elts: Vec<&Expr>) -> Expr {
|
||||||
|
@ -54,12 +55,11 @@ pub fn duplicate_handler_exceptions(
|
||||||
let mut generator = SourceGenerator::new();
|
let mut generator = SourceGenerator::new();
|
||||||
if let Ok(()) = generator.unparse_expr(&type_pattern(unique_elts), 0) {
|
if let Ok(()) = generator.unparse_expr(&type_pattern(unique_elts), 0) {
|
||||||
if let Ok(content) = generator.generate() {
|
if let Ok(content) = generator.generate() {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content,
|
content,
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
))
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ pub fn print_call(checker: &mut Checker, expr: &Expr, func: &Expr) {
|
||||||
&deleted,
|
&deleted,
|
||||||
) {
|
) {
|
||||||
Ok(fix) => {
|
Ok(fix) => {
|
||||||
if fix.content.is_empty() || fix.content == "pass" {
|
if fix.patch.content.is_empty() || fix.patch.content == "pass" {
|
||||||
checker.deletions.insert(context.defined_by);
|
checker.deletions.insert(context.defined_by);
|
||||||
}
|
}
|
||||||
check.amend(fix)
|
check.amend(fix)
|
||||||
|
|
|
@ -8,8 +8,9 @@ use titlecase::titlecase;
|
||||||
|
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::{Check, CheckCode, CheckKind, Fix};
|
use crate::checks::{Check, CheckCode, CheckKind};
|
||||||
use crate::docstrings::definition::{Definition, DefinitionKind};
|
use crate::docstrings::definition::{Definition, DefinitionKind};
|
||||||
use crate::docstrings::helpers;
|
use crate::docstrings::helpers;
|
||||||
use crate::docstrings::sections::{section_contexts, SectionContext};
|
use crate::docstrings::sections::{section_contexts, SectionContext};
|
||||||
|
@ -180,6 +181,7 @@ pub fn blank_before_after_function(checker: &mut Checker, definition: &Definitio
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Delete the blank line before the docstring.
|
||||||
check.amend(Fix::deletion(
|
check.amend(Fix::deletion(
|
||||||
Location::new(docstring.location.row() - blank_lines_before, 1),
|
Location::new(docstring.location.row() - blank_lines_before, 1),
|
||||||
Location::new(docstring.location.row(), 1),
|
Location::new(docstring.location.row(), 1),
|
||||||
|
@ -217,6 +219,7 @@ pub fn blank_before_after_function(checker: &mut Checker, definition: &Definitio
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Delete the blank line after the docstring.
|
||||||
check.amend(Fix::deletion(
|
check.amend(Fix::deletion(
|
||||||
Location::new(
|
Location::new(
|
||||||
docstring.location.row() + 1 + expected_blank_lines_after,
|
docstring.location.row() + 1 + expected_blank_lines_after,
|
||||||
|
@ -266,6 +269,7 @@ pub fn blank_before_after_class(checker: &mut Checker, definition: &Definition)
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply)
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply)
|
||||||
{
|
{
|
||||||
|
// Delete the blank line before the class.
|
||||||
check.amend(Fix::deletion(
|
check.amend(Fix::deletion(
|
||||||
Location::new(docstring.location.row() - blank_lines_before, 1),
|
Location::new(docstring.location.row() - blank_lines_before, 1),
|
||||||
Location::new(docstring.location.row(), 1),
|
Location::new(docstring.location.row(), 1),
|
||||||
|
@ -282,6 +286,7 @@ pub fn blank_before_after_class(checker: &mut Checker, definition: &Definition)
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply)
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply)
|
||||||
{
|
{
|
||||||
|
// Insert one blank line before the class.
|
||||||
check.amend(Fix::replacement(
|
check.amend(Fix::replacement(
|
||||||
"\n".to_string(),
|
"\n".to_string(),
|
||||||
Location::new(docstring.location.row() - blank_lines_before, 1),
|
Location::new(docstring.location.row() - blank_lines_before, 1),
|
||||||
|
@ -313,6 +318,7 @@ pub fn blank_before_after_class(checker: &mut Checker, definition: &Definition)
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Insert a blank line before the class (replacing any existing lines).
|
||||||
check.amend(Fix::replacement(
|
check.amend(Fix::replacement(
|
||||||
"\n".to_string(),
|
"\n".to_string(),
|
||||||
Location::new(docstring.end_location.unwrap().row() + 1, 1),
|
Location::new(docstring.end_location.unwrap().row() + 1, 1),
|
||||||
|
@ -350,10 +356,11 @@ pub fn blank_after_summary(checker: &mut Checker, definition: &Definition) {
|
||||||
}
|
}
|
||||||
if lines_count > 1 && blanks_count != 1 {
|
if lines_count > 1 && blanks_count != 1 {
|
||||||
let mut check = Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::NoBlankLineAfterSummary,
|
CheckKind::BlankLineAfterSummary,
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Insert one blank line after the summary (replacing any existing lines).
|
||||||
check.amend(Fix::replacement(
|
check.amend(Fix::replacement(
|
||||||
"\n".to_string(),
|
"\n".to_string(),
|
||||||
Location::new(docstring.location.row() + 1, 1),
|
Location::new(docstring.location.row() + 1, 1),
|
||||||
|
@ -845,11 +852,23 @@ fn blanks_and_section_underline(
|
||||||
// Nothing but blank lines after the section header.
|
// Nothing but blank lines after the section header.
|
||||||
if blank_lines_after_header == context.following_lines.len() {
|
if blank_lines_after_header == context.following_lines.len() {
|
||||||
if checker.settings.enabled.contains(&CheckCode::D407) {
|
if checker.settings.enabled.contains(&CheckCode::D407) {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::DashedUnderlineAfterSection(context.section_name.to_string()),
|
CheckKind::DashedUnderlineAfterSection(context.section_name.to_string()),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Add a dashed line (of the appropriate length) under the section header.
|
||||||
|
let mut content = "".to_string();
|
||||||
|
content.push_str(helpers::indentation(checker, docstring));
|
||||||
|
content.push_str(&"-".repeat(context.section_name.len()));
|
||||||
|
content.push('\n');
|
||||||
|
check.amend(Fix::insertion(
|
||||||
|
content,
|
||||||
|
Location::new(docstring.location.row() + context.original_index + 1, 1),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
checker.add_check(check);
|
||||||
|
}
|
||||||
if checker.settings.enabled.contains(&CheckCode::D414) {
|
if checker.settings.enabled.contains(&CheckCode::D414) {
|
||||||
checker.add_check(Check::new(
|
checker.add_check(Check::new(
|
||||||
CheckKind::NonEmptySection(context.section_name.to_string()),
|
CheckKind::NonEmptySection(context.section_name.to_string()),
|
||||||
|
@ -866,29 +885,69 @@ fn blanks_and_section_underline(
|
||||||
|
|
||||||
if !dash_line_found {
|
if !dash_line_found {
|
||||||
if checker.settings.enabled.contains(&CheckCode::D407) {
|
if checker.settings.enabled.contains(&CheckCode::D407) {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::DashedUnderlineAfterSection(context.section_name.to_string()),
|
CheckKind::DashedUnderlineAfterSection(context.section_name.to_string()),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Add a dashed line (of the appropriate length) under the section header.
|
||||||
|
let mut content = "".to_string();
|
||||||
|
content.push_str(helpers::indentation(checker, docstring));
|
||||||
|
content.push_str(&"-".repeat(context.section_name.len()));
|
||||||
|
content.push('\n');
|
||||||
|
check.amend(Fix::insertion(
|
||||||
|
content,
|
||||||
|
Location::new(docstring.location.row() + context.original_index + 1, 1),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
checker.add_check(check);
|
||||||
|
}
|
||||||
if blank_lines_after_header > 0 {
|
if blank_lines_after_header > 0 {
|
||||||
if checker.settings.enabled.contains(&CheckCode::D212) {
|
if checker.settings.enabled.contains(&CheckCode::D412) {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::NoBlankLinesBetweenHeaderAndContent(
|
CheckKind::NoBlankLinesBetweenHeaderAndContent(
|
||||||
context.section_name.to_string(),
|
context.section_name.to_string(),
|
||||||
),
|
),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Delete any blank lines between the header and content.
|
||||||
|
check.amend(Fix::deletion(
|
||||||
|
Location::new(docstring.location.row() + context.original_index + 1, 1),
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ blank_lines_after_header,
|
||||||
|
1,
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
checker.add_check(check);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if blank_lines_after_header > 0 {
|
if blank_lines_after_header > 0 {
|
||||||
if checker.settings.enabled.contains(&CheckCode::D408) {
|
if checker.settings.enabled.contains(&CheckCode::D408) {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::SectionUnderlineAfterName(context.section_name.to_string()),
|
CheckKind::SectionUnderlineAfterName(context.section_name.to_string()),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Delete any blank lines between the header and the underline.
|
||||||
|
check.amend(Fix::deletion(
|
||||||
|
Location::new(docstring.location.row() + context.original_index + 1, 1),
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ blank_lines_after_header,
|
||||||
|
1,
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
checker.add_check(check);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if non_empty_line
|
if non_empty_line
|
||||||
|
@ -899,23 +958,70 @@ fn blanks_and_section_underline(
|
||||||
!= context.section_name.len()
|
!= context.section_name.len()
|
||||||
{
|
{
|
||||||
if checker.settings.enabled.contains(&CheckCode::D409) {
|
if checker.settings.enabled.contains(&CheckCode::D409) {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::SectionUnderlineMatchesSectionLength(
|
CheckKind::SectionUnderlineMatchesSectionLength(
|
||||||
context.section_name.to_string(),
|
context.section_name.to_string(),
|
||||||
),
|
),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Replace the existing underline with a line of the appropriate length.
|
||||||
|
let mut content = "".to_string();
|
||||||
|
content.push_str(helpers::indentation(checker, docstring));
|
||||||
|
content.push_str(&"-".repeat(context.section_name.len()));
|
||||||
|
content.push('\n');
|
||||||
|
check.amend(Fix::replacement(
|
||||||
|
content,
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ blank_lines_after_header,
|
||||||
|
1,
|
||||||
|
),
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ blank_lines_after_header
|
||||||
|
+ 1,
|
||||||
|
1,
|
||||||
|
),
|
||||||
));
|
));
|
||||||
|
};
|
||||||
|
checker.add_check(check);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if checker.settings.enabled.contains(&CheckCode::D215) {
|
if checker.settings.enabled.contains(&CheckCode::D215) {
|
||||||
if helpers::leading_space(non_empty_line).len()
|
let leading_space = helpers::leading_space(non_empty_line);
|
||||||
> helpers::indentation(checker, docstring).len()
|
let indentation = helpers::indentation(checker, docstring).to_string();
|
||||||
{
|
if leading_space.len() > indentation.len() {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::SectionUnderlineNotOverIndented(context.section_name.to_string()),
|
CheckKind::SectionUnderlineNotOverIndented(context.section_name.to_string()),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Replace the existing indentation with whitespace of the appropriate length.
|
||||||
|
check.amend(Fix::replacement(
|
||||||
|
indentation,
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ blank_lines_after_header,
|
||||||
|
1,
|
||||||
|
),
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ blank_lines_after_header,
|
||||||
|
1 + leading_space.len(),
|
||||||
|
),
|
||||||
));
|
));
|
||||||
|
};
|
||||||
|
checker.add_check(check);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -925,7 +1031,11 @@ fn blanks_and_section_underline(
|
||||||
let line_after_dashes = context.following_lines[line_after_dashes_index];
|
let line_after_dashes = context.following_lines[line_after_dashes_index];
|
||||||
if line_after_dashes.trim().is_empty() {
|
if line_after_dashes.trim().is_empty() {
|
||||||
let rest_of_lines = &context.following_lines[line_after_dashes_index..];
|
let rest_of_lines = &context.following_lines[line_after_dashes_index..];
|
||||||
if rest_of_lines.iter().all(|line| line.trim().is_empty()) {
|
let blank_lines_after_dashes = rest_of_lines
|
||||||
|
.iter()
|
||||||
|
.take_while(|line| line.trim().is_empty())
|
||||||
|
.count();
|
||||||
|
if blank_lines_after_dashes == rest_of_lines.len() {
|
||||||
if checker.settings.enabled.contains(&CheckCode::D414) {
|
if checker.settings.enabled.contains(&CheckCode::D414) {
|
||||||
checker.add_check(Check::new(
|
checker.add_check(Check::new(
|
||||||
CheckKind::NonEmptySection(context.section_name.to_string()),
|
CheckKind::NonEmptySection(context.section_name.to_string()),
|
||||||
|
@ -934,13 +1044,34 @@ fn blanks_and_section_underline(
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if checker.settings.enabled.contains(&CheckCode::D412) {
|
if checker.settings.enabled.contains(&CheckCode::D412) {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::NoBlankLinesBetweenHeaderAndContent(
|
CheckKind::NoBlankLinesBetweenHeaderAndContent(
|
||||||
context.section_name.to_string(),
|
context.section_name.to_string(),
|
||||||
),
|
),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Delete any blank lines between the header and content.
|
||||||
|
check.amend(Fix::deletion(
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ line_after_dashes_index,
|
||||||
|
1,
|
||||||
|
),
|
||||||
|
Location::new(
|
||||||
|
docstring.location.row()
|
||||||
|
+ context.original_index
|
||||||
|
+ 1
|
||||||
|
+ line_after_dashes_index
|
||||||
|
+ blank_lines_after_dashes,
|
||||||
|
1,
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
checker.add_check(check);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1003,6 +1134,7 @@ fn common_section(
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Add a newline after the section.
|
||||||
check.amend(Fix::insertion(
|
check.amend(Fix::insertion(
|
||||||
"\n".to_string(),
|
"\n".to_string(),
|
||||||
Location::new(
|
Location::new(
|
||||||
|
@ -1023,6 +1155,7 @@ fn common_section(
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Add a newline after the section.
|
||||||
check.amend(Fix::insertion(
|
check.amend(Fix::insertion(
|
||||||
"\n".to_string(),
|
"\n".to_string(),
|
||||||
Location::new(
|
Location::new(
|
||||||
|
@ -1032,7 +1165,7 @@ fn common_section(
|
||||||
+ context.following_lines.len(),
|
+ context.following_lines.len(),
|
||||||
1,
|
1,
|
||||||
),
|
),
|
||||||
))
|
));
|
||||||
}
|
}
|
||||||
checker.add_check(check);
|
checker.add_check(check);
|
||||||
}
|
}
|
||||||
|
@ -1041,10 +1174,18 @@ fn common_section(
|
||||||
|
|
||||||
if checker.settings.enabled.contains(&CheckCode::D411) {
|
if checker.settings.enabled.contains(&CheckCode::D411) {
|
||||||
if !context.previous_line.is_empty() {
|
if !context.previous_line.is_empty() {
|
||||||
checker.add_check(Check::new(
|
let mut check = Check::new(
|
||||||
CheckKind::BlankLineBeforeSection(context.section_name.to_string()),
|
CheckKind::BlankLineBeforeSection(context.section_name.to_string()),
|
||||||
Range::from_located(docstring),
|
Range::from_located(docstring),
|
||||||
))
|
);
|
||||||
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
|
// Add a blank line before the section.
|
||||||
|
check.amend(Fix::insertion(
|
||||||
|
"\n".to_string(),
|
||||||
|
Location::new(docstring.location.row() + context.original_index, 1),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
checker.add_check(check)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,9 @@ use rustpython_ast::{Expr, ExprKind};
|
||||||
|
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::{Check, CheckKind, Fix};
|
use crate::checks::{Check, CheckKind};
|
||||||
|
|
||||||
static DEPRECATED_ALIASES: Lazy<BTreeMap<&'static str, &'static str>> = Lazy::new(|| {
|
static DEPRECATED_ALIASES: Lazy<BTreeMap<&'static str, &'static str>> = Lazy::new(|| {
|
||||||
BTreeMap::from([
|
BTreeMap::from([
|
||||||
|
@ -38,12 +39,11 @@ pub fn deprecated_unittest_alias(checker: &mut Checker, expr: &Expr) {
|
||||||
Range::from_located(expr),
|
Range::from_located(expr),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content: format!("self.{}", target),
|
format!("self.{}", target),
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
checker.add_check(check);
|
checker.add_check(check);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@ use rustpython_ast::Expr;
|
||||||
|
|
||||||
use crate::ast::types::{CheckLocator, Range};
|
use crate::ast::types::{CheckLocator, Range};
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::{CheckKind, Fix};
|
use crate::checks::CheckKind;
|
||||||
use crate::pyupgrade::checks;
|
use crate::pyupgrade::checks;
|
||||||
|
|
||||||
pub fn type_of_primitive(checker: &mut Checker, expr: &Expr, func: &Expr, args: &[Expr]) {
|
pub fn type_of_primitive(checker: &mut Checker, expr: &Expr, func: &Expr, args: &[Expr]) {
|
||||||
|
@ -12,12 +13,11 @@ pub fn type_of_primitive(checker: &mut Checker, expr: &Expr, func: &Expr, args:
|
||||||
{
|
{
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
if let CheckKind::TypeOfPrimitive(primitive) = &check.kind {
|
if let CheckKind::TypeOfPrimitive(primitive) = &check.kind {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content: primitive.builtin(),
|
primitive.builtin(),
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checker.add_check(check);
|
checker.add_check(check);
|
||||||
|
|
|
@ -2,8 +2,8 @@ use rustpython_ast::Expr;
|
||||||
|
|
||||||
use crate::ast::types::{CheckLocator, Range};
|
use crate::ast::types::{CheckLocator, Range};
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::Fix;
|
|
||||||
use crate::pyupgrade::checks;
|
use crate::pyupgrade::checks;
|
||||||
|
|
||||||
pub fn unnecessary_abspath(checker: &mut Checker, expr: &Expr, func: &Expr, args: &[Expr]) {
|
pub fn unnecessary_abspath(checker: &mut Checker, expr: &Expr, func: &Expr, args: &[Expr]) {
|
||||||
|
@ -11,12 +11,11 @@ pub fn unnecessary_abspath(checker: &mut Checker, expr: &Expr, func: &Expr, args
|
||||||
checks::unnecessary_abspath(func, args, checker.locate_check(Range::from_located(expr)))
|
checks::unnecessary_abspath(func, args, checker.locate_check(Range::from_located(expr)))
|
||||||
{
|
{
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content: "__file__".to_string(),
|
"__file__".to_string(),
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
checker.add_check(check);
|
checker.add_check(check);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,9 @@ use rustpython_ast::Expr;
|
||||||
|
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::{Check, CheckKind, Fix};
|
use crate::checks::{Check, CheckKind};
|
||||||
use crate::python::typing;
|
use crate::python::typing;
|
||||||
|
|
||||||
pub fn use_pep585_annotation(checker: &mut Checker, expr: &Expr, id: &str) {
|
pub fn use_pep585_annotation(checker: &mut Checker, expr: &Expr, id: &str) {
|
||||||
|
@ -14,12 +15,11 @@ pub fn use_pep585_annotation(checker: &mut Checker, expr: &Expr, id: &str) {
|
||||||
Range::from_located(expr),
|
Range::from_located(expr),
|
||||||
);
|
);
|
||||||
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
if matches!(checker.autofix, fixer::Mode::Generate | fixer::Mode::Apply) {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content: id.to_lowercase(),
|
id.to_lowercase(),
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
));
|
||||||
})
|
|
||||||
}
|
}
|
||||||
checker.add_check(check);
|
checker.add_check(check);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,9 @@ use rustpython_ast::{Constant, Expr, ExprKind, Operator};
|
||||||
use crate::ast::helpers::match_name_or_attr;
|
use crate::ast::helpers::match_name_or_attr;
|
||||||
use crate::ast::types::Range;
|
use crate::ast::types::Range;
|
||||||
use crate::autofix::fixer;
|
use crate::autofix::fixer;
|
||||||
|
use crate::autofix::Fix;
|
||||||
use crate::check_ast::Checker;
|
use crate::check_ast::Checker;
|
||||||
use crate::checks::{Check, CheckKind, Fix};
|
use crate::checks::{Check, CheckKind};
|
||||||
use crate::code_gen::SourceGenerator;
|
use crate::code_gen::SourceGenerator;
|
||||||
|
|
||||||
fn optional(expr: &Expr) -> Expr {
|
fn optional(expr: &Expr) -> Expr {
|
||||||
|
@ -49,12 +50,11 @@ pub fn use_pep604_annotation(checker: &mut Checker, expr: &Expr, value: &Expr, s
|
||||||
let mut generator = SourceGenerator::new();
|
let mut generator = SourceGenerator::new();
|
||||||
if let Ok(()) = generator.unparse_expr(&optional(slice), 0) {
|
if let Ok(()) = generator.unparse_expr(&optional(slice), 0) {
|
||||||
if let Ok(content) = generator.generate() {
|
if let Ok(content) = generator.generate() {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content,
|
content,
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
))
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,12 +70,11 @@ pub fn use_pep604_annotation(checker: &mut Checker, expr: &Expr, value: &Expr, s
|
||||||
let mut generator = SourceGenerator::new();
|
let mut generator = SourceGenerator::new();
|
||||||
if let Ok(()) = generator.unparse_expr(&union(elts), 0) {
|
if let Ok(()) = generator.unparse_expr(&union(elts), 0) {
|
||||||
if let Ok(content) = generator.generate() {
|
if let Ok(content) = generator.generate() {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content,
|
content,
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
))
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,12 +83,11 @@ pub fn use_pep604_annotation(checker: &mut Checker, expr: &Expr, value: &Expr, s
|
||||||
let mut generator = SourceGenerator::new();
|
let mut generator = SourceGenerator::new();
|
||||||
if let Ok(()) = generator.unparse_expr(slice, 0) {
|
if let Ok(()) = generator.unparse_expr(slice, 0) {
|
||||||
if let Ok(content) = generator.generate() {
|
if let Ok(content) = generator.generate() {
|
||||||
check.amend(Fix {
|
check.amend(Fix::replacement(
|
||||||
content,
|
content,
|
||||||
location: expr.location,
|
expr.location,
|
||||||
end_location: expr.end_location.unwrap(),
|
expr.end_location.unwrap(),
|
||||||
applied: false,
|
));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub fn useless_metaclass_type(checker: &mut Checker, stmt: &Stmt, value: &Expr,
|
||||||
&deleted,
|
&deleted,
|
||||||
) {
|
) {
|
||||||
Ok(fix) => {
|
Ok(fix) => {
|
||||||
if fix.content.is_empty() || fix.content == "pass" {
|
if fix.patch.content.is_empty() || fix.patch.content == "pass" {
|
||||||
checker.deletions.insert(context.defined_by);
|
checker.deletions.insert(context.defined_by);
|
||||||
}
|
}
|
||||||
check.amend(fix)
|
check.amend(fix)
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 8
|
row: 8
|
||||||
column: 13
|
column: 13
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: raise AssertionError()
|
content: raise AssertionError()
|
||||||
location:
|
location:
|
||||||
row: 8
|
row: 8
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 10
|
row: 10
|
||||||
column: 13
|
column: 13
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "raise AssertionError('message')"
|
content: "raise AssertionError('message')"
|
||||||
location:
|
location:
|
||||||
row: 10
|
row: 10
|
||||||
|
|
|
@ -12,6 +12,7 @@ expression: checks
|
||||||
row: 17
|
row: 17
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "OSError,"
|
content: "OSError,"
|
||||||
location:
|
location:
|
||||||
row: 17
|
row: 17
|
||||||
|
@ -30,6 +31,7 @@ expression: checks
|
||||||
row: 28
|
row: 28
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "MyError,"
|
content: "MyError,"
|
||||||
location:
|
location:
|
||||||
row: 28
|
row: 28
|
||||||
|
@ -48,6 +50,7 @@ expression: checks
|
||||||
row: 49
|
row: 49
|
||||||
column: 27
|
column: 27
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "re.error,"
|
content: "re.error,"
|
||||||
location:
|
location:
|
||||||
row: 49
|
row: 49
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 132
|
row: 132
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 131
|
row: 131
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 146
|
row: 146
|
||||||
column: 38
|
column: 38
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 145
|
row: 145
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 79
|
row: 79
|
||||||
column: 33
|
column: 33
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 81
|
row: 81
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 137
|
row: 137
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 138
|
row: 138
|
||||||
|
@ -45,6 +47,7 @@ expression: checks
|
||||||
row: 146
|
row: 146
|
||||||
column: 38
|
column: 38
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 147
|
row: 147
|
||||||
|
@ -62,6 +65,7 @@ expression: checks
|
||||||
row: 453
|
row: 453
|
||||||
column: 24
|
column: 24
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 455
|
row: 455
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 156
|
row: 156
|
||||||
column: 33
|
column: 33
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 156
|
row: 156
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 187
|
row: 187
|
||||||
column: 46
|
column: 46
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 187
|
row: 187
|
||||||
|
@ -45,6 +47,7 @@ expression: checks
|
||||||
row: 527
|
row: 527
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 521
|
row: 521
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 176
|
row: 176
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 177
|
row: 177
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 187
|
row: 187
|
||||||
column: 46
|
column: 46
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 188
|
row: 188
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
source: src/linter.rs
|
source: src/linter.rs
|
||||||
expression: checks
|
expression: checks
|
||||||
---
|
---
|
||||||
- kind: NoBlankLineAfterSummary
|
- kind: BlankLineAfterSummary
|
||||||
location:
|
location:
|
||||||
row: 195
|
row: 195
|
||||||
column: 5
|
column: 5
|
||||||
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 198
|
row: 198
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 196
|
row: 196
|
||||||
|
@ -18,7 +19,7 @@ expression: checks
|
||||||
row: 196
|
row: 196
|
||||||
column: 1
|
column: 1
|
||||||
applied: false
|
applied: false
|
||||||
- kind: NoBlankLineAfterSummary
|
- kind: BlankLineAfterSummary
|
||||||
location:
|
location:
|
||||||
row: 205
|
row: 205
|
||||||
column: 5
|
column: 5
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 210
|
row: 210
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 206
|
row: 206
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 278
|
row: 278
|
||||||
column: 20
|
column: 20
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n "
|
content: "\n "
|
||||||
location:
|
location:
|
||||||
row: 278
|
row: 278
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 283
|
row: 283
|
||||||
column: 34
|
column: 34
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: Whitespace at the end.
|
content: Whitespace at the end.
|
||||||
location:
|
location:
|
||||||
row: 283
|
row: 283
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 288
|
row: 288
|
||||||
column: 38
|
column: 38
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: Whitespace at everywhere.
|
content: Whitespace at everywhere.
|
||||||
location:
|
location:
|
||||||
row: 288
|
row: 288
|
||||||
|
@ -42,6 +44,7 @@ expression: checks
|
||||||
row: 297
|
row: 297
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: Whitespace at the beginning.
|
content: Whitespace at the beginning.
|
||||||
location:
|
location:
|
||||||
row: 294
|
row: 294
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 165
|
row: 165
|
||||||
column: 30
|
column: 30
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 164
|
row: 164
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 176
|
row: 176
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 175
|
row: 175
|
||||||
|
|
|
@ -10,7 +10,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 153
|
row: 153
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " "
|
||||||
|
location:
|
||||||
|
row: 150
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 150
|
||||||
|
column: 9
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
SectionUnderlineNotOverIndented: Returns
|
SectionUnderlineNotOverIndented: Returns
|
||||||
location:
|
location:
|
||||||
|
@ -19,5 +28,14 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 165
|
row: 165
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " "
|
||||||
|
location:
|
||||||
|
row: 164
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 164
|
||||||
|
column: 9
|
||||||
|
applied: false
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 47
|
row: 47
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " -------\n"
|
||||||
|
location:
|
||||||
|
row: 45
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 45
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Returns
|
DashedUnderlineAfterSection: Returns
|
||||||
location:
|
location:
|
||||||
|
@ -19,7 +28,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 58
|
row: 58
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " -------\n"
|
||||||
|
location:
|
||||||
|
row: 57
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 57
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Raises
|
DashedUnderlineAfterSection: Raises
|
||||||
location:
|
location:
|
||||||
|
@ -28,7 +46,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 221
|
row: 221
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ------\n"
|
||||||
|
location:
|
||||||
|
row: 219
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 219
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Returns
|
DashedUnderlineAfterSection: Returns
|
||||||
location:
|
location:
|
||||||
|
@ -37,7 +64,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 262
|
row: 262
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " -------\n"
|
||||||
|
location:
|
||||||
|
row: 258
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 258
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Raises
|
DashedUnderlineAfterSection: Raises
|
||||||
location:
|
location:
|
||||||
|
@ -46,7 +82,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 262
|
row: 262
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ------\n"
|
||||||
|
location:
|
||||||
|
row: 260
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 260
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -55,7 +100,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 274
|
row: 274
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 272
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 272
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -64,7 +118,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 292
|
row: 292
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 289
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 289
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -73,7 +136,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 306
|
row: 306
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 304
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 304
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -82,7 +154,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 319
|
row: 319
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 316
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 316
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -91,7 +172,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 330
|
row: 330
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 328
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 328
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -100,7 +190,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 343
|
row: 343
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 340
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 340
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -109,7 +208,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 355
|
row: 355
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 353
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 353
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -118,7 +226,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 367
|
row: 367
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 365
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 365
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -127,7 +244,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 382
|
row: 382
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 374
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 374
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
DashedUnderlineAfterSection: Args
|
DashedUnderlineAfterSection: Args
|
||||||
location:
|
location:
|
||||||
|
@ -136,5 +262,14 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 497
|
row: 497
|
||||||
column: 12
|
column: 12
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " ----\n"
|
||||||
|
location:
|
||||||
|
row: 495
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 495
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,14 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 92
|
row: 92
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: ""
|
||||||
|
location:
|
||||||
|
row: 88
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 89
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 105
|
row: 105
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " -------\n"
|
||||||
|
location:
|
||||||
|
row: 102
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 103
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
SectionUnderlineMatchesSectionLength: Returns
|
SectionUnderlineMatchesSectionLength: Returns
|
||||||
location:
|
location:
|
||||||
|
@ -19,5 +28,14 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 221
|
row: 221
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: " -------\n"
|
||||||
|
location:
|
||||||
|
row: 216
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 217
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 78
|
row: 78
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 71
|
row: 71
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 221
|
row: 221
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "\n"
|
content: "\n"
|
||||||
location:
|
location:
|
||||||
row: 218
|
row: 218
|
||||||
|
|
|
@ -10,7 +10,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 78
|
row: 78
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: "\n"
|
||||||
|
location:
|
||||||
|
row: 71
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 71
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
BlankLineBeforeSection: Returns
|
BlankLineBeforeSection: Returns
|
||||||
location:
|
location:
|
||||||
|
@ -19,7 +28,16 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 129
|
row: 129
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: "\n"
|
||||||
|
location:
|
||||||
|
row: 125
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 125
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
- kind:
|
- kind:
|
||||||
BlankLineBeforeSection: Raises
|
BlankLineBeforeSection: Raises
|
||||||
location:
|
location:
|
||||||
|
@ -28,5 +46,14 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 221
|
row: 221
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: "\n"
|
||||||
|
location:
|
||||||
|
row: 218
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 218
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,14 @@ expression: checks
|
||||||
end_location:
|
end_location:
|
||||||
row: 221
|
row: 221
|
||||||
column: 8
|
column: 8
|
||||||
fix: ~
|
fix:
|
||||||
|
patch:
|
||||||
|
content: ""
|
||||||
|
location:
|
||||||
|
row: 211
|
||||||
|
column: 1
|
||||||
|
end_location:
|
||||||
|
row: 212
|
||||||
|
column: 1
|
||||||
|
applied: false
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ expression: checks
|
||||||
row: 2
|
row: 2
|
||||||
column: 21
|
column: 21
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: import os
|
content: import os
|
||||||
location:
|
location:
|
||||||
row: 2
|
row: 2
|
||||||
|
@ -30,6 +31,7 @@ expression: checks
|
||||||
row: 8
|
row: 8
|
||||||
column: 2
|
column: 2
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "from collections import (\n Counter,\n namedtuple,\n)"
|
content: "from collections import (\n Counter,\n namedtuple,\n)"
|
||||||
location:
|
location:
|
||||||
row: 4
|
row: 4
|
||||||
|
@ -48,6 +50,7 @@ expression: checks
|
||||||
row: 12
|
row: 12
|
||||||
column: 24
|
column: 24
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: import logging.handlers
|
content: import logging.handlers
|
||||||
location:
|
location:
|
||||||
row: 12
|
row: 12
|
||||||
|
@ -66,6 +69,7 @@ expression: checks
|
||||||
row: 33
|
row: 33
|
||||||
column: 18
|
column: 18
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 33
|
row: 33
|
||||||
|
@ -84,6 +88,7 @@ expression: checks
|
||||||
row: 34
|
row: 34
|
||||||
column: 21
|
column: 21
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 34
|
row: 34
|
||||||
|
@ -102,6 +107,7 @@ expression: checks
|
||||||
row: 38
|
row: 38
|
||||||
column: 19
|
column: 19
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 38
|
row: 38
|
||||||
|
@ -120,6 +126,7 @@ expression: checks
|
||||||
row: 53
|
row: 53
|
||||||
column: 22
|
column: 22
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: pass
|
content: pass
|
||||||
location:
|
location:
|
||||||
row: 53
|
row: 53
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 1
|
row: 1
|
||||||
column: 23
|
column: 23
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 1
|
row: 1
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 3
|
row: 3
|
||||||
column: 24
|
column: 24
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 3
|
row: 3
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 8
|
row: 8
|
||||||
column: 31
|
column: 31
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 8
|
row: 8
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 2
|
row: 2
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: pass
|
content: pass
|
||||||
location:
|
location:
|
||||||
row: 2
|
row: 2
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 6
|
row: 6
|
||||||
column: 25
|
column: 25
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 6
|
row: 6
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 3
|
row: 3
|
||||||
column: 22
|
column: 22
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: __file__
|
content: __file__
|
||||||
location:
|
location:
|
||||||
row: 3
|
row: 3
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 9
|
row: 9
|
||||||
column: 30
|
column: 30
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: __file__
|
content: __file__
|
||||||
location:
|
location:
|
||||||
row: 9
|
row: 9
|
||||||
|
@ -42,6 +44,7 @@ expression: checks
|
||||||
row: 15
|
row: 15
|
||||||
column: 27
|
column: 27
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: __file__
|
content: __file__
|
||||||
location:
|
location:
|
||||||
row: 15
|
row: 15
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 1
|
row: 1
|
||||||
column: 9
|
column: 9
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: str
|
content: str
|
||||||
location:
|
location:
|
||||||
row: 1
|
row: 1
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 2
|
row: 2
|
||||||
column: 10
|
column: 10
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: bytes
|
content: bytes
|
||||||
location:
|
location:
|
||||||
row: 2
|
row: 2
|
||||||
|
@ -45,6 +47,7 @@ expression: checks
|
||||||
row: 3
|
row: 3
|
||||||
column: 8
|
column: 8
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: int
|
content: int
|
||||||
location:
|
location:
|
||||||
row: 3
|
row: 3
|
||||||
|
@ -62,6 +65,7 @@ expression: checks
|
||||||
row: 4
|
row: 4
|
||||||
column: 9
|
column: 9
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: float
|
content: float
|
||||||
location:
|
location:
|
||||||
row: 4
|
row: 4
|
||||||
|
@ -79,6 +83,7 @@ expression: checks
|
||||||
row: 5
|
row: 5
|
||||||
column: 9
|
column: 9
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: complex
|
content: complex
|
||||||
location:
|
location:
|
||||||
row: 5
|
row: 5
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 5
|
row: 5
|
||||||
column: 15
|
column: 15
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 5
|
row: 5
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 10
|
row: 10
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 9
|
row: 9
|
||||||
|
@ -45,6 +47,7 @@ expression: checks
|
||||||
row: 16
|
row: 16
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 15
|
row: 15
|
||||||
|
@ -62,6 +65,7 @@ expression: checks
|
||||||
row: 24
|
row: 24
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 22
|
row: 22
|
||||||
|
@ -79,6 +83,7 @@ expression: checks
|
||||||
row: 31
|
row: 31
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 29
|
row: 29
|
||||||
|
@ -96,6 +101,7 @@ expression: checks
|
||||||
row: 37
|
row: 37
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 36
|
row: 36
|
||||||
|
@ -113,6 +119,7 @@ expression: checks
|
||||||
row: 45
|
row: 45
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 43
|
row: 43
|
||||||
|
@ -130,6 +137,7 @@ expression: checks
|
||||||
row: 53
|
row: 53
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 51
|
row: 51
|
||||||
|
@ -147,6 +155,7 @@ expression: checks
|
||||||
row: 61
|
row: 61
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 59
|
row: 59
|
||||||
|
@ -164,6 +173,7 @@ expression: checks
|
||||||
row: 69
|
row: 69
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 67
|
row: 67
|
||||||
|
@ -181,6 +191,7 @@ expression: checks
|
||||||
row: 75
|
row: 75
|
||||||
column: 18
|
column: 18
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 75
|
row: 75
|
||||||
|
@ -198,6 +209,7 @@ expression: checks
|
||||||
row: 79
|
row: 79
|
||||||
column: 15
|
column: 15
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 79
|
row: 79
|
||||||
|
@ -215,6 +227,7 @@ expression: checks
|
||||||
row: 84
|
row: 84
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 84
|
row: 84
|
||||||
|
@ -232,6 +245,7 @@ expression: checks
|
||||||
row: 92
|
row: 92
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 91
|
row: 91
|
||||||
|
@ -249,6 +263,7 @@ expression: checks
|
||||||
row: 98
|
row: 98
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 98
|
row: 98
|
||||||
|
@ -266,6 +281,7 @@ expression: checks
|
||||||
row: 108
|
row: 108
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 107
|
row: 107
|
||||||
|
@ -283,6 +299,7 @@ expression: checks
|
||||||
row: 114
|
row: 114
|
||||||
column: 19
|
column: 19
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 114
|
row: 114
|
||||||
|
@ -300,6 +317,7 @@ expression: checks
|
||||||
row: 119
|
row: 119
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 118
|
row: 118
|
||||||
|
@ -317,6 +335,7 @@ expression: checks
|
||||||
row: 125
|
row: 125
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 124
|
row: 124
|
||||||
|
@ -334,6 +353,7 @@ expression: checks
|
||||||
row: 131
|
row: 131
|
||||||
column: 11
|
column: 11
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 130
|
row: 130
|
||||||
|
|
|
@ -13,6 +13,7 @@ expression: checks
|
||||||
row: 6
|
row: 6
|
||||||
column: 26
|
column: 26
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: self.assertEqual
|
content: self.assertEqual
|
||||||
location:
|
location:
|
||||||
row: 6
|
row: 6
|
||||||
|
@ -32,6 +33,7 @@ expression: checks
|
||||||
row: 7
|
row: 7
|
||||||
column: 26
|
column: 26
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: self.assertEqual
|
content: self.assertEqual
|
||||||
location:
|
location:
|
||||||
row: 7
|
row: 7
|
||||||
|
@ -51,6 +53,7 @@ expression: checks
|
||||||
row: 9
|
row: 9
|
||||||
column: 35
|
column: 35
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: self.assertAlmostEqual
|
content: self.assertAlmostEqual
|
||||||
location:
|
location:
|
||||||
row: 9
|
row: 9
|
||||||
|
@ -70,6 +73,7 @@ expression: checks
|
||||||
row: 10
|
row: 10
|
||||||
column: 36
|
column: 36
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: self.assertNotRegex
|
content: self.assertNotRegex
|
||||||
location:
|
location:
|
||||||
row: 10
|
row: 10
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 4
|
row: 4
|
||||||
column: 14
|
column: 14
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: list
|
content: list
|
||||||
location:
|
location:
|
||||||
row: 4
|
row: 4
|
||||||
|
@ -28,6 +29,7 @@ expression: checks
|
||||||
row: 11
|
row: 11
|
||||||
column: 21
|
column: 21
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: list
|
content: list
|
||||||
location:
|
location:
|
||||||
row: 11
|
row: 11
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 4
|
row: 4
|
||||||
column: 23
|
column: 23
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: str | None
|
content: str | None
|
||||||
location:
|
location:
|
||||||
row: 4
|
row: 4
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 11
|
row: 11
|
||||||
column: 30
|
column: 30
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: str | None
|
content: str | None
|
||||||
location:
|
location:
|
||||||
row: 11
|
row: 11
|
||||||
|
@ -42,6 +44,7 @@ expression: checks
|
||||||
row: 18
|
row: 18
|
||||||
column: 46
|
column: 46
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "str | int | Union[float, bytes]"
|
content: "str | int | Union[float, bytes]"
|
||||||
location:
|
location:
|
||||||
row: 18
|
row: 18
|
||||||
|
@ -58,6 +61,7 @@ expression: checks
|
||||||
row: 18
|
row: 18
|
||||||
column: 45
|
column: 45
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: float | bytes
|
content: float | bytes
|
||||||
location:
|
location:
|
||||||
row: 18
|
row: 18
|
||||||
|
@ -74,6 +78,7 @@ expression: checks
|
||||||
row: 25
|
row: 25
|
||||||
column: 32
|
column: 32
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: str | int
|
content: str | int
|
||||||
location:
|
location:
|
||||||
row: 25
|
row: 25
|
||||||
|
@ -90,6 +95,7 @@ expression: checks
|
||||||
row: 32
|
row: 32
|
||||||
column: 48
|
column: 48
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "str | int | Union[float, bytes]"
|
content: "str | int | Union[float, bytes]"
|
||||||
location:
|
location:
|
||||||
row: 32
|
row: 32
|
||||||
|
@ -106,6 +112,7 @@ expression: checks
|
||||||
row: 32
|
row: 32
|
||||||
column: 48
|
column: 48
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: float | bytes
|
content: float | bytes
|
||||||
location:
|
location:
|
||||||
row: 32
|
row: 32
|
||||||
|
@ -122,6 +129,7 @@ expression: checks
|
||||||
row: 39
|
row: 39
|
||||||
column: 34
|
column: 34
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: str | int
|
content: str | int
|
||||||
location:
|
location:
|
||||||
row: 39
|
row: 39
|
||||||
|
|
|
@ -10,6 +10,7 @@ expression: checks
|
||||||
row: 17
|
row: 17
|
||||||
column: 36
|
column: 36
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: super()
|
content: super()
|
||||||
location:
|
location:
|
||||||
row: 17
|
row: 17
|
||||||
|
@ -26,6 +27,7 @@ expression: checks
|
||||||
row: 18
|
row: 18
|
||||||
column: 27
|
column: 27
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: super()
|
content: super()
|
||||||
location:
|
location:
|
||||||
row: 18
|
row: 18
|
||||||
|
@ -42,6 +44,7 @@ expression: checks
|
||||||
row: 22
|
row: 22
|
||||||
column: 10
|
column: 10
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: super()
|
content: super()
|
||||||
location:
|
location:
|
||||||
row: 19
|
row: 19
|
||||||
|
@ -58,6 +61,7 @@ expression: checks
|
||||||
row: 36
|
row: 36
|
||||||
column: 29
|
column: 29
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: super()
|
content: super()
|
||||||
location:
|
location:
|
||||||
row: 36
|
row: 36
|
||||||
|
@ -74,6 +78,7 @@ expression: checks
|
||||||
row: 50
|
row: 50
|
||||||
column: 33
|
column: 33
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: super()
|
content: super()
|
||||||
location:
|
location:
|
||||||
row: 50
|
row: 50
|
||||||
|
|
|
@ -12,6 +12,7 @@ expression: checks
|
||||||
row: 8
|
row: 8
|
||||||
column: 2
|
column: 2
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: "from models import (\n Fruit,\n)"
|
content: "from models import (\n Fruit,\n)"
|
||||||
location:
|
location:
|
||||||
row: 5
|
row: 5
|
||||||
|
|
|
@ -11,6 +11,7 @@ expression: checks
|
||||||
row: 9
|
row: 9
|
||||||
column: 18
|
column: 18
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 9
|
row: 9
|
||||||
|
@ -29,6 +30,7 @@ expression: checks
|
||||||
row: 13
|
row: 13
|
||||||
column: 24
|
column: 24
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 13
|
row: 13
|
||||||
|
@ -48,6 +50,7 @@ expression: checks
|
||||||
row: 16
|
row: 16
|
||||||
column: 30
|
column: 30
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 16
|
row: 16
|
||||||
|
@ -66,6 +69,7 @@ expression: checks
|
||||||
row: 19
|
row: 19
|
||||||
column: 30
|
column: 30
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: " # noqa: F841"
|
content: " # noqa: F841"
|
||||||
location:
|
location:
|
||||||
row: 19
|
row: 19
|
||||||
|
@ -84,6 +88,7 @@ expression: checks
|
||||||
row: 44
|
row: 44
|
||||||
column: 24
|
column: 24
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: " # noqa: E501"
|
content: " # noqa: E501"
|
||||||
location:
|
location:
|
||||||
row: 44
|
row: 44
|
||||||
|
@ -102,6 +107,7 @@ expression: checks
|
||||||
row: 52
|
row: 52
|
||||||
column: 18
|
column: 18
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 52
|
row: 52
|
||||||
|
@ -119,6 +125,7 @@ expression: checks
|
||||||
row: 60
|
row: 60
|
||||||
column: 12
|
column: 12
|
||||||
fix:
|
fix:
|
||||||
|
patch:
|
||||||
content: ""
|
content: ""
|
||||||
location:
|
location:
|
||||||
row: 60
|
row: 60
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue