-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use smarter inversion for comparison checks
- Loading branch information
1 parent
8b35b05
commit 8193689
Showing
3 changed files
with
197 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
150 changes: 150 additions & 0 deletions
150
.../flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM111_SIM111.py.snap.new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
--- | ||
source: crates/ruff/src/rules/flake8_simplify/mod.rs | ||
assertion_line: 47 | ||
expression: diagnostics | ||
--- | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(not check(x) for x in iterable) | ||
location: | ||
row: 25 | ||
column: 4 | ||
end_location: | ||
row: 27 | ||
column: 24 | ||
fix: | ||
content: | ||
- return all(not check(x) for x in iterable) | ||
location: | ||
row: 25 | ||
column: 4 | ||
end_location: | ||
row: 28 | ||
column: 15 | ||
parent: ~ | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(x.is_empty() for x in iterable) | ||
location: | ||
row: 33 | ||
column: 4 | ||
end_location: | ||
row: 35 | ||
column: 24 | ||
fix: | ||
content: | ||
- return all(x.is_empty() for x in iterable) | ||
location: | ||
row: 33 | ||
column: 4 | ||
end_location: | ||
row: 36 | ||
column: 15 | ||
parent: ~ | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(not check(x) for x in iterable) | ||
location: | ||
row: 64 | ||
column: 4 | ||
end_location: | ||
row: 68 | ||
column: 19 | ||
fix: | ||
content: | ||
- return all(not check(x) for x in iterable) | ||
location: | ||
row: 64 | ||
column: 4 | ||
end_location: | ||
row: 68 | ||
column: 19 | ||
parent: ~ | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(not check(x) for x in iterable) | ||
location: | ||
row: 83 | ||
column: 4 | ||
end_location: | ||
row: 87 | ||
column: 19 | ||
fix: | ||
content: | ||
- return all(not check(x) for x in iterable) | ||
location: | ||
row: 83 | ||
column: 4 | ||
end_location: | ||
row: 87 | ||
column: 19 | ||
parent: ~ | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(not check(x) for x in iterable) | ||
location: | ||
row: 134 | ||
column: 4 | ||
end_location: | ||
row: 136 | ||
column: 24 | ||
fix: ~ | ||
parent: ~ | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(not check(x) for x in iterable) | ||
location: | ||
row: 154 | ||
column: 4 | ||
end_location: | ||
row: 156 | ||
column: 24 | ||
fix: | ||
content: | ||
- return all(not check(x) for x in iterable) | ||
location: | ||
row: 154 | ||
column: 4 | ||
end_location: | ||
row: 157 | ||
column: 15 | ||
parent: ~ | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(x in y for x in iterable) | ||
location: | ||
row: 162 | ||
column: 4 | ||
end_location: | ||
row: 164 | ||
column: 24 | ||
fix: | ||
content: | ||
- return all(x in y for x in iterable) | ||
location: | ||
row: 162 | ||
column: 4 | ||
end_location: | ||
row: 165 | ||
column: 15 | ||
parent: ~ | ||
- kind: | ||
ConvertLoopToAll: | ||
all: return all(x <= y for x in iterable) | ||
location: | ||
row: 170 | ||
column: 4 | ||
end_location: | ||
row: 172 | ||
column: 24 | ||
fix: | ||
content: | ||
- return all(x <= y for x in iterable) | ||
location: | ||
row: 170 | ||
column: 4 | ||
end_location: | ||
row: 173 | ||
column: 15 | ||
parent: ~ | ||
|