Remove Patch abstraction from Fix (#987)

This commit is contained in:
Charlie Marsh 2022-12-01 16:04:42 -05:00 committed by GitHub
parent 2e89cd8802
commit af40e64d6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 2594 additions and 2983 deletions

View file

@ -6,7 +6,7 @@ use ropey::RopeBuilder;
use rustpython_parser::ast::Location; use rustpython_parser::ast::Location;
use crate::ast::types::Range; use crate::ast::types::Range;
use crate::autofix::{Fix, Patch}; use crate::autofix::Fix;
use crate::checks::Check; use crate::checks::Check;
use crate::source_code_locator::SourceCodeLocator; use crate::source_code_locator::SourceCodeLocator;
@ -58,36 +58,36 @@ fn apply_fixes<'a>(
) -> (Cow<'a, str>, usize) { ) -> (Cow<'a, str>, usize) {
let mut output = RopeBuilder::new(); let mut output = RopeBuilder::new();
let mut last_pos: Location = Location::new(1, 0); let mut last_pos: Location = Location::new(1, 0);
let mut applied: BTreeSet<&Patch> = BTreeSet::default(); let mut applied: BTreeSet<&Fix> = BTreeSet::default();
let mut num_fixed: usize = 0; let mut num_fixed: usize = 0;
for fix in fixes.sorted_by_key(|fix| fix.patch.location) { for fix in fixes.sorted_by_key(|fix| fix.location) {
// If we already applied an identical fix as part of another correction, skip // If we already applied an identical fix as part of another correction, skip
// any re-application. // any re-application.
if applied.contains(&fix.patch) { if applied.contains(&fix) {
num_fixed += 1; num_fixed += 1;
continue; continue;
} }
// Best-effort approach: if this fix overlaps with a fix we've already applied, // Best-effort approach: if this fix overlaps with a fix we've already applied,
// skip it. // skip it.
if last_pos > fix.patch.location { if last_pos > fix.location {
continue; continue;
} }
// Add all contents from `last_pos` to `fix.patch.location`. // Add all contents from `last_pos` to `fix.location`.
let slice = locator.slice_source_code_range(&Range { let slice = locator.slice_source_code_range(&Range {
location: last_pos, location: last_pos,
end_location: fix.patch.location, end_location: fix.location,
}); });
output.append(&slice); output.append(&slice);
// Add the patch itself. // Add the patch itself.
output.append(&fix.patch.content); output.append(&fix.content);
// Track that the fix was applied. // Track that the fix was applied.
last_pos = fix.patch.end_location; last_pos = fix.end_location;
applied.insert(&fix.patch); applied.insert(fix);
num_fixed += 1; num_fixed += 1;
} }
@ -103,7 +103,7 @@ 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::autofix::{Fix, Patch}; use crate::autofix::Fix;
use crate::SourceCodeLocator; use crate::SourceCodeLocator;
#[test] #[test]
@ -118,11 +118,9 @@ mod tests {
#[test] #[test]
fn apply_single_replacement() { fn apply_single_replacement() {
let fixes = vec![Fix { let fixes = vec![Fix {
patch: Patch { content: "Bar".to_string(),
content: "Bar".to_string(), location: Location::new(1, 8),
location: Location::new(1, 8), end_location: Location::new(1, 14),
end_location: Location::new(1, 14),
},
}]; }];
let locator = SourceCodeLocator::new( let locator = SourceCodeLocator::new(
r#" r#"
@ -146,11 +144,9 @@ class A(Bar):
#[test] #[test]
fn apply_single_removal() { fn apply_single_removal() {
let fixes = vec![Fix { let fixes = vec![Fix {
patch: Patch { content: String::new(),
content: String::new(), location: Location::new(1, 7),
location: Location::new(1, 7), end_location: Location::new(1, 15),
end_location: Location::new(1, 15),
},
}]; }];
let locator = SourceCodeLocator::new( let locator = SourceCodeLocator::new(
r#" r#"
@ -175,18 +171,14 @@ class A:
fn apply_double_removal() { fn apply_double_removal() {
let fixes = vec![ let fixes = vec![
Fix { Fix {
patch: Patch { content: String::new(),
content: String::new(), location: Location::new(1, 7),
location: Location::new(1, 7), end_location: Location::new(1, 16),
end_location: Location::new(1, 16),
},
}, },
Fix { Fix {
patch: Patch { content: String::new(),
content: String::new(), location: Location::new(1, 16),
location: Location::new(1, 16), end_location: Location::new(1, 23),
end_location: Location::new(1, 23),
},
}, },
]; ];
let locator = SourceCodeLocator::new( let locator = SourceCodeLocator::new(
@ -213,18 +205,14 @@ class A:
fn ignore_overlapping_fixes() { fn ignore_overlapping_fixes() {
let fixes = vec![ let fixes = vec![
Fix { Fix {
patch: Patch { content: String::new(),
content: String::new(), location: Location::new(1, 7),
location: Location::new(1, 7), end_location: Location::new(1, 15),
end_location: Location::new(1, 15),
},
}, },
Fix { Fix {
patch: Patch { content: "ignored".to_string(),
content: "ignored".to_string(), location: Location::new(1, 9),
location: Location::new(1, 9), end_location: Location::new(1, 11),
end_location: Location::new(1, 11),
},
}, },
]; ];
let locator = SourceCodeLocator::new( let locator = SourceCodeLocator::new(

View file

@ -5,55 +5,42 @@ pub mod fixer;
pub mod helpers; pub mod helpers;
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
pub struct Patch { pub struct Fix {
pub content: String, pub content: String,
pub location: Location, pub location: Location,
pub end_location: Location, pub end_location: Location,
} }
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Fix {
pub patch: Patch,
}
impl Fix { impl Fix {
pub fn deletion(start: Location, end: Location) -> Self { pub fn deletion(start: Location, end: Location) -> Self {
Self { Self {
patch: Patch { content: String::new(),
content: String::new(), location: start,
location: start, end_location: end,
end_location: end,
},
} }
} }
pub fn replacement(content: String, start: Location, end: Location) -> Self { pub fn replacement(content: String, start: Location, end: Location) -> Self {
Self { Self {
patch: Patch { content,
content, location: start,
location: start, end_location: end,
end_location: end,
},
} }
} }
pub fn insertion(content: String, at: Location) -> Self { pub fn insertion(content: String, at: Location) -> Self {
Self { Self {
patch: Patch { content,
content, location: at,
location: at, end_location: at,
end_location: at,
},
} }
} }
pub fn dummy(location: Location) -> Self { pub fn dummy(location: Location) -> Self {
Self { Self {
patch: Patch { content: String::new(),
content: String::new(), location,
location, end_location: location,
end_location: location,
},
} }
} }
} }

View file

@ -2990,7 +2990,7 @@ impl<'a> Checker<'a> {
&deleted, &deleted,
) { ) {
Ok(fix) => { Ok(fix) => {
if fix.patch.content.is_empty() || fix.patch.content == "pass" { if fix.content.is_empty() || fix.content == "pass" {
self.deletions.insert(defined_by); self.deletions.insert(defined_by);
} }
Some(fix) Some(fix)

View file

@ -10,14 +10,13 @@ expression: checks
row: 1 row: 1
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 0
column: 0
- kind: CommentedOutCode - kind: CommentedOutCode
location: location:
row: 2 row: 2
@ -26,14 +25,13 @@ expression: checks
row: 2 row: 2
column: 22 column: 22
fix: fix:
patch: content: ""
content: "" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 0
column: 0
- kind: CommentedOutCode - kind: CommentedOutCode
location: location:
row: 3 row: 3
@ -42,14 +40,13 @@ expression: checks
row: 3 row: 3
column: 6 column: 6
fix: fix:
patch: content: ""
content: "" location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 0
column: 0
- kind: CommentedOutCode - kind: CommentedOutCode
location: location:
row: 5 row: 5
@ -58,14 +55,13 @@ expression: checks
row: 5 row: 5
column: 13 column: 13
fix: fix:
patch: content: ""
content: "" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 0
column: 0
- kind: CommentedOutCode - kind: CommentedOutCode
location: location:
row: 12 row: 12
@ -74,12 +70,11 @@ expression: checks
row: 12 row: 12
column: 16 column: 16
fix: fix:
patch: content: ""
content: "" location:
location: row: 12
row: 12 column: 0
column: 0 end_location:
end_location: row: 13
row: 13 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 6 row: 6
column: 5 column: 5
fix: fix:
patch: content: _i
content: _i location:
location: row: 6
row: 6 column: 4
column: 4 end_location:
end_location: row: 6
row: 6 column: 5
column: 5
- kind: - kind:
UnusedLoopControlVariable: k UnusedLoopControlVariable: k
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 18 row: 18
column: 13 column: 13
fix: fix:
patch: content: _k
content: _k location:
location: row: 18
row: 18 column: 12
column: 12 end_location:
end_location: row: 18
row: 18 column: 13
column: 13
- kind: - kind:
UnusedLoopControlVariable: i UnusedLoopControlVariable: i
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 30 row: 30
column: 5 column: 5
fix: fix:
patch: content: _i
content: _i location:
location: row: 30
row: 30 column: 4
column: 4 end_location:
end_location: row: 30
row: 30 column: 5
column: 5
- kind: - kind:
UnusedLoopControlVariable: k UnusedLoopControlVariable: k
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 30 row: 30
column: 13 column: 13
fix: fix:
patch: content: _k
content: _k location:
location: row: 30
row: 30 column: 12
column: 12 end_location:
end_location: row: 30
row: 30 column: 13
column: 13

View file

@ -10,14 +10,13 @@ expression: checks
row: 18 row: 18
column: 19 column: 19
fix: fix:
patch: content: foo.bar
content: foo.bar location:
location: row: 18
row: 18 column: 0
column: 0 end_location:
end_location: row: 18
row: 18 column: 19
column: 19
- kind: GetAttrWithConstant - kind: GetAttrWithConstant
location: location:
row: 19 row: 19
@ -26,14 +25,13 @@ expression: checks
row: 19 row: 19
column: 23 column: 23
fix: fix:
patch: content: foo._123abc
content: foo._123abc location:
location: row: 19
row: 19 column: 0
column: 0 end_location:
end_location: row: 19
row: 19 column: 23
column: 23
- kind: GetAttrWithConstant - kind: GetAttrWithConstant
location: location:
row: 20 row: 20
@ -42,14 +40,13 @@ expression: checks
row: 20 row: 20
column: 22 column: 22
fix: fix:
patch: content: foo.abc123
content: foo.abc123 location:
location: row: 20
row: 20 column: 0
column: 0 end_location:
end_location: row: 20
row: 20 column: 22
column: 22
- kind: GetAttrWithConstant - kind: GetAttrWithConstant
location: location:
row: 21 row: 21
@ -58,14 +55,13 @@ expression: checks
row: 21 row: 21
column: 23 column: 23
fix: fix:
patch: content: foo.abc123
content: foo.abc123 location:
location: row: 21
row: 21 column: 0
column: 0 end_location:
end_location: row: 21
row: 21 column: 23
column: 23
- kind: GetAttrWithConstant - kind: GetAttrWithConstant
location: location:
row: 22 row: 22
@ -74,12 +70,11 @@ expression: checks
row: 22 row: 22
column: 31 column: 31
fix: fix:
patch: content: x.bar
content: x.bar location:
location: row: 22
row: 22 column: 14
column: 14 end_location:
end_location: row: 22
row: 22 column: 31
column: 31

View file

@ -10,14 +10,13 @@ expression: checks
row: 33 row: 33
column: 25 column: 25
fix: fix:
patch: content: foo.bar = None
content: foo.bar = None location:
location: row: 33
row: 33 column: 0
column: 0 end_location:
end_location: row: 33
row: 33 column: 25
column: 25
- kind: SetAttrWithConstant - kind: SetAttrWithConstant
location: location:
row: 34 row: 34
@ -26,14 +25,13 @@ expression: checks
row: 34 row: 34
column: 29 column: 29
fix: fix:
patch: content: foo._123abc = None
content: foo._123abc = None location:
location: row: 34
row: 34 column: 0
column: 0 end_location:
end_location: row: 34
row: 34 column: 29
column: 29
- kind: SetAttrWithConstant - kind: SetAttrWithConstant
location: location:
row: 35 row: 35
@ -42,14 +40,13 @@ expression: checks
row: 35 row: 35
column: 28 column: 28
fix: fix:
patch: content: foo.abc123 = None
content: foo.abc123 = None location:
location: row: 35
row: 35 column: 0
column: 0 end_location:
end_location: row: 35
row: 35 column: 28
column: 28
- kind: SetAttrWithConstant - kind: SetAttrWithConstant
location: location:
row: 36 row: 36
@ -58,14 +55,13 @@ expression: checks
row: 36 row: 36
column: 29 column: 29
fix: fix:
patch: content: foo.abc123 = None
content: foo.abc123 = None location:
location: row: 36
row: 36 column: 0
column: 0 end_location:
end_location: row: 36
row: 36 column: 29
column: 29
- kind: SetAttrWithConstant - kind: SetAttrWithConstant
location: location:
row: 37 row: 37
@ -74,12 +70,11 @@ expression: checks
row: 37 row: 37
column: 30 column: 30
fix: fix:
patch: content: foo.bar.baz = None
content: foo.bar.baz = None location:
location: row: 37
row: 37 column: 0
column: 0 end_location:
end_location: row: 37
row: 37 column: 30
column: 30

View file

@ -10,14 +10,13 @@ expression: checks
row: 8 row: 8
column: 12 column: 12
fix: fix:
patch: content: raise AssertionError()
content: raise AssertionError() location:
location: row: 8
row: 8 column: 0
column: 0 end_location:
end_location: row: 8
row: 8 column: 12
column: 12
- kind: DoNotAssertFalse - kind: DoNotAssertFalse
location: location:
row: 10 row: 10
@ -26,12 +25,11 @@ expression: checks
row: 10 row: 10
column: 12 column: 12
fix: fix:
patch: content: "raise AssertionError('message')"
content: "raise AssertionError('message')" location:
location: row: 10
row: 10 column: 0
column: 0 end_location:
end_location: row: 10
row: 10 column: 23
column: 23

View file

@ -11,12 +11,11 @@ expression: checks
row: 3 row: 3
column: 19 column: 19
fix: fix:
patch: content: ValueError
content: ValueError location:
location: row: 3
row: 3 column: 7
column: 7 end_location:
end_location: row: 3
row: 3 column: 20
column: 20

View file

@ -12,14 +12,13 @@ expression: checks
row: 17 row: 17
column: 24 column: 24
fix: fix:
patch: content: "OSError,"
content: "OSError," location:
location: row: 17
row: 17 column: 8
column: 8 end_location:
end_location: row: 17
row: 17 column: 24
column: 24
- kind: - kind:
DuplicateHandlerException: DuplicateHandlerException:
- MyError - MyError
@ -30,14 +29,13 @@ expression: checks
row: 28 row: 28
column: 24 column: 24
fix: fix:
patch: content: "MyError,"
content: "MyError," location:
location: row: 28
row: 28 column: 8
column: 8 end_location:
end_location: row: 28
row: 28 column: 24
column: 24
- kind: - kind:
DuplicateHandlerException: DuplicateHandlerException:
- re.error - re.error
@ -48,12 +46,11 @@ expression: checks
row: 49 row: 49
column: 26 column: 26
fix: fix:
patch: content: "re.error,"
content: "re.error," location:
location: row: 49
row: 49 column: 8
column: 8 end_location:
end_location: row: 49
row: 49 column: 26
column: 26

View file

@ -10,14 +10,13 @@ expression: checks
row: 1 row: 1
column: 29 column: 29
fix: fix:
patch: content: "[x for x in range(3)]"
content: "[x for x in range(3)]" location:
location: row: 1
row: 1 column: 4
column: 4 end_location:
end_location: row: 1
row: 1 column: 29
column: 29
- kind: UnnecessaryGeneratorList - kind: UnnecessaryGeneratorList
location: location:
row: 2 row: 2
@ -26,12 +25,11 @@ expression: checks
row: 4 row: 4
column: 1 column: 1
fix: fix:
patch: content: "[\n x for x in range(3)\n]"
content: "[\n x for x in range(3)\n]" location:
location: row: 2
row: 2 column: 4
column: 4 end_location:
end_location: row: 4
row: 4 column: 1
column: 1

View file

@ -10,14 +10,13 @@ expression: checks
row: 1 row: 1
column: 28 column: 28
fix: fix:
patch: content: "{x for x in range(3)}"
content: "{x for x in range(3)}" location:
location: row: 1
row: 1 column: 4
column: 4 end_location:
end_location: row: 1
row: 1 column: 28
column: 28
- kind: UnnecessaryGeneratorSet - kind: UnnecessaryGeneratorSet
location: location:
row: 2 row: 2
@ -26,12 +25,11 @@ expression: checks
row: 4 row: 4
column: 1 column: 1
fix: fix:
patch: content: "{\n x for x in range(3)\n}"
content: "{\n x for x in range(3)\n}" location:
location: row: 2
row: 2 column: 4
column: 4 end_location:
end_location: row: 4
row: 4 column: 1
column: 1

View file

@ -10,14 +10,13 @@ expression: checks
row: 1 row: 1
column: 30 column: 30
fix: fix:
patch: content: "{x: x for x in range(3)}"
content: "{x: x for x in range(3)}" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 1
row: 1 column: 30
column: 30
- kind: UnnecessaryGeneratorDict - kind: UnnecessaryGeneratorDict
location: location:
row: 2 row: 2
@ -26,12 +25,11 @@ expression: checks
row: 4 row: 4
column: 1 column: 1
fix: fix:
patch: content: "{\n x: x for x in range(3)\n}"
content: "{\n x: x for x in range(3)\n}" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 1
column: 1

View file

@ -10,14 +10,13 @@ expression: checks
row: 1 row: 1
column: 30 column: 30
fix: fix:
patch: content: "{x for x in range(3)}"
content: "{x for x in range(3)}" location:
location: row: 1
row: 1 column: 4
column: 4 end_location:
end_location: row: 1
row: 1 column: 30
column: 30
- kind: UnnecessaryListComprehensionSet - kind: UnnecessaryListComprehensionSet
location: location:
row: 2 row: 2
@ -26,12 +25,11 @@ expression: checks
row: 4 row: 4
column: 1 column: 1
fix: fix:
patch: content: "{\n x for x in range(3)\n}"
content: "{\n x for x in range(3)\n}" location:
location: row: 2
row: 2 column: 4
column: 4 end_location:
end_location: row: 4
row: 4 column: 1
column: 1

View file

@ -10,12 +10,11 @@ expression: checks
row: 1 row: 1
column: 32 column: 32
fix: fix:
patch: content: "{i: i for i in range(3)}"
content: "{i: i for i in range(3)}" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 1
row: 1 column: 32
column: 32

View file

@ -11,14 +11,13 @@ expression: checks
row: 1 row: 1
column: 16 column: 16
fix: fix:
patch: content: "{1, 2}"
content: "{1, 2}" location:
location: row: 1
row: 1 column: 5
column: 5 end_location:
end_location: row: 1
row: 1 column: 16
column: 16
- kind: - kind:
UnnecessaryLiteralSet: tuple UnnecessaryLiteralSet: tuple
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 2 row: 2
column: 16 column: 16
fix: fix:
patch: content: "{1, 2}"
content: "{1, 2}" location:
location: row: 2
row: 2 column: 5
column: 5 end_location:
end_location: row: 2
row: 2 column: 16
column: 16
- kind: - kind:
UnnecessaryLiteralSet: list UnnecessaryLiteralSet: list
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 3 row: 3
column: 12 column: 12
fix: fix:
patch: content: set()
content: set() location:
location: row: 3
row: 3 column: 5
column: 5 end_location:
end_location: row: 3
row: 3 column: 12
column: 12
- kind: - kind:
UnnecessaryLiteralSet: tuple UnnecessaryLiteralSet: tuple
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 4 row: 4
column: 12 column: 12
fix: fix:
patch: content: set()
content: set() location:
location: row: 4
row: 4 column: 5
column: 5 end_location:
end_location: row: 4
row: 4 column: 12
column: 12

View file

@ -11,14 +11,13 @@ expression: checks
row: 1 row: 1
column: 19 column: 19
fix: fix:
patch: content: "{1: 2}"
content: "{1: 2}" location:
location: row: 1
row: 1 column: 5
column: 5 end_location:
end_location: row: 1
row: 1 column: 19
column: 19
- kind: - kind:
UnnecessaryLiteralDict: tuple UnnecessaryLiteralDict: tuple
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 2 row: 2
column: 20 column: 20
fix: fix:
patch: content: "{1: 2,}"
content: "{1: 2,}" location:
location: row: 2
row: 2 column: 5
column: 5 end_location:
end_location: row: 2
row: 2 column: 20
column: 20
- kind: - kind:
UnnecessaryLiteralDict: list UnnecessaryLiteralDict: list
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 3 row: 3
column: 13 column: 13
fix: fix:
patch: content: "{}"
content: "{}" location:
location: row: 3
row: 3 column: 5
column: 5 end_location:
end_location: row: 3
row: 3 column: 13
column: 13
- kind: - kind:
UnnecessaryLiteralDict: tuple UnnecessaryLiteralDict: tuple
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 4 row: 4
column: 13 column: 13
fix: fix:
patch: content: "{}"
content: "{}" location:
location: row: 4
row: 4 column: 5
column: 5 end_location:
end_location: row: 4
row: 4 column: 13
column: 13

View file

@ -11,14 +11,13 @@ expression: checks
row: 1 row: 1
column: 11 column: 11
fix: fix:
patch: content: ()
content: () location:
location: row: 1
row: 1 column: 4
column: 4 end_location:
end_location: row: 1
row: 1 column: 11
column: 11
- kind: - kind:
UnnecessaryCollectionCall: list UnnecessaryCollectionCall: list
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 2 row: 2
column: 10 column: 10
fix: fix:
patch: content: "[]"
content: "[]" location:
location: row: 2
row: 2 column: 4
column: 4 end_location:
end_location: row: 2
row: 2 column: 10
column: 10
- kind: - kind:
UnnecessaryCollectionCall: dict UnnecessaryCollectionCall: dict
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 3 row: 3
column: 11 column: 11
fix: fix:
patch: content: "{}"
content: "{}" location:
location: row: 3
row: 3 column: 5
column: 5 end_location:
end_location: row: 3
row: 3 column: 11
column: 11
- kind: - kind:
UnnecessaryCollectionCall: dict UnnecessaryCollectionCall: dict
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 4 row: 4
column: 14 column: 14
fix: fix:
patch: content: "{\"a\": 1}"
content: "{\"a\": 1}" location:
location: row: 4
row: 4 column: 5
column: 5 end_location:
end_location: row: 4
row: 4 column: 14
column: 14

View file

@ -11,14 +11,13 @@ expression: checks
row: 1 row: 1
column: 14 column: 14
fix: fix:
patch: content: ()
content: () location:
location: row: 1
row: 1 column: 5
column: 5 end_location:
end_location: row: 1
row: 1 column: 14
column: 14
- kind: - kind:
UnnecessaryLiteralWithinTupleCall: list UnnecessaryLiteralWithinTupleCall: list
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 2 row: 2
column: 18 column: 18
fix: fix:
patch: content: "(1, 2)"
content: "(1, 2)" location:
location: row: 2
row: 2 column: 5
column: 5 end_location:
end_location: row: 2
row: 2 column: 18
column: 18
- kind: - kind:
UnnecessaryLiteralWithinTupleCall: tuple UnnecessaryLiteralWithinTupleCall: tuple
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 3 row: 3
column: 18 column: 18
fix: fix:
patch: content: "(1, 2)"
content: "(1, 2)" location:
location: row: 3
row: 3 column: 5
column: 5 end_location:
end_location: row: 3
row: 3 column: 18
column: 18
- kind: - kind:
UnnecessaryLiteralWithinTupleCall: list UnnecessaryLiteralWithinTupleCall: list
location: location:
@ -62,14 +59,13 @@ expression: checks
row: 7 row: 7
column: 2 column: 2
fix: fix:
patch: content: "(\n 1,\n 2\n)"
content: "(\n 1,\n 2\n)" location:
location: row: 4
row: 4 column: 5
column: 5 end_location:
end_location: row: 7
row: 7 column: 2
column: 2
- kind: - kind:
UnnecessaryLiteralWithinTupleCall: tuple UnnecessaryLiteralWithinTupleCall: tuple
location: location:
@ -79,12 +75,11 @@ expression: checks
row: 10 row: 10
column: 1 column: 1
fix: fix:
patch: content: "(1, 2)"
content: "(1, 2)" location:
location: row: 8
row: 8 column: 5
column: 5 end_location:
end_location: row: 10
row: 10 column: 1
column: 1

View file

@ -11,14 +11,13 @@ expression: checks
row: 1 row: 1
column: 17 column: 17
fix: fix:
patch: content: "[1, 2]"
content: "[1, 2]" location:
location: row: 1
row: 1 column: 5
column: 5 end_location:
end_location: row: 1
row: 1 column: 17
column: 17
- kind: - kind:
UnnecessaryLiteralWithinListCall: tuple UnnecessaryLiteralWithinListCall: tuple
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 2 row: 2
column: 17 column: 17
fix: fix:
patch: content: "[1, 2]"
content: "[1, 2]" location:
location: row: 2
row: 2 column: 5
column: 5 end_location:
end_location: row: 2
row: 2 column: 17
column: 17
- kind: - kind:
UnnecessaryLiteralWithinListCall: list UnnecessaryLiteralWithinListCall: list
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 3 row: 3
column: 13 column: 13
fix: fix:
patch: content: "[]"
content: "[]" location:
location: row: 3
row: 3 column: 5
column: 5 end_location:
end_location: row: 3
row: 3 column: 13
column: 13
- kind: - kind:
UnnecessaryLiteralWithinListCall: tuple UnnecessaryLiteralWithinListCall: tuple
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 4 row: 4
column: 13 column: 13
fix: fix:
patch: content: "[]"
content: "[]" location:
location: row: 4
row: 4 column: 5
column: 5 end_location:
end_location: row: 4
row: 4 column: 13
column: 13

View file

@ -10,12 +10,11 @@ expression: checks
row: 2 row: 2
column: 20 column: 20
fix: fix:
patch: content: "[i for i in x]"
content: "[i for i in x]" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 20
column: 20

View file

@ -11,14 +11,13 @@ expression: checks
row: 3 row: 3
column: 15 column: 15
fix: fix:
patch: content: sorted(x)
content: sorted(x) location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 15
column: 15
- kind: - kind:
UnnecessaryCallAroundSorted: reversed UnnecessaryCallAroundSorted: reversed
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 4 row: 4
column: 19 column: 19
fix: fix:
patch: content: "sorted(x, reverse=True)"
content: "sorted(x, reverse=True)" location:
location: row: 4
row: 4 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 19
column: 19
- kind: - kind:
UnnecessaryCallAroundSorted: reversed UnnecessaryCallAroundSorted: reversed
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 5 row: 5
column: 36 column: 36
fix: fix:
patch: content: "sorted(x, key=lambda e: e, reverse=True)"
content: "sorted(x, key=lambda e: e, reverse=True)" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 36
column: 36
- kind: - kind:
UnnecessaryCallAroundSorted: reversed UnnecessaryCallAroundSorted: reversed
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 6 row: 6
column: 33 column: 33
fix: fix:
patch: content: "sorted(x, reverse=True)"
content: "sorted(x, reverse=True)" location:
location: row: 6
row: 6 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 33
column: 33

View file

@ -11,14 +11,13 @@ expression: checks
row: 2 row: 2
column: 14 column: 14
fix: fix:
patch: content: list(x)
content: list(x) location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 14
column: 14
- kind: - kind:
UnnecessaryComprehension: set UnnecessaryComprehension: set
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 3 row: 3
column: 14 column: 14
fix: fix:
patch: content: set(x)
content: set(x) location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 14
column: 14

View file

@ -32,7 +32,7 @@ pub fn print_call(checker: &mut Checker, expr: &Expr, func: &Expr) {
&deleted, &deleted,
) { ) {
Ok(fix) => { Ok(fix) => {
if fix.patch.content.is_empty() || fix.patch.content == "pass" { if fix.content.is_empty() || fix.content == "pass" {
checker.deletions.insert(context.defined_by); checker.deletions.insert(context.defined_by);
} }
check.amend(fix); check.amend(fix);

View file

@ -10,12 +10,11 @@ expression: checks
row: 1 row: 1
column: 22 column: 22
fix: fix:
patch: content: ""
content: "" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 0
column: 0

View file

@ -10,14 +10,13 @@ expression: checks
row: 3 row: 3
column: 23 column: 23
fix: fix:
patch: content: ""
content: "" location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 0
column: 0
- kind: PPrintFound - kind: PPrintFound
location: location:
row: 8 row: 8
@ -26,12 +25,11 @@ expression: checks
row: 8 row: 8
column: 30 column: 30
fix: fix:
patch: content: ""
content: "" location:
location: row: 8
row: 8 column: 0
column: 0 end_location:
end_location: row: 9
row: 9 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 8 row: 8
column: 0 column: 0
fix: fix:
patch: content: "import os\n\n# This is a comment in the same section, so we need to add one newline.\nimport sys\n\nimport numpy as np\n\n# This is a comment, but it starts a new section, so we don't need to add a newline\n# before it.\nimport leading_prefix\n"
content: "import os\n\n# This is a comment in the same section, so we need to add one newline.\nimport sys\n\nimport numpy as np\n\n# This is a comment, but it starts a new section, so we don't need to add a newline\n# before it.\nimport leading_prefix\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 8
row: 8 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 6 row: 6
column: 0 column: 0
fix: fix:
patch: content: "from collections import (\n AsyncIterable,\n Awaitable,\n ChainMap,\n Collection,\n MutableMapping,\n MutableSequence,\n)\n"
content: "from collections import (\n AsyncIterable,\n Awaitable,\n ChainMap,\n Collection,\n MutableMapping,\n MutableSequence,\n)\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 26 row: 26
column: 0 column: 0
fix: fix:
patch: content: "import B # Comment 4\n\n# Comment 3a\n# Comment 3b\nimport C\nimport D\n\n# Comment 5\n# Comment 6\nfrom A import (\n a, # Comment 7 # Comment 9\n b, # Comment 10\n c, # Comment 8 # Comment 11\n)\n"
content: "import B # Comment 4\n\n# Comment 3a\n# Comment 3b\nimport C\nimport D\n\n# Comment 5\n# Comment 6\nfrom A import (\n a, # Comment 7 # Comment 9\n b, # Comment 10\n c, # Comment 8 # Comment 11\n)\n" location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 26
row: 26 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 5 row: 5
column: 0 column: 0
fix: fix:
patch: content: "import os\nimport os as os1\nimport os as os2\n"
content: "import os\nimport os as os1\nimport os as os2\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 15 row: 15
column: 0 column: 0
fix: fix:
patch: content: " from line_with_88 import aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n from line_with_89 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_90 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_91 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_92 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_93 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n"
content: " from line_with_88 import aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n from line_with_89 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_90 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_91 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_92 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n from line_with_93 import (\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n )\n" location:
location: row: 7
row: 7 column: 0
column: 0 end_location:
end_location: row: 15
row: 15 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 5 row: 5
column: 0 column: 0
fix: fix:
patch: content: "import a\n\n# Don't take this comment into account when determining whether the next import can fit on one line.\nfrom b import c\nfrom d import ( # Do take this comment into account when determining whether the next import can fit on one line.\n e,\n)\n"
content: "import a\n\n# Don't take this comment into account when determining whether the next import can fit on one line.\nfrom b import c\nfrom d import ( # Do take this comment into account when determining whether the next import can fit on one line.\n e,\n)\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 3 row: 3
column: 0 column: 0
fix: fix:
patch: content: "import os\nfrom collections import Collection\n"
content: "import os\nfrom collections import Collection\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 0
column: 0

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 9 column: 9
fix: fix:
patch: content: "\nimport os\nimport sys\n"
content: "\nimport os\nimport sys\n" location:
location: row: 1
row: 1 column: 7
column: 7 end_location:
end_location: row: 3
row: 3 column: 0
column: 0
- kind: UnsortedImports - kind: UnsortedImports
location: location:
row: 5 row: 5
@ -26,12 +25,11 @@ expression: checks
row: 6 row: 6
column: 13 column: 13
fix: fix:
patch: content: "\n import os\n import sys\n"
content: "\n import os\n import sys\n" location:
location: row: 5
row: 5 column: 11
column: 11 end_location:
end_location: row: 7
row: 7 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 13 row: 13
column: 0 column: 0
fix: fix:
patch: content: "import glob\nimport os\nimport shutil\nimport tempfile\nimport time\nfrom subprocess import PIPE, STDOUT, Popen\n\nimport BAR\nimport bar\nimport FOO\nimport foo\nimport StringIO\nfrom module import BASIC, CONSTANT, Apple, Class, function\n"
content: "import glob\nimport os\nimport shutil\nimport tempfile\nimport time\nfrom subprocess import PIPE, STDOUT, Popen\n\nimport BAR\nimport bar\nimport FOO\nimport foo\nimport StringIO\nfrom module import BASIC, CONSTANT, Apple, Class, function\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 13
row: 13 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 5 row: 5
column: 0 column: 0
fix: fix:
patch: content: "from ..a import a\nfrom ..b import a\nfrom .a import a\nfrom .b import a\n"
content: "from ..a import a\nfrom ..b import a\nfrom .a import a\nfrom .b import a\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 12 row: 12
column: 0 column: 0
fix: fix:
patch: content: "import abc\nimport io\n\n# Old MacDonald had a farm,\n# EIEIO\n# And on his farm he had a cow,\n# EIEIO\n# With a moo-moo here and a moo-moo there\n# Here a moo, there a moo, everywhere moo-moo\n# Old MacDonald had a farm,\n# EIEIO\nfrom errno import EIO\n"
content: "import abc\nimport io\n\n# Old MacDonald had a farm,\n# EIEIO\n# And on his farm he had a cow,\n# EIEIO\n# With a moo-moo here and a moo-moo there\n# Here a moo, there a moo, everywhere moo-moo\n# Old MacDonald had a farm,\n# EIEIO\nfrom errno import EIO\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 12
row: 12 column: 0
column: 0

View file

@ -10,14 +10,13 @@ expression: checks
row: 4 row: 4
column: 0 column: 0
fix: fix:
patch: content: " import os\n import sys\n"
content: " import os\n import sys\n" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 0
column: 0
- kind: UnsortedImports - kind: UnsortedImports
location: location:
row: 5 row: 5
@ -26,12 +25,11 @@ expression: checks
row: 7 row: 7
column: 0 column: 0
fix: fix:
patch: content: " import os\n import sys\n"
content: " import os\n import sys\n" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 7
row: 7 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 3 row: 3
column: 0 column: 0
fix: fix:
patch: content: "import os\nimport sys\n"
content: "import os\nimport sys\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 6 row: 6
column: 0 column: 0
fix: fix:
patch: content: "import os\nimport sys\n\nimport numpy as np\n\nimport leading_prefix\nfrom leading_prefix import Class\n"
content: "import os\nimport sys\n\nimport numpy as np\n\nimport leading_prefix\nfrom leading_prefix import Class\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 4 row: 4
column: 0 column: 0
fix: fix:
patch: content: "from __future__ import annotations\n\nimport os\nimport sys\n"
content: "from __future__ import annotations\n\nimport os\nimport sys\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 5 row: 5
column: 0 column: 0
fix: fix:
patch: content: "import os\nimport sys\n\nimport leading_prefix\n\nfrom . import leading_prefix\n"
content: "import os\nimport sys\n\nimport leading_prefix\n\nfrom . import leading_prefix\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 5 row: 5
column: 0 column: 0
fix: fix:
patch: content: "import os\nimport sys\n\nimport numpy as np\nimport pandas as pd\n"
content: "import os\nimport sys\n\nimport numpy as np\nimport pandas as pd\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 11 row: 11
column: 0 column: 0
fix: fix:
patch: content: "import abc\nimport collections\n"
content: "import abc\nimport collections\n" location:
location: row: 9
row: 9 column: 0
column: 0 end_location:
end_location: row: 11
row: 11 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 27 row: 27
column: 0 column: 0
fix: fix:
patch: content: "import A\nimport a\nimport B\nimport b\nimport x\nimport x as A\nimport x as Y\nimport x as a\nimport x as y\nfrom a import BAD as DEF\nfrom a import B, b\nfrom a import B as A\nfrom a import B as Abc\nfrom a import B as DEF\nfrom a import Boo as DEF\nfrom a import b as a\nfrom a import b as c\nfrom a import b as d\nfrom a import b as x\nfrom a import b as y\nfrom b import C, c\nfrom b import c as d\n"
content: "import A\nimport a\nimport B\nimport b\nimport x\nimport x as A\nimport x as Y\nimport x as a\nimport x as y\nfrom a import BAD as DEF\nfrom a import B, b\nfrom a import B as A\nfrom a import B as Abc\nfrom a import B as DEF\nfrom a import Boo as DEF\nfrom a import b as a\nfrom a import b as c\nfrom a import b as d\nfrom a import b as x\nfrom a import b as y\nfrom b import C, c\nfrom b import c as d\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 27
row: 27 column: 0
column: 0

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 9 column: 9
fix: fix:
patch: content: "import os\nimport sys\n"
content: "import os\nimport sys\n" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 0
column: 0
- kind: UnsortedImports - kind: UnsortedImports
location: location:
row: 5 row: 5
@ -26,12 +25,11 @@ expression: checks
row: 6 row: 6
column: 13 column: 13
fix: fix:
patch: content: " import os\n import sys\n"
content: " import os\n import sys\n" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 7
row: 7 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 2 row: 2
column: 14 column: 14
fix: fix:
patch: content: res is None
content: res is None location:
location: row: 2
row: 2 column: 3
column: 3 end_location:
end_location: row: 2
row: 2 column: 14
column: 14
- kind: - kind:
NoneComparison: NotEq NoneComparison: NotEq
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 5 row: 5
column: 14 column: 14
fix: fix:
patch: content: res is not None
content: res is not None location:
location: row: 5
row: 5 column: 3
column: 3 end_location:
end_location: row: 5
row: 5 column: 14
column: 14
- kind: - kind:
NoneComparison: Eq NoneComparison: Eq
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 8 row: 8
column: 7 column: 7
fix: fix:
patch: content: None is res
content: None is res location:
location: row: 8
row: 8 column: 3
column: 3 end_location:
end_location: row: 8
row: 8 column: 14
column: 14
- kind: - kind:
NoneComparison: NotEq NoneComparison: NotEq
location: location:
@ -62,14 +59,13 @@ expression: checks
row: 11 row: 11
column: 7 column: 7
fix: fix:
patch: content: None is not res
content: None is not res location:
location: row: 11
row: 11 column: 3
column: 3 end_location:
end_location: row: 11
row: 11 column: 14
column: 14
- kind: - kind:
NoneComparison: Eq NoneComparison: Eq
location: location:
@ -79,14 +75,13 @@ expression: checks
row: 14 row: 14
column: 17 column: 17
fix: fix:
patch: content: "res[1] is None"
content: "res[1] is None" location:
location: row: 14
row: 14 column: 3
column: 3 end_location:
end_location: row: 14
row: 14 column: 17
column: 17
- kind: - kind:
NoneComparison: NotEq NoneComparison: NotEq
location: location:
@ -96,14 +91,13 @@ expression: checks
row: 17 row: 17
column: 17 column: 17
fix: fix:
patch: content: "res[1] is not None"
content: "res[1] is not None" location:
location: row: 17
row: 17 column: 3
column: 3 end_location:
end_location: row: 17
row: 17 column: 17
column: 17
- kind: - kind:
NoneComparison: NotEq NoneComparison: NotEq
location: location:
@ -113,14 +107,13 @@ expression: checks
row: 20 row: 20
column: 7 column: 7
fix: fix:
patch: content: "None is not res[1]"
content: "None is not res[1]" location:
location: row: 20
row: 20 column: 3
column: 3 end_location:
end_location: row: 20
row: 20 column: 17
column: 17
- kind: - kind:
NoneComparison: Eq NoneComparison: Eq
location: location:
@ -130,14 +123,13 @@ expression: checks
row: 23 row: 23
column: 7 column: 7
fix: fix:
patch: content: "None is res[1]"
content: "None is res[1]" location:
location: row: 23
row: 23 column: 3
column: 3 end_location:
end_location: row: 23
row: 23 column: 17
column: 17
- kind: - kind:
NoneComparison: Eq NoneComparison: Eq
location: location:
@ -147,14 +139,13 @@ expression: checks
row: 26 row: 26
column: 12 column: 12
fix: fix:
patch: content: ""
content: "" location:
location: row: 26
row: 26 column: 3
column: 3 end_location:
end_location: row: 26
row: 26 column: 3
column: 3
- kind: - kind:
NoneComparison: NotEq NoneComparison: NotEq
location: location:
@ -164,12 +155,11 @@ expression: checks
row: 26 row: 26
column: 20 column: 20
fix: fix:
patch: content: x is None is not None
content: x is None is not None location:
location: row: 26
row: 26 column: 3
column: 3 end_location:
end_location: row: 26
row: 26 column: 20
column: 20

View file

@ -13,14 +13,13 @@ expression: checks
row: 2 row: 2
column: 14 column: 14
fix: fix:
patch: content: res is True
content: res is True location:
location: row: 2
row: 2 column: 3
column: 3 end_location:
end_location: row: 2
row: 2 column: 14
column: 14
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- false - false
@ -32,14 +31,13 @@ expression: checks
row: 5 row: 5
column: 15 column: 15
fix: fix:
patch: content: res is not False
content: res is not False location:
location: row: 5
row: 5 column: 3
column: 3 end_location:
end_location: row: 5
row: 5 column: 15
column: 15
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- true - true
@ -51,14 +49,13 @@ expression: checks
row: 8 row: 8
column: 7 column: 7
fix: fix:
patch: content: True is not res
content: True is not res location:
location: row: 8
row: 8 column: 3
column: 3 end_location:
end_location: row: 8
row: 8 column: 14
column: 14
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- false - false
@ -70,14 +67,13 @@ expression: checks
row: 11 row: 11
column: 8 column: 8
fix: fix:
patch: content: False is res
content: False is res location:
location: row: 11
row: 11 column: 3
column: 3 end_location:
end_location: row: 11
row: 11 column: 15
column: 15
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- true - true
@ -89,14 +85,13 @@ expression: checks
row: 14 row: 14
column: 17 column: 17
fix: fix:
patch: content: "res[1] is True"
content: "res[1] is True" location:
location: row: 14
row: 14 column: 3
column: 3 end_location:
end_location: row: 14
row: 14 column: 17
column: 17
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- false - false
@ -108,14 +103,13 @@ expression: checks
row: 17 row: 17
column: 18 column: 18
fix: fix:
patch: content: "res[1] is not False"
content: "res[1] is not False" location:
location: row: 17
row: 17 column: 3
column: 3 end_location:
end_location: row: 17
row: 17 column: 18
column: 18
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- true - true
@ -127,14 +121,13 @@ expression: checks
row: 20 row: 20
column: 23 column: 23
fix: fix:
patch: content: cond is True
content: cond is True location:
location: row: 20
row: 20 column: 11
column: 11 end_location:
end_location: row: 20
row: 20 column: 23
column: 23
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- false - false
@ -146,14 +139,13 @@ expression: checks
row: 20 row: 20
column: 48 column: 48
fix: fix:
patch: content: cond is False
content: cond is False location:
location: row: 20
row: 20 column: 35
column: 35 end_location:
end_location: row: 20
row: 20 column: 48
column: 48
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- true - true
@ -165,14 +157,13 @@ expression: checks
row: 22 row: 22
column: 8 column: 8
fix: fix:
patch: content: True is TrueElement
content: True is TrueElement location:
location: row: 22
row: 22 column: 3
column: 3 end_location:
end_location: row: 22
row: 22 column: 24
column: 24
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- true - true
@ -184,14 +175,13 @@ expression: checks
row: 25 row: 25
column: 14 column: 14
fix: fix:
patch: content: ""
content: "" location:
location: row: 25
row: 25 column: 3
column: 3 end_location:
end_location: row: 25
row: 25 column: 3
column: 3
- kind: - kind:
TrueFalseComparison: TrueFalseComparison:
- false - false
@ -203,12 +193,11 @@ expression: checks
row: 25 row: 25
column: 23 column: 23
fix: fix:
patch: content: res is True is not False
content: res is True is not False location:
location: row: 25
row: 25 column: 3
column: 3 end_location:
end_location: row: 25
row: 25 column: 23
column: 23

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 13 column: 13
fix: fix:
patch: content: X not in Y
content: X not in Y location:
location: row: 2
row: 2 column: 3
column: 3 end_location:
end_location: row: 2
row: 2 column: 13
column: 13
- kind: NotInTest - kind: NotInTest
location: location:
row: 5 row: 5
@ -26,14 +25,13 @@ expression: checks
row: 5 row: 5
column: 15 column: 15
fix: fix:
patch: content: X.B not in Y
content: X.B not in Y location:
location: row: 5
row: 5 column: 3
column: 3 end_location:
end_location: row: 5
row: 5 column: 15
column: 15
- kind: NotInTest - kind: NotInTest
location: location:
row: 8 row: 8
@ -42,14 +40,13 @@ expression: checks
row: 8 row: 8
column: 13 column: 13
fix: fix:
patch: content: X not in Y
content: X not in Y location:
location: row: 8
row: 8 column: 3
column: 3 end_location:
end_location: row: 8
row: 8 column: 13
column: 13
- kind: NotInTest - kind: NotInTest
location: location:
row: 11 row: 11
@ -58,14 +55,13 @@ expression: checks
row: 11 row: 11
column: 28 column: 28
fix: fix:
patch: content: Y not in Z
content: Y not in Z location:
location: row: 11
row: 11 column: 18
column: 18 end_location:
end_location: row: 11
row: 11 column: 28
column: 28
- kind: NotInTest - kind: NotInTest
location: location:
row: 14 row: 14
@ -74,12 +70,11 @@ expression: checks
row: 14 row: 14
column: 14 column: 14
fix: fix:
patch: content: X not in Y
content: X not in Y location:
location: row: 14
row: 14 column: 3
column: 3 end_location:
end_location: row: 14
row: 14 column: 15
column: 15

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 13 column: 13
fix: fix:
patch: content: X is not Y
content: X is not Y location:
location: row: 2
row: 2 column: 3
column: 3 end_location:
end_location: row: 2
row: 2 column: 13
column: 13
- kind: NotIsTest - kind: NotIsTest
location: location:
row: 5 row: 5
@ -26,14 +25,13 @@ expression: checks
row: 5 row: 5
column: 15 column: 15
fix: fix:
patch: content: X.B is not Y
content: X.B is not Y location:
location: row: 5
row: 5 column: 3
column: 3 end_location:
end_location: row: 5
row: 5 column: 15
column: 15
- kind: NotIsTest - kind: NotIsTest
location: location:
row: 8 row: 8

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 19 column: 19
fix: fix:
patch: content: "def f(x):\n return (2 * x)"
content: "def f(x):\n return (2 * x)" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 19
column: 19
- kind: DoNotAssignLambda - kind: DoNotAssignLambda
location: location:
row: 4 row: 4
@ -26,14 +25,13 @@ expression: checks
row: 4 row: 4
column: 19 column: 19
fix: fix:
patch: content: "def f(x):\n return (2 * x)"
content: "def f(x):\n return (2 * x)" location:
location: row: 4
row: 4 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 19
column: 19
- kind: DoNotAssignLambda - kind: DoNotAssignLambda
location: location:
row: 7 row: 7
@ -42,12 +40,11 @@ expression: checks
row: 7 row: 7
column: 29 column: 29
fix: fix:
patch: content: "def this(y, z):\n return (2 * x)"
content: "def this(y, z):\n return (2 * x)" location:
location: row: 7
row: 7 column: 4
column: 4 end_location:
end_location: row: 7
row: 7 column: 29
column: 29

View file

@ -11,14 +11,13 @@ expression: checks
row: 137 row: 137
column: 24 column: 24
fix: fix:
patch: content: ""
content: "" location:
location: row: 136
row: 136 column: 0
column: 0 end_location:
end_location: row: 137
row: 137 column: 0
column: 0
- kind: - kind:
NoBlankLineBeforeFunction: 1 NoBlankLineBeforeFunction: 1
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 151 row: 151
column: 37 column: 37
fix: fix:
patch: content: ""
content: "" location:
location: row: 150
row: 150 column: 0
column: 0 end_location:
end_location: row: 151
row: 151 column: 0
column: 0
- kind: - kind:
NoBlankLineBeforeFunction: 1 NoBlankLineBeforeFunction: 1
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 549 row: 549
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 545
row: 545 column: 0
column: 0 end_location:
end_location: row: 546
row: 546 column: 0
column: 0
- kind: - kind:
NoBlankLineBeforeFunction: 1 NoBlankLineBeforeFunction: 1
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 571 row: 571
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 567
row: 567 column: 0
column: 0 end_location:
end_location: row: 568
row: 568 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 142 row: 142
column: 24 column: 24
fix: fix:
patch: content: ""
content: "" location:
location: row: 143
row: 143 column: 0
column: 0 end_location:
end_location: row: 144
row: 144 column: 0
column: 0
- kind: - kind:
NoBlankLineAfterFunction: 1 NoBlankLineAfterFunction: 1
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 151 row: 151
column: 37 column: 37
fix: fix:
patch: content: ""
content: "" location:
location: row: 152
row: 152 column: 0
column: 0 end_location:
end_location: row: 153
row: 153 column: 0
column: 0
- kind: - kind:
NoBlankLineAfterFunction: 1 NoBlankLineAfterFunction: 1
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 558 row: 558
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 559
row: 559 column: 0
column: 0 end_location:
end_location: row: 560
row: 560 column: 0
column: 0
- kind: - kind:
NoBlankLineAfterFunction: 1 NoBlankLineAfterFunction: 1
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 571 row: 571
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 572
row: 572 column: 0
column: 0 end_location:
end_location: row: 573
row: 573 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 161 row: 161
column: 32 column: 32
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 161
row: 161 column: 0
column: 0 end_location:
end_location: row: 161
row: 161 column: 0
column: 0
- kind: - kind:
OneBlankLineBeforeClass: 0 OneBlankLineBeforeClass: 0
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 192 row: 192
column: 45 column: 45
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 192
row: 192 column: 0
column: 0 end_location:
end_location: row: 192
row: 192 column: 0
column: 0
- kind: - kind:
OneBlankLineBeforeClass: 0 OneBlankLineBeforeClass: 0
location: location:
@ -45,12 +43,11 @@ expression: checks
row: 532 row: 532
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 526
row: 526 column: 0
column: 0 end_location:
end_location: row: 526
row: 526 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 181 row: 181
column: 24 column: 24
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 182
row: 182 column: 0
column: 0 end_location:
end_location: row: 182
row: 182 column: 0
column: 0
- kind: - kind:
OneBlankLineAfterClass: 0 OneBlankLineAfterClass: 0
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 192 row: 192
column: 45 column: 45
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 193
row: 193 column: 0
column: 0 end_location:
end_location: row: 193
row: 193 column: 0
column: 0

View file

@ -10,14 +10,13 @@ expression: checks
row: 203 row: 203
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 201
row: 201 column: 0
column: 0 end_location:
end_location: row: 201
row: 201 column: 0
column: 0
- kind: BlankLineAfterSummary - kind: BlankLineAfterSummary
location: location:
row: 210 row: 210
@ -26,12 +25,11 @@ expression: checks
row: 215 row: 215
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 211
row: 211 column: 0
column: 0 end_location:
end_location: row: 213
row: 213 column: 0
column: 0

View file

@ -10,14 +10,13 @@ expression: checks
row: 232 row: 232
column: 0 column: 0
fix: fix:
patch: content: " "
content: " " location:
location: row: 232
row: 232 column: 0
column: 0 end_location:
end_location: row: 232
row: 232 column: 0
column: 0
- kind: NoUnderIndentation - kind: NoUnderIndentation
location: location:
row: 440 row: 440
@ -26,12 +25,11 @@ expression: checks
row: 440 row: 440
column: 0 column: 0
fix: fix:
patch: content: " "
content: " " location:
location: row: 440
row: 440 column: 0
column: 0 end_location:
end_location: row: 440
row: 440 column: 4
column: 4

View file

@ -10,14 +10,13 @@ expression: checks
row: 252 row: 252
column: 0 column: 0
fix: fix:
patch: content: " "
content: " " location:
location: row: 252
row: 252 column: 0
column: 0 end_location:
end_location: row: 252
row: 252 column: 7
column: 7
- kind: NoOverIndentation - kind: NoOverIndentation
location: location:
row: 264 row: 264
@ -26,14 +25,13 @@ expression: checks
row: 264 row: 264
column: 0 column: 0
fix: fix:
patch: content: " "
content: " " location:
location: row: 264
row: 264 column: 0
column: 0 end_location:
end_location: row: 264
row: 264 column: 8
column: 8
- kind: NoOverIndentation - kind: NoOverIndentation
location: location:
row: 272 row: 272
@ -42,12 +40,11 @@ expression: checks
row: 272 row: 272
column: 0 column: 0
fix: fix:
patch: content: " "
content: " " location:
location: row: 272
row: 272 column: 0
column: 0 end_location:
end_location: row: 272
row: 272 column: 8
column: 8

View file

@ -10,12 +10,11 @@ expression: checks
row: 283 row: 283
column: 19 column: 19
fix: fix:
patch: content: "\n "
content: "\n " location:
location: row: 283
row: 283 column: 16
column: 16 end_location:
end_location: row: 283
row: 283 column: 16
column: 16

View file

@ -10,14 +10,13 @@ expression: checks
row: 288 row: 288
column: 33 column: 33
fix: fix:
patch: content: Whitespace at the end.
content: Whitespace at the end. location:
location: row: 288
row: 288 column: 7
column: 7 end_location:
end_location: row: 288
row: 288 column: 30
column: 30
- kind: NoSurroundingWhitespace - kind: NoSurroundingWhitespace
location: location:
row: 293 row: 293
@ -26,14 +25,13 @@ expression: checks
row: 293 row: 293
column: 37 column: 37
fix: fix:
patch: content: Whitespace at everywhere.
content: Whitespace at everywhere. location:
location: row: 293
row: 293 column: 7
column: 7 end_location:
end_location: row: 293
row: 293 column: 34
column: 34
- kind: NoSurroundingWhitespace - kind: NoSurroundingWhitespace
location: location:
row: 299 row: 299
@ -42,12 +40,11 @@ expression: checks
row: 302 row: 302
column: 7 column: 7
fix: fix:
patch: content: Whitespace at the beginning.
content: Whitespace at the beginning. location:
location: row: 299
row: 299 column: 7
column: 7 end_location:
end_location: row: 299
row: 299 column: 36
column: 36

View file

@ -11,14 +11,13 @@ expression: checks
row: 170 row: 170
column: 29 column: 29
fix: fix:
patch: content: ""
content: "" location:
location: row: 169
row: 169 column: 0
column: 0 end_location:
end_location: row: 170
row: 170 column: 0
column: 0
- kind: - kind:
NoBlankLineBeforeClass: 1 NoBlankLineBeforeClass: 1
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 181 row: 181
column: 24 column: 24
fix: fix:
patch: content: ""
content: "" location:
location: row: 180
row: 180 column: 0
column: 0 end_location:
end_location: row: 181
row: 181 column: 0
column: 0

View file

@ -11,12 +11,11 @@ expression: checks
row: 141 row: 141
column: 7 column: 7
fix: fix:
patch: content: " "
content: " " location:
location: row: 137
row: 137 column: 0
column: 0 end_location:
end_location: row: 137
row: 137 column: 8
column: 8

View file

@ -11,14 +11,13 @@ expression: checks
row: 153 row: 153
column: 7 column: 7
fix: fix:
patch: content: " "
content: " " location:
location: row: 150
row: 150 column: 0
column: 0 end_location:
end_location: row: 150
row: 150 column: 9
column: 9
- kind: - kind:
SectionUnderlineNotOverIndented: Returns SectionUnderlineNotOverIndented: Returns
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 165 row: 165
column: 7 column: 7
fix: fix:
patch: content: " "
content: " " location:
location: row: 164
row: 164 column: 0
column: 0 end_location:
end_location: row: 164
row: 164 column: 9
column: 9

View file

@ -11,14 +11,13 @@ expression: checks
row: 23 row: 23
column: 7 column: 7
fix: fix:
patch: content: Returns
content: Returns location:
location: row: 19
row: 19 column: 4
column: 4 end_location:
end_location: row: 19
row: 19 column: 11
column: 11
- kind: - kind:
CapitalizeSectionName: Short summary CapitalizeSectionName: Short summary
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 221 row: 221
column: 7 column: 7
fix: fix:
patch: content: Short Summary
content: Short Summary location:
location: row: 209
row: 209 column: 4
column: 4 end_location:
end_location: row: 209
row: 209 column: 17
column: 17

View file

@ -11,14 +11,13 @@ expression: checks
row: 36 row: 36
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 32
row: 32 column: 11
column: 11 end_location:
end_location: row: 32
row: 32 column: 12
column: 12
- kind: - kind:
NewLineAfterSectionName: Raises NewLineAfterSectionName: Raises
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 221 row: 221
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 218
row: 218 column: 10
column: 10 end_location:
end_location: row: 218
row: 218 column: 11
column: 11
- kind: - kind:
NewLineAfterSectionName: Returns NewLineAfterSectionName: Returns
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 262 row: 262
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 257
row: 257 column: 11
column: 11 end_location:
end_location: row: 257
row: 257 column: 12
column: 12
- kind: - kind:
NewLineAfterSectionName: Raises NewLineAfterSectionName: Raises
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 262 row: 262
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 259
row: 259 column: 10
column: 10 end_location:
end_location: row: 259
row: 259 column: 11
column: 11

View file

@ -11,14 +11,13 @@ expression: checks
row: 47 row: 47
column: 7 column: 7
fix: fix:
patch: content: " -------\n"
content: " -------\n" location:
location: row: 45
row: 45 column: 0
column: 0 end_location:
end_location: row: 45
row: 45 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Returns DashedUnderlineAfterSection: Returns
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 58 row: 58
column: 7 column: 7
fix: fix:
patch: content: " -------\n"
content: " -------\n" location:
location: row: 57
row: 57 column: 0
column: 0 end_location:
end_location: row: 57
row: 57 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Raises DashedUnderlineAfterSection: Raises
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 221 row: 221
column: 7 column: 7
fix: fix:
patch: content: " ------\n"
content: " ------\n" location:
location: row: 219
row: 219 column: 0
column: 0 end_location:
end_location: row: 219
row: 219 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Returns DashedUnderlineAfterSection: Returns
location: location:
@ -62,14 +59,13 @@ expression: checks
row: 262 row: 262
column: 7 column: 7
fix: fix:
patch: content: " -------\n"
content: " -------\n" location:
location: row: 258
row: 258 column: 0
column: 0 end_location:
end_location: row: 258
row: 258 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Raises DashedUnderlineAfterSection: Raises
location: location:
@ -79,14 +75,13 @@ expression: checks
row: 262 row: 262
column: 7 column: 7
fix: fix:
patch: content: " ------\n"
content: " ------\n" location:
location: row: 260
row: 260 column: 0
column: 0 end_location:
end_location: row: 260
row: 260 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -96,14 +91,13 @@ expression: checks
row: 274 row: 274
column: 7 column: 7
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 272
row: 272 column: 0
column: 0 end_location:
end_location: row: 272
row: 272 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -113,14 +107,13 @@ expression: checks
row: 292 row: 292
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 289
row: 289 column: 0
column: 0 end_location:
end_location: row: 289
row: 289 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -130,14 +123,13 @@ expression: checks
row: 306 row: 306
column: 7 column: 7
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 304
row: 304 column: 0
column: 0 end_location:
end_location: row: 304
row: 304 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -147,14 +139,13 @@ expression: checks
row: 319 row: 319
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 316
row: 316 column: 0
column: 0 end_location:
end_location: row: 316
row: 316 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -164,14 +155,13 @@ expression: checks
row: 330 row: 330
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 328
row: 328 column: 0
column: 0 end_location:
end_location: row: 328
row: 328 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -181,14 +171,13 @@ expression: checks
row: 343 row: 343
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 340
row: 340 column: 0
column: 0 end_location:
end_location: row: 340
row: 340 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -198,14 +187,13 @@ expression: checks
row: 355 row: 355
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 353
row: 353 column: 0
column: 0 end_location:
end_location: row: 353
row: 353 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -215,14 +203,13 @@ expression: checks
row: 367 row: 367
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 365
row: 365 column: 0
column: 0 end_location:
end_location: row: 365
row: 365 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -232,14 +219,13 @@ expression: checks
row: 382 row: 382
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 374
row: 374 column: 0
column: 0 end_location:
end_location: row: 374
row: 374 column: 0
column: 0
- kind: - kind:
DashedUnderlineAfterSection: Args DashedUnderlineAfterSection: Args
location: location:
@ -249,12 +235,11 @@ expression: checks
row: 497 row: 497
column: 11 column: 11
fix: fix:
patch: content: " ----\n"
content: " ----\n" location:
location: row: 495
row: 495 column: 0
column: 0 end_location:
end_location: row: 495
row: 495 column: 0
column: 0

View file

@ -11,12 +11,11 @@ expression: checks
row: 92 row: 92
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 88
row: 88 column: 0
column: 0 end_location:
end_location: row: 89
row: 89 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 105 row: 105
column: 7 column: 7
fix: fix:
patch: content: " -------\n"
content: " -------\n" location:
location: row: 102
row: 102 column: 0
column: 0 end_location:
end_location: row: 103
row: 103 column: 0
column: 0
- kind: - kind:
SectionUnderlineMatchesSectionLength: Returns SectionUnderlineMatchesSectionLength: Returns
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 221 row: 221
column: 7 column: 7
fix: fix:
patch: content: " -------\n"
content: " -------\n" location:
location: row: 216
row: 216 column: 0
column: 0 end_location:
end_location: row: 217
row: 217 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 78 row: 78
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 71
row: 71 column: 0
column: 0 end_location:
end_location: row: 71
row: 71 column: 0
column: 0
- kind: - kind:
BlankLineAfterSection: Returns BlankLineAfterSection: Returns
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 221 row: 221
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 218
row: 218 column: 0
column: 0 end_location:
end_location: row: 218
row: 218 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 78 row: 78
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 71
row: 71 column: 0
column: 0 end_location:
end_location: row: 71
row: 71 column: 0
column: 0
- kind: - kind:
BlankLineBeforeSection: Returns BlankLineBeforeSection: Returns
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 129 row: 129
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 125
row: 125 column: 0
column: 0 end_location:
end_location: row: 125
row: 125 column: 0
column: 0
- kind: - kind:
BlankLineBeforeSection: Raises BlankLineBeforeSection: Raises
location: location:
@ -45,12 +43,11 @@ expression: checks
row: 221 row: 221
column: 7 column: 7
fix: fix:
patch: content: "\n"
content: "\n" location:
location: row: 218
row: 218 column: 0
column: 0 end_location:
end_location: row: 218
row: 218 column: 0
column: 0

View file

@ -11,12 +11,11 @@ expression: checks
row: 221 row: 221
column: 7 column: 7
fix: fix:
patch: content: ""
content: "" location:
location: row: 211
row: 211 column: 0
column: 0 end_location:
end_location: row: 212
row: 212 column: 0
column: 0

View file

@ -13,14 +13,13 @@ expression: checks
row: 2 row: 2
column: 16 column: 16
fix: fix:
patch: content: import os
content: import os location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 20
column: 20
- kind: - kind:
UnusedImport: UnusedImport:
- collections.OrderedDict - collections.OrderedDict
@ -32,14 +31,13 @@ expression: checks
row: 6 row: 6
column: 15 column: 15
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 column: 0
column: 0 end_location:
end_location: row: 8
row: 8 column: 1
column: 1
- kind: - kind:
UnusedImport: UnusedImport:
- logging.handlers - logging.handlers
@ -51,14 +49,13 @@ expression: checks
row: 12 row: 12
column: 23 column: 23
fix: fix:
patch: content: ""
content: "" location:
location: row: 12
row: 12 column: 0
column: 0 end_location:
end_location: row: 13
row: 13 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- shelve - shelve
@ -70,14 +67,13 @@ expression: checks
row: 32 row: 32
column: 17 column: 17
fix: fix:
patch: content: ""
content: "" location:
location: row: 32
row: 32 column: 0
column: 0 end_location:
end_location: row: 33
row: 33 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- importlib - importlib
@ -89,14 +85,13 @@ expression: checks
row: 33 row: 33
column: 20 column: 20
fix: fix:
patch: content: pass
content: pass location:
location: row: 33
row: 33 column: 4
column: 4 end_location:
end_location: row: 33
row: 33 column: 20
column: 20
- kind: - kind:
UnusedImport: UnusedImport:
- pathlib - pathlib
@ -108,14 +103,13 @@ expression: checks
row: 37 row: 37
column: 18 column: 18
fix: fix:
patch: content: ""
content: "" location:
location: row: 37
row: 37 column: 0
column: 0 end_location:
end_location: row: 38
row: 38 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- pickle - pickle
@ -127,12 +121,11 @@ expression: checks
row: 52 row: 52
column: 21 column: 21
fix: fix:
patch: content: pass
content: pass location:
location: row: 52
row: 52 column: 8
column: 8 end_location:
end_location: row: 52
row: 52 column: 21
column: 21

View file

@ -13,14 +13,13 @@ expression: checks
row: 2 row: 2
column: 17 column: 17
fix: fix:
patch: content: ""
content: "" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- d.e.f - d.e.f
@ -32,14 +31,13 @@ expression: checks
row: 3 row: 3
column: 22 column: 22
fix: fix:
patch: content: ""
content: "" location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- h.i - h.i
@ -51,14 +49,13 @@ expression: checks
row: 4 row: 4
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 4
row: 4 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- j.k - j.k
@ -70,12 +67,11 @@ expression: checks
row: 5 row: 5
column: 15 column: 15
fix: fix:
patch: content: ""
content: "" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 0
column: 0

View file

@ -13,14 +13,13 @@ expression: checks
row: 7 row: 7
column: 39 column: 39
fix: fix:
patch: content: ""
content: "" location:
location: row: 7
row: 7 column: 0
column: 0 end_location:
end_location: row: 8
row: 8 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- datastructures.UploadFile - datastructures.UploadFile
@ -32,14 +31,13 @@ expression: checks
row: 10 row: 10
column: 52 column: 52
fix: fix:
patch: content: ""
content: "" location:
location: row: 10
row: 10 column: 0
column: 0 end_location:
end_location: row: 11
row: 11 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- background - background
@ -51,14 +49,13 @@ expression: checks
row: 17 row: 17
column: 17 column: 17
fix: fix:
patch: content: ""
content: "" location:
location: row: 17
row: 17 column: 0
column: 0 end_location:
end_location: row: 18
row: 18 column: 0
column: 0
- kind: - kind:
UnusedImport: UnusedImport:
- datastructures - datastructures
@ -70,12 +67,11 @@ expression: checks
row: 20 row: 20
column: 35 column: 35
fix: fix:
patch: content: ""
content: "" location:
location: row: 20
row: 20 column: 0
column: 0 end_location:
end_location: row: 21
row: 21 column: 0
column: 0

View file

@ -10,14 +10,13 @@ expression: checks
row: 1 row: 1
column: 13 column: 13
fix: fix:
patch: content: "x == \"abc\""
content: "x == \"abc\"" location:
location: row: 1
row: 1 column: 3
column: 3 end_location:
end_location: row: 1
row: 1 column: 13
column: 13
- kind: IsLiteral - kind: IsLiteral
location: location:
row: 4 row: 4
@ -26,14 +25,13 @@ expression: checks
row: 4 row: 4
column: 15 column: 15
fix: fix:
patch: content: 123 != y
content: 123 != y location:
location: row: 4
row: 4 column: 3
column: 3 end_location:
end_location: row: 4
row: 4 column: 15
column: 15
- kind: IsLiteral - kind: IsLiteral
location: location:
row: 7 row: 7
@ -42,12 +40,11 @@ expression: checks
row: 7 row: 7
column: 17 column: 17
fix: fix:
patch: content: "\"123\" == x"
content: "\"123\" == x" location:
location: row: 7
row: 7 column: 3
column: 3 end_location:
end_location: row: 7
row: 7 column: 13
column: 13

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 24 column: 24
fix: fix:
patch: content: NotImplementedError
content: NotImplementedError location:
location: row: 2
row: 2 column: 10
column: 10 end_location:
end_location: row: 2
row: 2 column: 24
column: 24
- kind: RaiseNotImplemented - kind: RaiseNotImplemented
location: location:
row: 6 row: 6
@ -26,12 +25,11 @@ expression: checks
row: 6 row: 6
column: 24 column: 24
fix: fix:
patch: content: NotImplementedError
content: NotImplementedError location:
location: row: 6
row: 6 column: 10
column: 10 end_location:
end_location: row: 6
row: 6 column: 24
column: 24

View file

@ -13,14 +13,13 @@ expression: checks
row: 8 row: 8
column: 7 column: 7
fix: fix:
patch: content: "from models import (\n Fruit,\n)"
content: "from models import (\n Fruit,\n)" location:
location: row: 6
row: 6 column: 0
column: 0 end_location:
end_location: row: 9
row: 9 column: 1
column: 1
- kind: - kind:
UndefinedName: Bar UndefinedName: Bar
location: location:

View file

@ -71,7 +71,7 @@ pub fn unnecessary_future_import(checker: &mut Checker, stmt: &Stmt, names: &[Lo
&deleted, &deleted,
) { ) {
Ok(fix) => { Ok(fix) => {
if fix.patch.content.is_empty() || fix.patch.content == "pass" { if fix.content.is_empty() || fix.content == "pass" {
checker.deletions.insert(context.defined_by); checker.deletions.insert(context.defined_by);
} }
check.amend(fix); check.amend(fix);

View file

@ -25,7 +25,7 @@ pub fn useless_metaclass_type(checker: &mut Checker, stmt: &Stmt, value: &Expr,
&deleted, &deleted,
) { ) {
Ok(fix) => { Ok(fix) => {
if fix.patch.content.is_empty() || fix.patch.content == "pass" { if fix.content.is_empty() || fix.content == "pass" {
checker.deletions.insert(context.defined_by); checker.deletions.insert(context.defined_by);
} }
check.amend(fix); check.amend(fix);

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 24 column: 24
fix: fix:
patch: content: pass
content: pass location:
location: row: 2
row: 2 column: 4
column: 4 end_location:
end_location: row: 2
row: 2 column: 24
column: 24
- kind: UselessMetaclassType - kind: UselessMetaclassType
location: location:
row: 6 row: 6
@ -26,12 +25,11 @@ expression: checks
row: 6 row: 6
column: 24 column: 24
fix: fix:
patch: content: ""
content: "" location:
location: row: 6
row: 6 column: 0
column: 0 end_location:
end_location: row: 7
row: 7 column: 0
column: 0

View file

@ -11,14 +11,13 @@ expression: checks
row: 1 row: 1
column: 8 column: 8
fix: fix:
patch: content: str
content: str location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 1
row: 1 column: 8
column: 8
- kind: - kind:
TypeOfPrimitive: Bytes TypeOfPrimitive: Bytes
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 2 row: 2
column: 9 column: 9
fix: fix:
patch: content: bytes
content: bytes location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 9
column: 9
- kind: - kind:
TypeOfPrimitive: Int TypeOfPrimitive: Int
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 3 row: 3
column: 7 column: 7
fix: fix:
patch: content: int
content: int location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 7
column: 7
- kind: - kind:
TypeOfPrimitive: Float TypeOfPrimitive: Float
location: location:
@ -62,14 +59,13 @@ expression: checks
row: 4 row: 4
column: 8 column: 8
fix: fix:
patch: content: float
content: float location:
location: row: 4
row: 4 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 8
column: 8
- kind: - kind:
TypeOfPrimitive: Complex TypeOfPrimitive: Complex
location: location:
@ -79,12 +75,11 @@ expression: checks
row: 5 row: 5
column: 8 column: 8
fix: fix:
patch: content: complex
content: complex location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 8
column: 8

View file

@ -11,14 +11,13 @@ expression: checks
row: 5 row: 5
column: 14 column: 14
fix: fix:
patch: content: ""
content: "" location:
location: row: 5
row: 5 column: 7
column: 7 end_location:
end_location: row: 5
row: 5 column: 15
column: 15
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 10 row: 10
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 9
row: 9 column: 7
column: 7 end_location:
end_location: row: 11
row: 11 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 16 row: 16
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 15
row: 15 column: 7
column: 7 end_location:
end_location: row: 18
row: 18 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -62,14 +59,13 @@ expression: checks
row: 24 row: 24
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 22
row: 22 column: 7
column: 7 end_location:
end_location: row: 25
row: 25 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -79,14 +75,13 @@ expression: checks
row: 31 row: 31
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 29
row: 29 column: 7
column: 7 end_location:
end_location: row: 32
row: 32 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -96,14 +91,13 @@ expression: checks
row: 37 row: 37
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 36
row: 36 column: 7
column: 7 end_location:
end_location: row: 39
row: 39 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -113,14 +107,13 @@ expression: checks
row: 45 row: 45
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 43
row: 43 column: 7
column: 7 end_location:
end_location: row: 47
row: 47 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -130,14 +123,13 @@ expression: checks
row: 53 row: 53
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 51
row: 51 column: 7
column: 7 end_location:
end_location: row: 55
row: 55 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -147,14 +139,13 @@ expression: checks
row: 61 row: 61
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 59
row: 59 column: 7
column: 7 end_location:
end_location: row: 63
row: 63 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -164,14 +155,13 @@ expression: checks
row: 69 row: 69
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 67
row: 67 column: 7
column: 7 end_location:
end_location: row: 71
row: 71 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: B UselessObjectInheritance: B
location: location:
@ -181,14 +171,13 @@ expression: checks
row: 75 row: 75
column: 17 column: 17
fix: fix:
patch: content: ""
content: "" location:
location: row: 75
row: 75 column: 9
column: 9 end_location:
end_location: row: 75
row: 75 column: 17
column: 17
- kind: - kind:
UselessObjectInheritance: B UselessObjectInheritance: B
location: location:
@ -198,14 +187,13 @@ expression: checks
row: 79 row: 79
column: 14 column: 14
fix: fix:
patch: content: ""
content: "" location:
location: row: 79
row: 79 column: 8
column: 8 end_location:
end_location: row: 79
row: 79 column: 16
column: 16
- kind: - kind:
UselessObjectInheritance: B UselessObjectInheritance: B
location: location:
@ -215,14 +203,13 @@ expression: checks
row: 84 row: 84
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 84
row: 84 column: 4
column: 4 end_location:
end_location: row: 85
row: 85 column: 4
column: 4
- kind: - kind:
UselessObjectInheritance: B UselessObjectInheritance: B
location: location:
@ -232,14 +219,13 @@ expression: checks
row: 92 row: 92
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 91
row: 91 column: 5
column: 5 end_location:
end_location: row: 92
row: 92 column: 10
column: 10
- kind: - kind:
UselessObjectInheritance: B UselessObjectInheritance: B
location: location:
@ -249,14 +235,13 @@ expression: checks
row: 98 row: 98
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 98
row: 98 column: 4
column: 4 end_location:
end_location: row: 99
row: 99 column: 4
column: 4
- kind: - kind:
UselessObjectInheritance: B UselessObjectInheritance: B
location: location:
@ -266,14 +251,13 @@ expression: checks
row: 108 row: 108
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 107
row: 107 column: 5
column: 5 end_location:
end_location: row: 108
row: 108 column: 10
column: 10
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -283,14 +267,13 @@ expression: checks
row: 114 row: 114
column: 18 column: 18
fix: fix:
patch: content: ""
content: "" location:
location: row: 114
row: 114 column: 11
column: 11 end_location:
end_location: row: 114
row: 114 column: 19
column: 19
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -300,14 +283,13 @@ expression: checks
row: 119 row: 119
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 118
row: 118 column: 7
column: 7 end_location:
end_location: row: 120
row: 120 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -317,14 +299,13 @@ expression: checks
row: 125 row: 125
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 124
row: 124 column: 7
column: 7 end_location:
end_location: row: 126
row: 126 column: 1
column: 1
- kind: - kind:
UselessObjectInheritance: A UselessObjectInheritance: A
location: location:
@ -334,12 +315,11 @@ expression: checks
row: 131 row: 131
column: 10 column: 10
fix: fix:
patch: content: ""
content: "" location:
location: row: 130
row: 130 column: 7
column: 7 end_location:
end_location: row: 133
row: 133 column: 1
column: 1

View file

@ -13,14 +13,13 @@ expression: checks
row: 6 row: 6
column: 25 column: 25
fix: fix:
patch: content: self.assertEqual
content: self.assertEqual location:
location: row: 6
row: 6 column: 8
column: 8 end_location:
end_location: row: 6
row: 6 column: 25
column: 25
- kind: - kind:
DeprecatedUnittestAlias: DeprecatedUnittestAlias:
- assertEquals - assertEquals
@ -32,14 +31,13 @@ expression: checks
row: 7 row: 7
column: 25 column: 25
fix: fix:
patch: content: self.assertEqual
content: self.assertEqual location:
location: row: 7
row: 7 column: 8
column: 8 end_location:
end_location: row: 7
row: 7 column: 25
column: 25
- kind: - kind:
DeprecatedUnittestAlias: DeprecatedUnittestAlias:
- failUnlessAlmostEqual - failUnlessAlmostEqual
@ -51,14 +49,13 @@ expression: checks
row: 9 row: 9
column: 34 column: 34
fix: fix:
patch: content: self.assertAlmostEqual
content: self.assertAlmostEqual location:
location: row: 9
row: 9 column: 8
column: 8 end_location:
end_location: row: 9
row: 9 column: 34
column: 34
- kind: - kind:
DeprecatedUnittestAlias: DeprecatedUnittestAlias:
- assertNotRegexpMatches - assertNotRegexpMatches
@ -70,12 +67,11 @@ expression: checks
row: 10 row: 10
column: 35 column: 35
fix: fix:
patch: content: self.assertNotRegex
content: self.assertNotRegex location:
location: row: 10
row: 10 column: 8
column: 8 end_location:
end_location: row: 10
row: 10 column: 35
column: 35

View file

@ -11,14 +11,13 @@ expression: checks
row: 4 row: 4
column: 20 column: 20
fix: fix:
patch: content: list
content: list location:
location: row: 4
row: 4 column: 9
column: 9 end_location:
end_location: row: 4
row: 4 column: 20
column: 20
- kind: - kind:
UsePEP585Annotation: List UsePEP585Annotation: List
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 11 row: 11
column: 13 column: 13
fix: fix:
patch: content: list
content: list location:
location: row: 11
row: 11 column: 9
column: 9 end_location:
end_location: row: 11
row: 11 column: 13
column: 13
- kind: - kind:
UsePEP585Annotation: List UsePEP585Annotation: List
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 18 row: 18
column: 15 column: 15
fix: fix:
patch: content: list
content: list location:
location: row: 18
row: 18 column: 9
column: 9 end_location:
end_location: row: 18
row: 18 column: 15
column: 15
- kind: - kind:
UsePEP585Annotation: List UsePEP585Annotation: List
location: location:
@ -62,12 +59,11 @@ expression: checks
row: 25 row: 25
column: 14 column: 14
fix: fix:
patch: content: list
content: list location:
location: row: 25
row: 25 column: 9
column: 9 end_location:
end_location: row: 25
row: 25 column: 14
column: 14

View file

@ -10,14 +10,13 @@ expression: checks
row: 6 row: 6
column: 22 column: 22
fix: fix:
patch: content: str | None
content: str | None location:
location: row: 6
row: 6 column: 9
column: 9 end_location:
end_location: row: 6
row: 6 column: 22
column: 22
- kind: UsePEP604Annotation - kind: UsePEP604Annotation
location: location:
row: 10 row: 10
@ -26,14 +25,13 @@ expression: checks
row: 10 row: 10
column: 29 column: 29
fix: fix:
patch: content: str | None
content: str | None location:
location: row: 10
row: 10 column: 9
column: 9 end_location:
end_location: row: 10
row: 10 column: 29
column: 29
- kind: UsePEP604Annotation - kind: UsePEP604Annotation
location: location:
row: 14 row: 14
@ -42,14 +40,13 @@ expression: checks
row: 14 row: 14
column: 45 column: 45
fix: fix:
patch: content: "str | int | Union[float, bytes]"
content: "str | int | Union[float, bytes]" location:
location: row: 14
row: 14 column: 9
column: 9 end_location:
end_location: row: 14
row: 14 column: 45
column: 45
- kind: UsePEP604Annotation - kind: UsePEP604Annotation
location: location:
row: 14 row: 14
@ -58,14 +55,13 @@ expression: checks
row: 14 row: 14
column: 44 column: 44
fix: fix:
patch: content: float | bytes
content: float | bytes location:
location: row: 14
row: 14 column: 25
column: 25 end_location:
end_location: row: 14
row: 14 column: 44
column: 44
- kind: UsePEP604Annotation - kind: UsePEP604Annotation
location: location:
row: 18 row: 18
@ -74,14 +70,13 @@ expression: checks
row: 18 row: 18
column: 31 column: 31
fix: fix:
patch: content: str | int
content: str | int location:
location: row: 18
row: 18 column: 9
column: 9 end_location:
end_location: row: 18
row: 18 column: 31
column: 31
- kind: UsePEP604Annotation - kind: UsePEP604Annotation
location: location:
row: 22 row: 22
@ -90,14 +85,13 @@ expression: checks
row: 22 row: 22
column: 33 column: 33
fix: fix:
patch: content: str | int
content: str | int location:
location: row: 22
row: 22 column: 9
column: 9 end_location:
end_location: row: 22
row: 22 column: 33
column: 33
- kind: UsePEP604Annotation - kind: UsePEP604Annotation
location: location:
row: 26 row: 26
@ -106,12 +100,11 @@ expression: checks
row: 26 row: 26
column: 40 column: 40
fix: fix:
patch: content: "(str, int) | float"
content: "(str, int) | float" location:
location: row: 26
row: 26 column: 9
column: 9 end_location:
end_location: row: 26
row: 26 column: 40
column: 40

View file

@ -10,14 +10,13 @@ expression: checks
row: 17 row: 17
column: 35 column: 35
fix: fix:
patch: content: super()
content: super() location:
location: row: 17
row: 17 column: 17
column: 17 end_location:
end_location: row: 17
row: 17 column: 35
column: 35
- kind: SuperCallWithParameters - kind: SuperCallWithParameters
location: location:
row: 18 row: 18
@ -26,14 +25,13 @@ expression: checks
row: 18 row: 18
column: 26 column: 26
fix: fix:
patch: content: super()
content: super() location:
location: row: 18
row: 18 column: 8
column: 8 end_location:
end_location: row: 18
row: 18 column: 26
column: 26
- kind: SuperCallWithParameters - kind: SuperCallWithParameters
location: location:
row: 19 row: 19
@ -42,14 +40,13 @@ expression: checks
row: 22 row: 22
column: 9 column: 9
fix: fix:
patch: content: super()
content: super() location:
location: row: 19
row: 19 column: 8
column: 8 end_location:
end_location: row: 22
row: 22 column: 9
column: 9
- kind: SuperCallWithParameters - kind: SuperCallWithParameters
location: location:
row: 36 row: 36
@ -58,14 +55,13 @@ expression: checks
row: 36 row: 36
column: 28 column: 28
fix: fix:
patch: content: super()
content: super() location:
location: row: 36
row: 36 column: 8
column: 8 end_location:
end_location: row: 36
row: 36 column: 28
column: 28
- kind: SuperCallWithParameters - kind: SuperCallWithParameters
location: location:
row: 50 row: 50
@ -74,12 +70,11 @@ expression: checks
row: 50 row: 50
column: 32 column: 32
fix: fix:
patch: content: super()
content: super() location:
location: row: 50
row: 50 column: 12
column: 12 end_location:
end_location: row: 50
row: 50 column: 32
column: 32

View file

@ -10,12 +10,11 @@ expression: checks
row: 2 row: 2
column: 0 column: 0
fix: fix:
patch: content: ""
content: "" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 0
column: 0

View file

@ -10,12 +10,11 @@ expression: checks
row: 3 row: 3
column: 0 column: 0
fix: fix:
patch: content: ""
content: "" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 0
column: 0

View file

@ -13,14 +13,13 @@ expression: checks
row: 1 row: 1
column: 48 column: 48
fix: fix:
patch: content: ""
content: "" location:
location: row: 1
row: 1 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 0
column: 0
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- unicode_literals - unicode_literals
@ -32,14 +31,13 @@ expression: checks
row: 2 row: 2
column: 55 column: 55
fix: fix:
patch: content: ""
content: "" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 0
column: 0
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- absolute_import - absolute_import
@ -51,14 +49,13 @@ expression: checks
row: 3 row: 3
column: 48 column: 48
fix: fix:
patch: content: ""
content: "" location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 0
column: 0
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- generator_stop - generator_stop
@ -69,14 +66,13 @@ expression: checks
row: 4 row: 4
column: 37 column: 37
fix: fix:
patch: content: ""
content: "" location:
location: row: 4
row: 4 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 0
column: 0
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- generator_stop - generator_stop
@ -88,14 +84,13 @@ expression: checks
row: 5 row: 5
column: 53 column: 53
fix: fix:
patch: content: ""
content: "" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 0
column: 0
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- generators - generators
@ -106,14 +101,13 @@ expression: checks
row: 6 row: 6
column: 49 column: 49
fix: fix:
patch: content: from __future__ import invalid_module
content: from __future__ import invalid_module location:
location: row: 6
row: 6 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 49
column: 49
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- generator_stop - generator_stop
@ -124,14 +118,13 @@ expression: checks
row: 9 row: 9
column: 41 column: 41
fix: fix:
patch: content: ""
content: "" location:
location: row: 9
row: 9 column: 0
column: 0 end_location:
end_location: row: 10
row: 10 column: 0
column: 0
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- generators - generators
@ -142,14 +135,13 @@ expression: checks
row: 10 row: 10
column: 37 column: 37
fix: fix:
patch: content: pass
content: pass location:
location: row: 10
row: 10 column: 4
column: 4 end_location:
end_location: row: 10
row: 10 column: 37
column: 37
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- generator_stop - generator_stop
@ -160,14 +152,13 @@ expression: checks
row: 13 row: 13
column: 41 column: 41
fix: fix:
patch: content: ""
content: "" location:
location: row: 13
row: 13 column: 0
column: 0 end_location:
end_location: row: 14
row: 14 column: 0
column: 0
- kind: - kind:
UnnecessaryFutureImport: UnnecessaryFutureImport:
- generators - generators
@ -178,12 +169,11 @@ expression: checks
row: 14 row: 14
column: 53 column: 53
fix: fix:
patch: content: from __future__ import invalid_module
content: from __future__ import invalid_module location:
location: row: 14
row: 14 column: 4
column: 4 end_location:
end_location: row: 14
row: 14 column: 53
column: 53

View file

@ -10,14 +10,13 @@ expression: checks
row: 5 row: 5
column: 12 column: 12
fix: fix:
patch: content: ""
content: "" location:
location: row: 5
row: 5 column: 10
column: 10 end_location:
end_location: row: 5
row: 5 column: 12
column: 12
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 11 row: 11
@ -26,14 +25,13 @@ expression: checks
row: 11 row: 11
column: 22 column: 22
fix: fix:
patch: content: ""
content: "" location:
location: row: 11
row: 11 column: 20
column: 20 end_location:
end_location: row: 11
row: 11 column: 22
column: 22
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 16 row: 16
@ -42,14 +40,13 @@ expression: checks
row: 16 row: 16
column: 24 column: 24
fix: fix:
patch: content: ""
content: "" location:
location: row: 16
row: 16 column: 10
column: 10 end_location:
end_location: row: 16
row: 16 column: 24
column: 24
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 21 row: 21
@ -58,14 +55,13 @@ expression: checks
row: 21 row: 21
column: 34 column: 34
fix: fix:
patch: content: ""
content: "" location:
location: row: 21
row: 21 column: 20
column: 20 end_location:
end_location: row: 21
row: 21 column: 34
column: 34
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 27 row: 27
@ -74,14 +70,13 @@ expression: checks
row: 28 row: 28
column: 1 column: 1
fix: fix:
patch: content: ""
content: "" location:
location: row: 27
row: 27 column: 10
column: 10 end_location:
end_location: row: 28
row: 28 column: 1
column: 1
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 33 row: 33
@ -90,14 +85,13 @@ expression: checks
row: 35 row: 35
column: 1 column: 1
fix: fix:
patch: content: ""
content: "" location:
location: row: 33
row: 33 column: 10
column: 10 end_location:
end_location: row: 35
row: 35 column: 1
column: 1
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 40 row: 40
@ -106,14 +100,13 @@ expression: checks
row: 42 row: 42
column: 19 column: 19
fix: fix:
patch: content: ""
content: "" location:
location: row: 40
row: 40 column: 20
column: 20 end_location:
end_location: row: 42
row: 42 column: 19
column: 19
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 47 row: 47
@ -122,14 +115,13 @@ expression: checks
row: 51 row: 51
column: 1 column: 1
fix: fix:
patch: content: ""
content: "" location:
location: row: 47
row: 47 column: 20
column: 20 end_location:
end_location: row: 51
row: 51 column: 1
column: 1
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 56 row: 56
@ -138,14 +130,13 @@ expression: checks
row: 62 row: 62
column: 1 column: 1
fix: fix:
patch: content: ""
content: "" location:
location: row: 56
row: 56 column: 20
column: 20 end_location:
end_location: row: 62
row: 62 column: 1
column: 1
- kind: UnnecessaryLRUCacheParams - kind: UnnecessaryLRUCacheParams
location: location:
row: 67 row: 67
@ -154,12 +145,11 @@ expression: checks
row: 72 row: 72
column: 1 column: 1
fix: fix:
patch: content: ""
content: "" location:
location: row: 67
row: 67 column: 20
column: 20 end_location:
end_location: row: 72
row: 72 column: 1
column: 1

View file

@ -10,14 +10,13 @@ expression: checks
row: 2 row: 2
column: 21 column: 21
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 2
row: 2 column: 0
column: 0 end_location:
end_location: row: 2
row: 2 column: 21
column: 21
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 3 row: 3
@ -26,14 +25,13 @@ expression: checks
row: 3 row: 3
column: 18 column: 18
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 3
row: 3 column: 0
column: 0 end_location:
end_location: row: 3
row: 3 column: 18
column: 18
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 4 row: 4
@ -42,14 +40,13 @@ expression: checks
row: 4 row: 4
column: 14 column: 14
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 4
row: 4 column: 0
column: 0 end_location:
end_location: row: 4
row: 4 column: 14
column: 14
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 5 row: 5
@ -58,14 +55,13 @@ expression: checks
row: 5 row: 5
column: 20 column: 20
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 20
column: 20
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 6 row: 6
@ -74,14 +70,13 @@ expression: checks
row: 6 row: 6
column: 22 column: 22
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 6
row: 6 column: 0
column: 0 end_location:
end_location: row: 6
row: 6 column: 22
column: 22
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 7 row: 7
@ -90,14 +85,13 @@ expression: checks
row: 7 row: 7
column: 30 column: 30
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 7
row: 7 column: 0
column: 0 end_location:
end_location: row: 7
row: 7 column: 30
column: 30
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 8 row: 8
@ -106,14 +100,13 @@ expression: checks
row: 14 row: 14
column: 1 column: 1
fix: fix:
patch: content: "b\"\"\"\nLorem\n\nIpsum\n\"\"\""
content: "b\"\"\"\nLorem\n\nIpsum\n\"\"\"" location:
location: row: 8
row: 8 column: 0
column: 0 end_location:
end_location: row: 14
row: 14 column: 1
column: 1
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 26 row: 26
@ -122,14 +115,13 @@ expression: checks
row: 26 row: 26
column: 27 column: 27
fix: fix:
patch: content: ""
content: "" location:
location: row: 26
row: 26 column: 19
column: 19 end_location:
end_location: row: 26
row: 26 column: 26
column: 26
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 44 row: 44
@ -138,14 +130,13 @@ expression: checks
row: 44 row: 44
column: 31 column: 31
fix: fix:
patch: content: ""
content: "" location:
location: row: 44
row: 44 column: 23
column: 23 end_location:
end_location: row: 44
row: 44 column: 30
column: 30
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 46 row: 46
@ -154,14 +145,13 @@ expression: checks
row: 46 row: 46
column: 39 column: 39
fix: fix:
patch: content: ""
content: "" location:
location: row: 46
row: 46 column: 23
column: 23 end_location:
end_location: row: 46
row: 46 column: 38
column: 38
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 48 row: 48
@ -170,14 +160,13 @@ expression: checks
row: 48 row: 48
column: 23 column: 23
fix: fix:
patch: content: "br\"fo\\o\""
content: "br\"fo\\o\"" location:
location: row: 48
row: 48 column: 0
column: 0 end_location:
end_location: row: 48
row: 48 column: 23
column: 23
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 49 row: 49
@ -186,14 +175,13 @@ expression: checks
row: 49 row: 49
column: 22 column: 22
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 49
row: 49 column: 0
column: 0 end_location:
end_location: row: 49
row: 49 column: 22
column: 22
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 50 row: 50
@ -202,14 +190,13 @@ expression: checks
row: 50 row: 50
column: 23 column: 23
fix: fix:
patch: content: "bR\"fo\\o\""
content: "bR\"fo\\o\"" location:
location: row: 50
row: 50 column: 0
column: 0 end_location:
end_location: row: 50
row: 50 column: 23
column: 23
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 51 row: 51
@ -218,14 +205,13 @@ expression: checks
row: 51 row: 51
column: 22 column: 22
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 51
row: 51 column: 0
column: 0 end_location:
end_location: row: 51
row: 51 column: 22
column: 22
- kind: UnnecessaryEncodeUTF8 - kind: UnnecessaryEncodeUTF8
location: location:
row: 52 row: 52
@ -234,12 +220,11 @@ expression: checks
row: 52 row: 52
column: 20 column: 20
fix: fix:
patch: content: "b\"foo\""
content: "b\"foo\"" location:
location: row: 52
row: 52 column: 6
column: 6 end_location:
end_location: row: 52
row: 52 column: 20
column: 20

View file

@ -11,14 +11,13 @@ expression: checks
row: 5 row: 5
column: 52 column: 52
fix: fix:
patch: content: "class MyType1(TypedDict):\n a: int\n b: str"
content: "class MyType1(TypedDict):\n a: int\n b: str" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 52
column: 52
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType2 ConvertTypedDictFunctionalToClass: MyType2
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 8 row: 8
column: 50 column: 50
fix: fix:
patch: content: "class MyType2(TypedDict):\n a: int\n b: str"
content: "class MyType2(TypedDict):\n a: int\n b: str" location:
location: row: 8
row: 8 column: 0
column: 0 end_location:
end_location: row: 8
row: 8 column: 50
column: 50
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType3 ConvertTypedDictFunctionalToClass: MyType3
location: location:
@ -45,14 +43,13 @@ expression: checks
row: 11 row: 11
column: 44 column: 44
fix: fix:
patch: content: "class MyType3(TypedDict):\n a: int\n b: str"
content: "class MyType3(TypedDict):\n a: int\n b: str" location:
location: row: 11
row: 11 column: 0
column: 0 end_location:
end_location: row: 11
row: 11 column: 44
column: 44
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType4 ConvertTypedDictFunctionalToClass: MyType4
location: location:
@ -62,14 +59,13 @@ expression: checks
row: 14 row: 14
column: 30 column: 30
fix: fix:
patch: content: "class MyType4(TypedDict):\n pass"
content: "class MyType4(TypedDict):\n pass" location:
location: row: 14
row: 14 column: 0
column: 0 end_location:
end_location: row: 14
row: 14 column: 30
column: 30
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType5 ConvertTypedDictFunctionalToClass: MyType5
location: location:
@ -79,14 +75,13 @@ expression: checks
row: 17 row: 17
column: 46 column: 46
fix: fix:
patch: content: "class MyType5(TypedDict):\n a: 'hello'"
content: "class MyType5(TypedDict):\n a: 'hello'" location:
location: row: 17
row: 17 column: 0
column: 0 end_location:
end_location: row: 17
row: 17 column: 46
column: 46
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType6 ConvertTypedDictFunctionalToClass: MyType6
location: location:
@ -96,14 +91,13 @@ expression: checks
row: 18 row: 18
column: 41 column: 41
fix: fix:
patch: content: "class MyType6(TypedDict):\n a: 'hello'"
content: "class MyType6(TypedDict):\n a: 'hello'" location:
location: row: 18
row: 18 column: 0
column: 0 end_location:
end_location: row: 18
row: 18 column: 41
column: 41
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType7 ConvertTypedDictFunctionalToClass: MyType7
location: location:
@ -113,14 +107,13 @@ expression: checks
row: 21 row: 21
column: 56 column: 56
fix: fix:
patch: content: "class MyType7(TypedDict):\n a: NotRequired[dict]"
content: "class MyType7(TypedDict):\n a: NotRequired[dict]" location:
location: row: 21
row: 21 column: 0
column: 0 end_location:
end_location: row: 21
row: 21 column: 56
column: 56
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType8 ConvertTypedDictFunctionalToClass: MyType8
location: location:
@ -130,14 +123,13 @@ expression: checks
row: 24 row: 24
column: 65 column: 65
fix: fix:
patch: content: "class MyType8(TypedDict, total=False):\n x: int\n y: int"
content: "class MyType8(TypedDict, total=False):\n x: int\n y: int" location:
location: row: 24
row: 24 column: 0
column: 0 end_location:
end_location: row: 24
row: 24 column: 65
column: 65
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType10 ConvertTypedDictFunctionalToClass: MyType10
location: location:
@ -147,14 +139,13 @@ expression: checks
row: 30 row: 30
column: 59 column: 59
fix: fix:
patch: content: "class MyType10(TypedDict):\n key: Literal['value']"
content: "class MyType10(TypedDict):\n key: Literal['value']" location:
location: row: 30
row: 30 column: 0
column: 0 end_location:
end_location: row: 30
row: 30 column: 59
column: 59
- kind: - kind:
ConvertTypedDictFunctionalToClass: MyType11 ConvertTypedDictFunctionalToClass: MyType11
location: location:
@ -164,12 +155,11 @@ expression: checks
row: 33 row: 33
column: 53 column: 53
fix: fix:
patch: content: "class MyType11(typing.TypedDict):\n key: int"
content: "class MyType11(typing.TypedDict):\n key: int" location:
location: row: 33
row: 33 column: 0
column: 0 end_location:
end_location: row: 33
row: 33 column: 53
column: 53

View file

@ -11,14 +11,13 @@ expression: checks
row: 5 row: 5
column: 61 column: 61
fix: fix:
patch: content: "class NT1(NamedTuple):\n a: int\n b: tuple[str, ...]"
content: "class NT1(NamedTuple):\n a: int\n b: tuple[str, ...]" location:
location: row: 5
row: 5 column: 0
column: 0 end_location:
end_location: row: 5
row: 5 column: 61
column: 61
- kind: - kind:
ConvertNamedTupleFunctionalToClass: NT2 ConvertNamedTupleFunctionalToClass: NT2
location: location:
@ -28,14 +27,13 @@ expression: checks
row: 12 row: 12
column: 1 column: 1
fix: fix:
patch: content: "class NT2(NamedTuple):\n a: int\n b: str = 'foo'\n c: list[bool] = [True]"
content: "class NT2(NamedTuple):\n a: int\n b: str = 'foo'\n c: list[bool] = [True]" location:
location: row: 8
row: 8 column: 0
column: 0 end_location:
end_location: row: 12
row: 12 column: 1
column: 1
- kind: - kind:
ConvertNamedTupleFunctionalToClass: NT3 ConvertNamedTupleFunctionalToClass: NT3
location: location:
@ -45,12 +43,11 @@ expression: checks
row: 15 row: 15
column: 56 column: 56
fix: fix:
patch: content: "class NT3(typing.NamedTuple):\n a: int\n b: str"
content: "class NT3(typing.NamedTuple):\n a: int\n b: str" location:
location: row: 15
row: 15 column: 0
column: 0 end_location:
end_location: row: 15
row: 15 column: 56
column: 56

View file

@ -10,14 +10,13 @@ expression: checks
row: 1 row: 1
column: 16 column: 16
fix: fix:
patch: content: ""
content: "" location:
location: row: 1
row: 1 column: 10
column: 10 end_location:
end_location: row: 1
row: 1 column: 15
column: 15
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 2 row: 2
@ -26,14 +25,13 @@ expression: checks
row: 2 row: 2
column: 17 column: 17
fix: fix:
patch: content: ""
content: "" location:
location: row: 2
row: 2 column: 10
column: 10 end_location:
end_location: row: 2
row: 2 column: 16
column: 16
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 3 row: 3
@ -42,14 +40,13 @@ expression: checks
row: 3 row: 3
column: 17 column: 17
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 3
row: 3 column: 12
column: 12 end_location:
end_location: row: 3
row: 3 column: 16
column: 16
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 4 row: 4
@ -58,14 +55,13 @@ expression: checks
row: 4 row: 4
column: 18 column: 18
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 4
row: 4 column: 12
column: 12 end_location:
end_location: row: 4
row: 4 column: 17
column: 17
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 5 row: 5
@ -74,14 +70,13 @@ expression: checks
row: 5 row: 5
column: 16 column: 16
fix: fix:
patch: content: ""
content: "" location:
location: row: 5
row: 5 column: 10
column: 10 end_location:
end_location: row: 5
row: 5 column: 15
column: 15
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 6 row: 6
@ -90,14 +85,13 @@ expression: checks
row: 6 row: 6
column: 17 column: 17
fix: fix:
patch: content: ""
content: "" location:
location: row: 6
row: 6 column: 10
column: 10 end_location:
end_location: row: 6
row: 6 column: 16
column: 16
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 7 row: 7
@ -106,14 +100,13 @@ expression: checks
row: 7 row: 7
column: 32 column: 32
fix: fix:
patch: content: ""
content: "" location:
location: row: 7
row: 7 column: 8
column: 8 end_location:
end_location: row: 7
row: 7 column: 13
column: 13
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 8 row: 8
@ -122,14 +115,13 @@ expression: checks
row: 8 row: 8
column: 15 column: 15
fix: fix:
patch: content: "\"w\""
content: "\"w\"" location:
location: row: 8
row: 8 column: 10
column: 10 end_location:
end_location: row: 8
row: 8 column: 14
column: 14
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 10 row: 10
@ -138,14 +130,13 @@ expression: checks
row: 10 row: 10
column: 21 column: 21
fix: fix:
patch: content: ""
content: "" location:
location: row: 10
row: 10 column: 15
column: 15 end_location:
end_location: row: 10
row: 10 column: 20
column: 20
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 12 row: 12
@ -154,14 +145,13 @@ expression: checks
row: 12 row: 12
column: 22 column: 22
fix: fix:
patch: content: ""
content: "" location:
location: row: 12
row: 12 column: 15
column: 15 end_location:
end_location: row: 12
row: 12 column: 21
column: 21
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 14 row: 14
@ -170,14 +160,13 @@ expression: checks
row: 14 row: 14
column: 22 column: 22
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 14
row: 14 column: 17
column: 17 end_location:
end_location: row: 14
row: 14 column: 21
column: 21
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 16 row: 16
@ -186,14 +175,13 @@ expression: checks
row: 16 row: 16
column: 23 column: 23
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 16
row: 16 column: 17
column: 17 end_location:
end_location: row: 16
row: 16 column: 22
column: 22
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 18 row: 18
@ -202,14 +190,13 @@ expression: checks
row: 18 row: 18
column: 21 column: 21
fix: fix:
patch: content: ""
content: "" location:
location: row: 18
row: 18 column: 15
column: 15 end_location:
end_location: row: 18
row: 18 column: 20
column: 20
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 20 row: 20
@ -218,14 +205,13 @@ expression: checks
row: 20 row: 20
column: 22 column: 22
fix: fix:
patch: content: ""
content: "" location:
location: row: 20
row: 20 column: 15
column: 15 end_location:
end_location: row: 20
row: 20 column: 21
column: 21
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 22 row: 22
@ -234,14 +220,13 @@ expression: checks
row: 22 row: 22
column: 39 column: 39
fix: fix:
patch: content: ""
content: "" location:
location: row: 22
row: 22 column: 15
column: 15 end_location:
end_location: row: 22
row: 22 column: 20
column: 20
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 24 row: 24
@ -250,14 +235,13 @@ expression: checks
row: 24 row: 24
column: 22 column: 22
fix: fix:
patch: content: "\"w\""
content: "\"w\"" location:
location: row: 24
row: 24 column: 17
column: 17 end_location:
end_location: row: 24
row: 24 column: 21
column: 21
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 27 row: 27
@ -266,14 +250,13 @@ expression: checks
row: 27 row: 27
column: 27 column: 27
fix: fix:
patch: content: ""
content: "" location:
location: row: 27
row: 27 column: 21
column: 21 end_location:
end_location: row: 27
row: 27 column: 26
column: 26
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 28 row: 28
@ -282,14 +265,13 @@ expression: checks
row: 28 row: 28
column: 28 column: 28
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 28
row: 28 column: 23
column: 23 end_location:
end_location: row: 28
row: 28 column: 27
column: 27
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 30 row: 30
@ -298,14 +280,13 @@ expression: checks
row: 30 row: 30
column: 32 column: 32
fix: fix:
patch: content: ""
content: "" location:
location: row: 30
row: 30 column: 26
column: 26 end_location:
end_location: row: 30
row: 30 column: 31
column: 31
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 32 row: 32
@ -314,14 +295,13 @@ expression: checks
row: 32 row: 32
column: 33 column: 33
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 32
row: 32 column: 28
column: 28 end_location:
end_location: row: 32
row: 32 column: 32
column: 32
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 35 row: 35
@ -330,14 +310,13 @@ expression: checks
row: 35 row: 35
column: 21 column: 21
fix: fix:
patch: content: ""
content: "" location:
location: row: 35
row: 35 column: 15
column: 15 end_location:
end_location: row: 35
row: 35 column: 20
column: 20
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 35 row: 35
@ -346,14 +325,13 @@ expression: checks
row: 35 row: 35
column: 45 column: 45
fix: fix:
patch: content: ""
content: "" location:
location: row: 35
row: 35 column: 39
column: 39 end_location:
end_location: row: 35
row: 35 column: 44
column: 44
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 37 row: 37
@ -362,14 +340,13 @@ expression: checks
row: 37 row: 37
column: 22 column: 22
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 37
row: 37 column: 17
column: 17 end_location:
end_location: row: 37
row: 37 column: 21
column: 21
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 37 row: 37
@ -378,14 +355,13 @@ expression: checks
row: 37 row: 37
column: 47 column: 47
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 37
row: 37 column: 42
column: 42 end_location:
end_location: row: 37
row: 37 column: 46
column: 46
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 40 row: 40
@ -394,14 +370,13 @@ expression: checks
row: 40 row: 40
column: 21 column: 21
fix: fix:
patch: content: ""
content: "" location:
location: row: 40
row: 40 column: 10
column: 10 end_location:
end_location: row: 40
row: 40 column: 20
column: 20
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 41 row: 41
@ -410,14 +385,13 @@ expression: checks
row: 41 row: 41
column: 26 column: 26
fix: fix:
patch: content: ""
content: "" location:
location: row: 41
row: 41 column: 15
column: 15 end_location:
end_location: row: 41
row: 41 column: 25
column: 25
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 42 row: 42
@ -426,14 +400,13 @@ expression: checks
row: 42 row: 42
column: 26 column: 26
fix: fix:
patch: content: ""
content: "" location:
location: row: 42
row: 42 column: 5
column: 5 end_location:
end_location: row: 42
row: 42 column: 15
column: 15
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 44 row: 44
@ -442,14 +415,13 @@ expression: checks
row: 44 row: 44
column: 26 column: 26
fix: fix:
patch: content: ""
content: "" location:
location: row: 44
row: 44 column: 15
column: 15 end_location:
end_location: row: 44
row: 44 column: 25
column: 25
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 46 row: 46
@ -458,14 +430,13 @@ expression: checks
row: 46 row: 46
column: 31 column: 31
fix: fix:
patch: content: ""
content: "" location:
location: row: 46
row: 46 column: 20
column: 20 end_location:
end_location: row: 46
row: 46 column: 30
column: 30
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 48 row: 48
@ -474,14 +445,13 @@ expression: checks
row: 48 row: 48
column: 31 column: 31
fix: fix:
patch: content: ""
content: "" location:
location: row: 48
row: 48 column: 10
column: 10 end_location:
end_location: row: 48
row: 48 column: 20
column: 20
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 51 row: 51
@ -490,14 +460,13 @@ expression: checks
row: 51 row: 51
column: 22 column: 22
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 51
row: 51 column: 17
column: 17 end_location:
end_location: row: 51
row: 51 column: 21
column: 21
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 52 row: 52
@ -506,14 +475,13 @@ expression: checks
row: 52 row: 52
column: 27 column: 27
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 52
row: 52 column: 22
column: 22 end_location:
end_location: row: 52
row: 52 column: 26
column: 26
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 53 row: 53
@ -522,14 +490,13 @@ expression: checks
row: 53 row: 53
column: 27 column: 27
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 53
row: 53 column: 10
column: 10 end_location:
end_location: row: 53
row: 53 column: 14
column: 14
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 55 row: 55
@ -538,14 +505,13 @@ expression: checks
row: 55 row: 55
column: 27 column: 27
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 55
row: 55 column: 22
column: 22 end_location:
end_location: row: 55
row: 55 column: 26
column: 26
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 57 row: 57
@ -554,14 +520,13 @@ expression: checks
row: 57 row: 57
column: 32 column: 32
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 57
row: 57 column: 27
column: 27 end_location:
end_location: row: 57
row: 57 column: 31
column: 31
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 59 row: 59
@ -570,14 +535,13 @@ expression: checks
row: 59 row: 59
column: 32 column: 32
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 59
row: 59 column: 15
column: 15 end_location:
end_location: row: 59
row: 59 column: 19
column: 19
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 62 row: 62
@ -586,14 +550,13 @@ expression: checks
row: 62 row: 62
column: 110 column: 110
fix: fix:
patch: content: ""
content: "" location:
location: row: 62
row: 62 column: 15
column: 15 end_location:
end_location: row: 62
row: 62 column: 25
column: 25
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 63 row: 63
@ -602,14 +565,13 @@ expression: checks
row: 63 row: 63
column: 110 column: 110
fix: fix:
patch: content: ""
content: "" location:
location: row: 63
row: 63 column: 99
column: 99 end_location:
end_location: row: 63
row: 63 column: 109
column: 109
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 64 row: 64
@ -618,14 +580,13 @@ expression: checks
row: 64 row: 64
column: 110 column: 110
fix: fix:
patch: content: ""
content: "" location:
location: row: 64
row: 64 column: 58
column: 58 end_location:
end_location: row: 64
row: 64 column: 68
column: 68
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 65 row: 65
@ -634,14 +595,13 @@ expression: checks
row: 65 row: 65
column: 110 column: 110
fix: fix:
patch: content: ""
content: "" location:
location: row: 65
row: 65 column: 5
column: 5 end_location:
end_location: row: 65
row: 65 column: 15
column: 15
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 67 row: 67
@ -650,14 +610,13 @@ expression: checks
row: 67 row: 67
column: 111 column: 111
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 67
row: 67 column: 22
column: 22 end_location:
end_location: row: 67
row: 67 column: 26
column: 26
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 68 row: 68
@ -666,14 +625,13 @@ expression: checks
row: 68 row: 68
column: 111 column: 111
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 68
row: 68 column: 106
column: 106 end_location:
end_location: row: 68
row: 68 column: 110
column: 110
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 69 row: 69
@ -682,14 +640,13 @@ expression: checks
row: 69 row: 69
column: 111 column: 111
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 69
row: 69 column: 65
column: 65 end_location:
end_location: row: 69
row: 69 column: 69
column: 69
- kind: RedundantOpenModes - kind: RedundantOpenModes
location: location:
row: 70 row: 70
@ -698,12 +655,11 @@ expression: checks
row: 70 row: 70
column: 111 column: 111
fix: fix:
patch: content: "\"rb\""
content: "\"rb\"" location:
location: row: 70
row: 70 column: 10
column: 10 end_location:
end_location: row: 70
row: 70 column: 14
column: 14

View file

@ -11,12 +11,11 @@ expression: checks
row: 34 row: 34
column: 21 column: 21
fix: fix:
patch: content: list
content: list location:
location: row: 34
row: 34 column: 17
column: 17 end_location:
end_location: row: 34
row: 34 column: 21
column: 21

View file

@ -11,14 +11,13 @@ expression: checks
row: 34 row: 34
column: 21 column: 21
fix: fix:
patch: content: list
content: list location:
location: row: 34
row: 34 column: 17
column: 17 end_location:
end_location: row: 34
row: 34 column: 21
column: 21
- kind: - kind:
UsePEP585Annotation: List UsePEP585Annotation: List
location: location:
@ -28,12 +27,11 @@ expression: checks
row: 35 row: 35
column: 12 column: 12
fix: fix:
patch: content: list
content: list location:
location: row: 35
row: 35 column: 8
column: 8 end_location:
end_location: row: 35
row: 35 column: 12
column: 12

View file

@ -10,12 +10,11 @@ expression: checks
row: 40 row: 40
column: 16 column: 16
fix: fix:
patch: content: int | None
content: int | None location:
location: row: 40
row: 40 column: 3
column: 3 end_location:
end_location: row: 40
row: 40 column: 16
column: 16

View file

@ -10,12 +10,11 @@ expression: checks
row: 40 row: 40
column: 16 column: 16
fix: fix:
patch: content: int | None
content: int | None location:
location: row: 40
row: 40 column: 3
column: 3 end_location:
end_location: row: 40
row: 40 column: 16
column: 16

View file

@ -13,12 +13,11 @@ expression: checks
row: 1 row: 1
column: 6 column: 6
fix: fix:
patch: content: B
content: B location:
location: row: 1
row: 1 column: 5
column: 5 end_location:
end_location: row: 1
row: 1 column: 6
column: 6

View file

@ -13,12 +13,11 @@ expression: checks
row: 5 row: 5
column: 56 column: 56
fix: fix:
patch: content: )
content: ) location:
location: row: 5
row: 5 column: 55
column: 55 end_location:
end_location: row: 5
row: 5 column: 56
column: 56

Some files were not shown because too many files have changed in this diff Show more