diff --git a/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap b/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap index 9436ae0d3a..0e41c4cf7c 100644 --- a/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap +++ b/crates/ruff/src/rules/eradicate/snapshots/ruff__rules__eradicate__tests__ERA001_ERA001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/eradicate/mod.rs --- -./resources/test/fixtures/eradicate/ERA001.py:1:1: ERA001 [*] Found commented-out code +ERA001.py:1:1: ERA001 [*] Found commented-out code | 1 | #import os | ^^^^^^^^^^ ERA001 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/eradicate/mod.rs 3 2 | #a = 3 4 3 | a = 4 -./resources/test/fixtures/eradicate/ERA001.py:2:1: ERA001 [*] Found commented-out code +ERA001.py:2:1: ERA001 [*] Found commented-out code | 2 | #import os 3 | # from foo import junk @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/eradicate/mod.rs 4 3 | a = 4 5 4 | #foo(1, 2, 3) -./resources/test/fixtures/eradicate/ERA001.py:3:1: ERA001 [*] Found commented-out code +ERA001.py:3:1: ERA001 [*] Found commented-out code | 3 | #import os 4 | # from foo import junk @@ -52,7 +52,7 @@ source: crates/ruff/src/rules/eradicate/mod.rs 5 4 | #foo(1, 2, 3) 6 5 | -./resources/test/fixtures/eradicate/ERA001.py:5:1: ERA001 [*] Found commented-out code +ERA001.py:5:1: ERA001 [*] Found commented-out code | 5 | #a = 3 6 | a = 4 @@ -72,7 +72,7 @@ source: crates/ruff/src/rules/eradicate/mod.rs 7 6 | def foo(x, y, z): 8 7 | content = 1 # print('hello') -./resources/test/fixtures/eradicate/ERA001.py:12:5: ERA001 [*] Found commented-out code +ERA001.py:12:5: ERA001 [*] Found commented-out code | 12 | # This is a real comment. 13 | #return True diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap index cc60712a8d..dfc5f43f09 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT101_YTT101.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT101.py:6:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info` +YTT101.py:6:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info` | 6 | print(sys.version) 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 10 | print(v[:3]) | -./resources/test/fixtures/flake8_2020/YTT101.py:7:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info` +YTT101.py:7:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info` | 7 | print(sys.version[:3]) 8 | print(version[:3]) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 9 | print(v[:3]) | -./resources/test/fixtures/flake8_2020/YTT101.py:8:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info` +YTT101.py:8:7: YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info` | 8 | print(sys.version[:3]) 9 | print(version[:3]) diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap index 85a363d2d3..9d59d04e40 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT102_YTT102.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT102.py:4:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info` +YTT102.py:4:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info` | 4 | from sys import version 5 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 7 | py_minor = version[2] | -./resources/test/fixtures/flake8_2020/YTT102.py:5:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info` +YTT102.py:5:12: YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info` | 5 | py_minor = sys.version[2] 6 | py_minor = version[2] diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap index 236d24ff4b..8e5069e2ba 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT103_YTT103.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT103.py:4:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` +YTT103.py:4:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` | 4 | from sys import version 5 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 8 | sys.version <= "3.5" | -./resources/test/fixtures/flake8_2020/YTT103.py:5:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` +YTT103.py:5:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` | 5 | version < "3.5" 6 | sys.version < "3.5" @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 8 | sys.version > "3.5" | -./resources/test/fixtures/flake8_2020/YTT103.py:6:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` +YTT103.py:6:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` | 6 | version < "3.5" 7 | sys.version < "3.5" @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 10 | sys.version >= "3.5" | -./resources/test/fixtures/flake8_2020/YTT103.py:7:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` +YTT103.py:7:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` | 7 | sys.version < "3.5" 8 | sys.version <= "3.5" @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 10 | sys.version >= "3.5" | -./resources/test/fixtures/flake8_2020/YTT103.py:8:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` +YTT103.py:8:1: YTT103 `sys.version` compared to string (python3.10), use `sys.version_info` | 8 | sys.version <= "3.5" 9 | sys.version > "3.5" diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap index 7f125be714..2a5415196e 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT201_YTT201.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT201.py:7:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` +YTT201.py:7:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` | 7 | PY3 = sys.version_info[0] >= 3 8 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 11 | PY2 = sys.version_info[0] != 3 | -./resources/test/fixtures/flake8_2020/YTT201.py:8:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` +YTT201.py:8:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` | 8 | PY3 = sys.version_info[0] == 3 9 | PY3 = version_info[0] == 3 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 11 | PY2 = version_info[0] != 3 | -./resources/test/fixtures/flake8_2020/YTT201.py:9:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` +YTT201.py:9:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` | 9 | PY3 = sys.version_info[0] == 3 10 | PY3 = version_info[0] == 3 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 12 | PY2 = version_info[0] != 3 | -./resources/test/fixtures/flake8_2020/YTT201.py:10:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` +YTT201.py:10:7: YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=` | 10 | PY3 = version_info[0] == 3 11 | PY2 = sys.version_info[0] != 3 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap index d72cb95162..7de5d380c7 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT202_YTT202.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT202.py:4:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2` +YTT202.py:4:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2` | 4 | from six import PY3 5 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 8 | if PY3: | -./resources/test/fixtures/flake8_2020/YTT202.py:6:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2` +YTT202.py:6:4: YTT202 `six.PY3` referenced (python4), use `not six.PY2` | 6 | if six.PY3: 7 | print("3") diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap index b5fb516870..2bbd624b2f 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT203_YTT203.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT203.py:4:1: YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple +YTT203.py:4:1: YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple | 4 | from sys import version_info 5 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 7 | version_info[1] < 6 | -./resources/test/fixtures/flake8_2020/YTT203.py:5:1: YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple +YTT203.py:5:1: YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple | 5 | sys.version_info[1] >= 5 6 | version_info[1] < 6 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap index d755fc67fc..a2e20b96e8 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT204_YTT204.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT204.py:4:1: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple +YTT204.py:4:1: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple | 4 | from sys import version_info 5 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 7 | version_info.minor > 8 | -./resources/test/fixtures/flake8_2020/YTT204.py:5:1: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple +YTT204.py:5:1: YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple | 5 | sys.version_info.minor <= 7 6 | version_info.minor > 8 diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap index 3f2ff83411..f17ebd1950 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT301_YTT301.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT301.py:4:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_info` +YTT301.py:4:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_info` | 4 | from sys import version 5 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 7 | py_major = version[0] | -./resources/test/fixtures/flake8_2020/YTT301.py:5:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_info` +YTT301.py:5:12: YTT301 `sys.version[0]` referenced (python10), use `sys.version_info` | 5 | py_major = sys.version[0] 6 | py_major = version[0] diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap index 327475879b..e512f8615e 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT302_YTT302.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT302.py:4:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` +YTT302.py:4:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` | 4 | from sys import version 5 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 8 | sys.version <= "3" | -./resources/test/fixtures/flake8_2020/YTT302.py:5:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` +YTT302.py:5:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` | 5 | version < "3" 6 | sys.version < "3" @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 8 | sys.version > "3" | -./resources/test/fixtures/flake8_2020/YTT302.py:6:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` +YTT302.py:6:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` | 6 | version < "3" 7 | sys.version < "3" @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 10 | sys.version >= "3" | -./resources/test/fixtures/flake8_2020/YTT302.py:7:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` +YTT302.py:7:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` | 7 | sys.version < "3" 8 | sys.version <= "3" @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 10 | sys.version >= "3" | -./resources/test/fixtures/flake8_2020/YTT302.py:8:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` +YTT302.py:8:1: YTT302 `sys.version` compared to string (python10), use `sys.version_info` | 8 | sys.version <= "3" 9 | sys.version > "3" diff --git a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap index f1df3d872f..6bbb9df767 100644 --- a/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap +++ b/crates/ruff/src/rules/flake8_2020/snapshots/ruff__rules__flake8_2020__tests__YTT303_YTT303.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_2020/mod.rs --- -./resources/test/fixtures/flake8_2020/YTT303.py:4:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info` +YTT303.py:4:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info` | 4 | from sys import version 5 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_2020/mod.rs 7 | print(version[:1]) | -./resources/test/fixtures/flake8_2020/YTT303.py:5:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info` +YTT303.py:5:7: YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info` | 5 | print(sys.version[:1]) 6 | print(version[:1]) diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap index 28964417e8..e3e2cb361d 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_overload.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_annotations/mod.rs --- -./resources/test/fixtures/flake8_annotations/allow_overload.py:29:9: ANN201 Missing return type annotation for public function `bar` +allow_overload.py:29:9: ANN201 Missing return type annotation for public function `bar` | 29 | class X: 30 | def bar(i): diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap index 068f3925e3..7c95b46808 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__allow_star_arg_any.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_annotations/mod.rs --- -./resources/test/fixtures/flake8_annotations/allow_star_arg_any.py:10:12: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` +allow_star_arg_any.py:10:12: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` | 10 | # ANN401 11 | def foo(a: Any, *args: str, **kwargs: str) -> int: @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 12 | pass | -./resources/test/fixtures/flake8_annotations/allow_star_arg_any.py:15:47: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo` +allow_star_arg_any.py:15:47: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo` | 15 | # ANN401 16 | def foo(a: int, *args: str, **kwargs: str) -> Any: @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 17 | pass | -./resources/test/fixtures/flake8_annotations/allow_star_arg_any.py:40:29: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` +allow_star_arg_any.py:40:29: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` | 40 | # ANN401 41 | def foo_method(self, a: Any, *params: str, **options: str) -> int: @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 42 | pass | -./resources/test/fixtures/flake8_annotations/allow_star_arg_any.py:44:67: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo_method` +allow_star_arg_any.py:44:67: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo_method` | 44 | # ANN401 45 | def foo_method(self, a: int, *params: str, **options: str) -> Any: diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap index 96fe5c61e4..85337e599e 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__defaults.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_annotations/mod.rs --- -./resources/test/fixtures/flake8_annotations/annotation_presence.py:4:5: ANN201 Missing return type annotation for public function `foo` +annotation_presence.py:4:5: ANN201 Missing return type annotation for public function `foo` | 4 | # Error 5 | def foo(a, b): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 6 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:4:9: ANN001 Missing type annotation for function argument `a` +annotation_presence.py:4:9: ANN001 Missing type annotation for function argument `a` | 4 | # Error 5 | def foo(a, b): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 6 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:4:12: ANN001 Missing type annotation for function argument `b` +annotation_presence.py:4:12: ANN001 Missing type annotation for function argument `b` | 4 | # Error 5 | def foo(a, b): @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 6 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:9:5: ANN201 Missing return type annotation for public function `foo` +annotation_presence.py:9:5: ANN201 Missing return type annotation for public function `foo` | 9 | # Error 10 | def foo(a: int, b): @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 11 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:9:17: ANN001 Missing type annotation for function argument `b` +annotation_presence.py:9:17: ANN001 Missing type annotation for function argument `b` | 9 | # Error 10 | def foo(a: int, b): @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 11 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:14:17: ANN001 Missing type annotation for function argument `b` +annotation_presence.py:14:17: ANN001 Missing type annotation for function argument `b` | 14 | # Error 15 | def foo(a: int, b) -> int: @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 16 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:19:5: ANN201 Missing return type annotation for public function `foo` +annotation_presence.py:19:5: ANN201 Missing return type annotation for public function `foo` | 19 | # Error 20 | def foo(a: int, b: int): @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 21 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:24:5: ANN201 Missing return type annotation for public function `foo` +annotation_presence.py:24:5: ANN201 Missing return type annotation for public function `foo` | 24 | # Error 25 | def foo(): @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 26 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:44:12: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` +annotation_presence.py:44:12: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` | 44 | # ANN401 45 | def foo(a: Any, *args: str, **kwargs: str) -> int: @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 46 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:49:47: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo` +annotation_presence.py:49:47: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo` | 49 | # ANN401 50 | def foo(a: int, *args: str, **kwargs: str) -> Any: @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 51 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:54:24: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*args` +annotation_presence.py:54:24: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*args` | 54 | # ANN401 55 | def foo(a: int, *args: Any, **kwargs: Any) -> int: @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 56 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:54:39: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**kwargs` +annotation_presence.py:54:39: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**kwargs` | 54 | # ANN401 55 | def foo(a: int, *args: Any, **kwargs: Any) -> int: @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 56 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:59:24: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*args` +annotation_presence.py:59:24: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*args` | 59 | # ANN401 60 | def foo(a: int, *args: Any, **kwargs: str) -> int: @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 61 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:64:39: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**kwargs` +annotation_presence.py:64:39: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**kwargs` | 64 | # ANN401 65 | def foo(a: int, *args: str, **kwargs: Any) -> int: @@ -113,7 +113,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 66 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:74:13: ANN101 Missing type annotation for `self` in method +annotation_presence.py:74:13: ANN101 Missing type annotation for `self` in method | 74 | # ANN101 75 | def foo(self, a: int, b: int) -> int: @@ -121,7 +121,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 76 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:78:29: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` +annotation_presence.py:78:29: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `a` | 78 | # ANN401 79 | def foo(self: "Foo", a: Any, *params: str, **options: str) -> int: @@ -129,7 +129,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 80 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:82:67: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo` +annotation_presence.py:82:67: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `foo` | 82 | # ANN401 83 | def foo(self: "Foo", a: int, *params: str, **options: str) -> Any: @@ -137,7 +137,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 84 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:86:43: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*params` +annotation_presence.py:86:43: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*params` | 86 | # ANN401 87 | def foo(self: "Foo", a: int, *params: Any, **options: Any) -> int: @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 88 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:86:59: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**options` +annotation_presence.py:86:59: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**options` | 86 | # ANN401 87 | def foo(self: "Foo", a: int, *params: Any, **options: Any) -> int: @@ -153,7 +153,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 88 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:90:43: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*params` +annotation_presence.py:90:43: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `*params` | 90 | # ANN401 91 | def foo(self: "Foo", a: int, *params: Any, **options: str) -> int: @@ -161,7 +161,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 92 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:94:59: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**options` +annotation_presence.py:94:59: ANN401 Dynamically typed expressions (typing.Any) are disallowed in `**options` | 94 | # ANN401 95 | def foo(self: "Foo", a: int, *params: str, **options: Any) -> int: @@ -169,7 +169,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 96 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:104:13: ANN102 Missing type annotation for `cls` in classmethod +annotation_presence.py:104:13: ANN102 Missing type annotation for `cls` in classmethod | 104 | # ANN102 105 | @classmethod @@ -178,7 +178,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 107 | pass | -./resources/test/fixtures/flake8_annotations/annotation_presence.py:108:13: ANN101 Missing type annotation for `self` in method +annotation_presence.py:108:13: ANN101 Missing type annotation for `self` in method | 108 | # ANN101 109 | def foo(self, /, a: int, b: int) -> int: diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap index 3d693ce8eb..3a52d7f812 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__ignore_fully_untyped.snap @@ -1,35 +1,35 @@ --- source: crates/ruff/src/rules/flake8_annotations/mod.rs --- -./resources/test/fixtures/flake8_annotations/ignore_fully_untyped.py:24:5: ANN201 Missing return type annotation for public function `error_partially_typed_1` +ignore_fully_untyped.py:24:5: ANN201 Missing return type annotation for public function `error_partially_typed_1` | 24 | def error_partially_typed_1(a: int, b): | ^^^^^^^^^^^^^^^^^^^^^^^ ANN201 25 | pass | -./resources/test/fixtures/flake8_annotations/ignore_fully_untyped.py:24:37: ANN001 Missing type annotation for function argument `b` +ignore_fully_untyped.py:24:37: ANN001 Missing type annotation for function argument `b` | 24 | def error_partially_typed_1(a: int, b): | ^ ANN001 25 | pass | -./resources/test/fixtures/flake8_annotations/ignore_fully_untyped.py:28:37: ANN001 Missing type annotation for function argument `b` +ignore_fully_untyped.py:28:37: ANN001 Missing type annotation for function argument `b` | 28 | def error_partially_typed_2(a: int, b) -> int: | ^ ANN001 29 | pass | -./resources/test/fixtures/flake8_annotations/ignore_fully_untyped.py:32:5: ANN201 Missing return type annotation for public function `error_partially_typed_3` +ignore_fully_untyped.py:32:5: ANN201 Missing return type annotation for public function `error_partially_typed_3` | 32 | def error_partially_typed_3(a: int, b: int): | ^^^^^^^^^^^^^^^^^^^^^^^ ANN201 33 | pass | -./resources/test/fixtures/flake8_annotations/ignore_fully_untyped.py:43:9: ANN201 Missing return type annotation for public function `error_typed_self` +ignore_fully_untyped.py:43:9: ANN201 Missing return type annotation for public function `error_typed_self` | 43 | pass 44 | diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap index e4a8ee4db1..c812b5c4b8 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__mypy_init_return.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_annotations/mod.rs --- -./resources/test/fixtures/flake8_annotations/mypy_init_return.py:5:9: ANN204 [*] Missing return type annotation for special method `__init__` +mypy_init_return.py:5:9: ANN204 [*] Missing return type annotation for special method `__init__` | 5 | # Error 6 | class Foo: @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 7 7 | 8 8 | -./resources/test/fixtures/flake8_annotations/mypy_init_return.py:11:9: ANN204 [*] Missing return type annotation for special method `__init__` +mypy_init_return.py:11:9: ANN204 [*] Missing return type annotation for special method `__init__` | 11 | # Error 12 | class Foo: @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 13 13 | 14 14 | -./resources/test/fixtures/flake8_annotations/mypy_init_return.py:40:5: ANN202 Missing return type annotation for private function `__init__` +mypy_init_return.py:40:5: ANN202 Missing return type annotation for private function `__init__` | 40 | # Error 41 | def __init__(self, foo: int): @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 42 | ... | -./resources/test/fixtures/flake8_annotations/mypy_init_return.py:47:9: ANN204 [*] Missing return type annotation for special method `__init__` +mypy_init_return.py:47:9: ANN204 [*] Missing return type annotation for special method `__init__` | 47 | # of a vararg falsely indicated that the function has a typed argument. 48 | class Foo: diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__simple_magic_methods.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__simple_magic_methods.snap index 80c50b52d3..643b59c6f6 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__simple_magic_methods.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__simple_magic_methods.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_annotations/mod.rs --- -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for special method `__str__` +simple_magic_methods.py:2:9: ANN204 [*] Missing return type annotation for special method `__str__` | 2 | class Foo: 3 | def __str__(self): @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 4 4 | 5 5 | def __repr__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:5:9: ANN204 [*] Missing return type annotation for special method `__repr__` +simple_magic_methods.py:5:9: ANN204 [*] Missing return type annotation for special method `__repr__` | 5 | ... 6 | @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 7 7 | 8 8 | def __len__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:8:9: ANN204 [*] Missing return type annotation for special method `__len__` +simple_magic_methods.py:8:9: ANN204 [*] Missing return type annotation for special method `__len__` | 8 | ... 9 | @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 10 10 | 11 11 | def __length_hint__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:11:9: ANN204 [*] Missing return type annotation for special method `__length_hint__` +simple_magic_methods.py:11:9: ANN204 [*] Missing return type annotation for special method `__length_hint__` | 11 | ... 12 | @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 13 13 | 14 14 | def __init__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:14:9: ANN204 [*] Missing return type annotation for special method `__init__` +simple_magic_methods.py:14:9: ANN204 [*] Missing return type annotation for special method `__init__` | 14 | ... 15 | @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 16 16 | 17 17 | def __del__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:17:9: ANN204 [*] Missing return type annotation for special method `__del__` +simple_magic_methods.py:17:9: ANN204 [*] Missing return type annotation for special method `__del__` | 17 | ... 18 | @@ -118,7 +118,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 19 19 | 20 20 | def __bool__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:20:9: ANN204 [*] Missing return type annotation for special method `__bool__` +simple_magic_methods.py:20:9: ANN204 [*] Missing return type annotation for special method `__bool__` | 20 | ... 21 | @@ -138,7 +138,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 22 22 | 23 23 | def __bytes__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:23:9: ANN204 [*] Missing return type annotation for special method `__bytes__` +simple_magic_methods.py:23:9: ANN204 [*] Missing return type annotation for special method `__bytes__` | 23 | ... 24 | @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 25 25 | 26 26 | def __format__(self, format_spec): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:26:9: ANN204 [*] Missing return type annotation for special method `__format__` +simple_magic_methods.py:26:9: ANN204 [*] Missing return type annotation for special method `__format__` | 26 | ... 27 | @@ -178,7 +178,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 28 28 | 29 29 | def __contains__(self, item): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:29:9: ANN204 [*] Missing return type annotation for special method `__contains__` +simple_magic_methods.py:29:9: ANN204 [*] Missing return type annotation for special method `__contains__` | 29 | ... 30 | @@ -198,7 +198,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 31 31 | 32 32 | def __complex__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:32:9: ANN204 [*] Missing return type annotation for special method `__complex__` +simple_magic_methods.py:32:9: ANN204 [*] Missing return type annotation for special method `__complex__` | 32 | ... 33 | @@ -218,7 +218,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 34 34 | 35 35 | def __int__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:35:9: ANN204 [*] Missing return type annotation for special method `__int__` +simple_magic_methods.py:35:9: ANN204 [*] Missing return type annotation for special method `__int__` | 35 | ... 36 | @@ -238,7 +238,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 37 37 | 38 38 | def __float__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:38:9: ANN204 [*] Missing return type annotation for special method `__float__` +simple_magic_methods.py:38:9: ANN204 [*] Missing return type annotation for special method `__float__` | 38 | ... 39 | @@ -258,7 +258,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 40 40 | 41 41 | def __index__(self): -./resources/test/fixtures/flake8_annotations/simple_magic_methods.py:41:9: ANN204 [*] Missing return type annotation for special method `__index__` +simple_magic_methods.py:41:9: ANN204 [*] Missing return type annotation for special method `__index__` | 41 | ... 42 | diff --git a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap index 552a273838..5f40c262d4 100644 --- a/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap +++ b/crates/ruff/src/rules/flake8_annotations/snapshots/ruff__rules__flake8_annotations__tests__suppress_none_returning.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_annotations/mod.rs --- -./resources/test/fixtures/flake8_annotations/suppress_none_returning.py:45:5: ANN201 Missing return type annotation for public function `foo` +suppress_none_returning.py:45:5: ANN201 Missing return type annotation for public function `foo` | 45 | # Error 46 | def foo(): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 47 | return True | -./resources/test/fixtures/flake8_annotations/suppress_none_returning.py:50:5: ANN201 Missing return type annotation for public function `foo` +suppress_none_returning.py:50:5: ANN201 Missing return type annotation for public function `foo` | 50 | # Error 51 | def foo(): @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_annotations/mod.rs 53 | if a == 4: | -./resources/test/fixtures/flake8_annotations/suppress_none_returning.py:59:9: ANN001 Missing type annotation for function argument `a` +suppress_none_returning.py:59:9: ANN001 Missing type annotation for function argument `a` | 59 | # Error (on the argument, but not the return type) 60 | def foo(a): diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap index 7a12eee6c0..31e64a5c69 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S101_S101.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S101.py:2:1: S101 Use of `assert` detected +S101.py:2:1: S101 Use of `assert` detected | 2 | # Error 3 | assert True @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 5 | def fn(): | -./resources/test/fixtures/flake8_bandit/S101.py:8:5: S101 Use of `assert` detected +S101.py:8:5: S101 Use of `assert` detected | 8 | # Error 9 | assert x == 1 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 11 | # Error | -./resources/test/fixtures/flake8_bandit/S101.py:11:5: S101 Use of `assert` detected +S101.py:11:5: S101 Use of `assert` detected | 11 | # Error 12 | assert x == 2 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap index fab38167a4..fc5a060a35 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S102_S102.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S102.py:3:5: S102 Use of `exec` detected +S102.py:3:5: S102 Use of `exec` detected | 3 | def fn(): 4 | # Error @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 7 | exec('y = 3') | -./resources/test/fixtures/flake8_bandit/S102.py:5:1: S102 Use of `exec` detected +S102.py:5:1: S102 Use of `exec` detected | 5 | exec('x = 2') 6 | diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap index 3522f2153f..994bdaa5f9 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S103_S103.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S103.py:6:25: S103 `os.chmod` setting a permissive mask `0o227` on file or directory +S103.py:6:25: S103 `os.chmod` setting a permissive mask `0o227` on file or directory | 6 | keyfile = "foo" 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 10 | os.chmod("/etc/passwd", 0o664) # OK | -./resources/test/fixtures/flake8_bandit/S103.py:7:25: S103 `os.chmod` setting a permissive mask `0o7` on file or directory +S103.py:7:25: S103 `os.chmod` setting a permissive mask `0o7` on file or directory | 7 | os.chmod("/etc/passwd", 0o227) # Error 8 | os.chmod("/etc/passwd", 0o7) # Error @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 10 | os.chmod("/etc/passwd", 0o777) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:9:25: S103 `os.chmod` setting a permissive mask `0o777` on file or directory +S103.py:9:25: S103 `os.chmod` setting a permissive mask `0o777` on file or directory | 9 | os.chmod("/etc/passwd", 0o7) # Error 10 | os.chmod("/etc/passwd", 0o664) # OK @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 13 | os.chmod("/etc/passwd", 0o776) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:10:25: S103 `os.chmod` setting a permissive mask `0o770` on file or directory +S103.py:10:25: S103 `os.chmod` setting a permissive mask `0o770` on file or directory | 10 | os.chmod("/etc/passwd", 0o664) # OK 11 | os.chmod("/etc/passwd", 0o777) # Error @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 14 | os.chmod("/etc/passwd", 0o760) # OK | -./resources/test/fixtures/flake8_bandit/S103.py:11:25: S103 `os.chmod` setting a permissive mask `0o776` on file or directory +S103.py:11:25: S103 `os.chmod` setting a permissive mask `0o776` on file or directory | 11 | os.chmod("/etc/passwd", 0o777) # Error 12 | os.chmod("/etc/passwd", 0o770) # Error @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 15 | os.chmod("~/.bashrc", 511) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:13:23: S103 `os.chmod` setting a permissive mask `0o777` on file or directory +S103.py:13:23: S103 `os.chmod` setting a permissive mask `0o777` on file or directory | 13 | os.chmod("/etc/passwd", 0o776) # Error 14 | os.chmod("/etc/passwd", 0o760) # OK @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 17 | os.chmod("/tmp/oh_hai", 0x1FF) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:14:24: S103 `os.chmod` setting a permissive mask `0o777` on file or directory +S103.py:14:24: S103 `os.chmod` setting a permissive mask `0o777` on file or directory | 14 | os.chmod("/etc/passwd", 0o760) # OK 15 | os.chmod("~/.bashrc", 511) # Error @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 18 | os.chmod("/etc/passwd", stat.S_IRWXU) # OK | -./resources/test/fixtures/flake8_bandit/S103.py:15:25: S103 `os.chmod` setting a permissive mask `0o777` on file or directory +S103.py:15:25: S103 `os.chmod` setting a permissive mask `0o777` on file or directory | 15 | os.chmod("~/.bashrc", 511) # Error 16 | os.chmod("/etc/hosts", 0o777) # Error @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 19 | os.chmod(keyfile, 0o777) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:17:19: S103 `os.chmod` setting a permissive mask `0o777` on file or directory +S103.py:17:19: S103 `os.chmod` setting a permissive mask `0o777` on file or directory | 17 | os.chmod("/tmp/oh_hai", 0x1FF) # Error 18 | os.chmod("/etc/passwd", stat.S_IRWXU) # OK @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 21 | os.chmod(keyfile, stat.S_IRWXO | stat.S_IRWXG | stat.S_IRWXU) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:18:19: S103 `os.chmod` setting a permissive mask `0o777` on file or directory +S103.py:18:19: S103 `os.chmod` setting a permissive mask `0o777` on file or directory | 18 | os.chmod("/etc/passwd", stat.S_IRWXU) # OK 19 | os.chmod(keyfile, 0o777) # Error @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 22 | os.chmod("~/hidden_exec", stat.S_IXGRP) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:19:19: S103 `os.chmod` setting a permissive mask `0o777` on file or directory +S103.py:19:19: S103 `os.chmod` setting a permissive mask `0o777` on file or directory | 19 | os.chmod(keyfile, 0o777) # Error 20 | os.chmod(keyfile, 0o7 | 0o70 | 0o700) # Error @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 23 | os.chmod("~/hidden_exec", stat.S_IXOTH) # OK | -./resources/test/fixtures/flake8_bandit/S103.py:20:27: S103 `os.chmod` setting a permissive mask `0o10` on file or directory +S103.py:20:27: S103 `os.chmod` setting a permissive mask `0o10` on file or directory | 20 | os.chmod(keyfile, 0o7 | 0o70 | 0o700) # Error 21 | os.chmod(keyfile, stat.S_IRWXO | stat.S_IRWXG | stat.S_IRWXU) # Error @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 24 | os.chmod("/etc/passwd", stat.S_IWOTH) # Error | -./resources/test/fixtures/flake8_bandit/S103.py:22:25: S103 `os.chmod` setting a permissive mask `0o2` on file or directory +S103.py:22:25: S103 `os.chmod` setting a permissive mask `0o2` on file or directory | 22 | os.chmod("~/hidden_exec", stat.S_IXGRP) # Error 23 | os.chmod("~/hidden_exec", stat.S_IXOTH) # OK diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap index 4ad0fa099e..e7423b5745 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S104_S104.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S104.py:9:1: S104 Possible binding to all interfaces +S104.py:9:1: S104 Possible binding to all interfaces | 9 | # Error 10 | "0.0.0.0" @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 11 | '0.0.0.0' | -./resources/test/fixtures/flake8_bandit/S104.py:10:1: S104 Possible binding to all interfaces +S104.py:10:1: S104 Possible binding to all interfaces | 10 | # Error 11 | "0.0.0.0" @@ -17,14 +17,14 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs | ^^^^^^^^^ S104 | -./resources/test/fixtures/flake8_bandit/S104.py:14:6: S104 Possible binding to all interfaces +S104.py:14:6: S104 Possible binding to all interfaces | 14 | # Error 15 | func("0.0.0.0") | ^^^^^^^^^ S104 | -./resources/test/fixtures/flake8_bandit/S104.py:18:9: S104 Possible binding to all interfaces +S104.py:18:9: S104 Possible binding to all interfaces | 18 | def my_func(): 19 | x = "0.0.0.0" diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap index 32154a54db..f4a844b1d1 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S105_S105.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S105.py:13:12: S105 Possible hardcoded password: "s3cr3t" +S105.py:13:12: S105 Possible hardcoded password: "s3cr3t" | 13 | # Errors 14 | password = "s3cr3t" @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 16 | passwd = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:14:9: S105 Possible hardcoded password: "s3cr3t" +S105.py:14:9: S105 Possible hardcoded password: "s3cr3t" | 14 | # Errors 15 | password = "s3cr3t" @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 18 | pwd = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:15:10: S105 Possible hardcoded password: "s3cr3t" +S105.py:15:10: S105 Possible hardcoded password: "s3cr3t" | 15 | password = "s3cr3t" 16 | _pass = "s3cr3t" @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 19 | secret = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:16:7: S105 Possible hardcoded password: "s3cr3t" +S105.py:16:7: S105 Possible hardcoded password: "s3cr3t" | 16 | _pass = "s3cr3t" 17 | passwd = "s3cr3t" @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 20 | token = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:17:10: S105 Possible hardcoded password: "s3cr3t" +S105.py:17:10: S105 Possible hardcoded password: "s3cr3t" | 17 | passwd = "s3cr3t" 18 | pwd = "s3cr3t" @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 21 | secrete = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:18:9: S105 Possible hardcoded password: "s3cr3t" +S105.py:18:9: S105 Possible hardcoded password: "s3cr3t" | 18 | pwd = "s3cr3t" 19 | secret = "s3cr3t" @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 22 | safe = password = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:19:11: S105 Possible hardcoded password: "s3cr3t" +S105.py:19:11: S105 Possible hardcoded password: "s3cr3t" | 19 | secret = "s3cr3t" 20 | token = "s3cr3t" @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 23 | password = safe = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:20:19: S105 Possible hardcoded password: "s3cr3t" +S105.py:20:19: S105 Possible hardcoded password: "s3cr3t" | 20 | token = "s3cr3t" 21 | secrete = "s3cr3t" @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 24 | PASSWORD = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:21:19: S105 Possible hardcoded password: "s3cr3t" +S105.py:21:19: S105 Possible hardcoded password: "s3cr3t" | 21 | secrete = "s3cr3t" 22 | safe = password = "s3cr3t" @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 25 | PassWord = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:22:12: S105 Possible hardcoded password: "s3cr3t" +S105.py:22:12: S105 Possible hardcoded password: "s3cr3t" | 22 | safe = password = "s3cr3t" 23 | password = safe = "s3cr3t" @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 25 | PassWord = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:23:12: S105 Possible hardcoded password: "s3cr3t" +S105.py:23:12: S105 Possible hardcoded password: "s3cr3t" | 23 | password = safe = "s3cr3t" 24 | PASSWORD = "s3cr3t" @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 27 | d["password"] = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:25:17: S105 Possible hardcoded password: "s3cr3t" +S105.py:25:17: S105 Possible hardcoded password: "s3cr3t" | 25 | PassWord = "s3cr3t" 26 | @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 29 | d["passwd"] = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:26:13: S105 Possible hardcoded password: "s3cr3t" +S105.py:26:13: S105 Possible hardcoded password: "s3cr3t" | 26 | d["password"] = "s3cr3t" 27 | d["pass"] = "s3cr3t" @@ -128,7 +128,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 29 | d["pwd"] = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:27:15: S105 Possible hardcoded password: "s3cr3t" +S105.py:27:15: S105 Possible hardcoded password: "s3cr3t" | 27 | d["password"] = "s3cr3t" 28 | d["pass"] = "s3cr3t" @@ -138,7 +138,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 31 | d["secret"] = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:28:12: S105 Possible hardcoded password: "s3cr3t" +S105.py:28:12: S105 Possible hardcoded password: "s3cr3t" | 28 | d["pass"] = "s3cr3t" 29 | d["passwd"] = "s3cr3t" @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 32 | d["token"] = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:29:15: S105 Possible hardcoded password: "s3cr3t" +S105.py:29:15: S105 Possible hardcoded password: "s3cr3t" | 29 | d["passwd"] = "s3cr3t" 30 | d["pwd"] = "s3cr3t" @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 33 | d["secrete"] = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:30:14: S105 Possible hardcoded password: "s3cr3t" +S105.py:30:14: S105 Possible hardcoded password: "s3cr3t" | 30 | d["pwd"] = "s3cr3t" 31 | d["secret"] = "s3cr3t" @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 34 | safe = d["password"] = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:31:16: S105 Possible hardcoded password: "s3cr3t" +S105.py:31:16: S105 Possible hardcoded password: "s3cr3t" | 31 | d["secret"] = "s3cr3t" 32 | d["token"] = "s3cr3t" @@ -178,7 +178,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 35 | d["password"] = safe = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:32:24: S105 Possible hardcoded password: "s3cr3t" +S105.py:32:24: S105 Possible hardcoded password: "s3cr3t" | 32 | d["token"] = "s3cr3t" 33 | d["secrete"] = "s3cr3t" @@ -187,7 +187,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 35 | d["password"] = safe = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:33:24: S105 Possible hardcoded password: "s3cr3t" +S105.py:33:24: S105 Possible hardcoded password: "s3cr3t" | 33 | d["secrete"] = "s3cr3t" 34 | safe = d["password"] = "s3cr3t" @@ -195,7 +195,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs | ^^^^^^^^ S105 | -./resources/test/fixtures/flake8_bandit/S105.py:37:16: S105 Possible hardcoded password: "s3cr3t" +S105.py:37:16: S105 Possible hardcoded password: "s3cr3t" | 37 | class MyClass: 38 | password = "s3cr3t" @@ -203,7 +203,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 39 | safe = password | -./resources/test/fixtures/flake8_bandit/S105.py:41:20: S105 Possible hardcoded password: "s3cr3t" +S105.py:41:20: S105 Possible hardcoded password: "s3cr3t" | 41 | MyClass.password = "s3cr3t" | ^^^^^^^^ S105 @@ -211,7 +211,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 43 | MyClass.passwd = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:42:17: S105 Possible hardcoded password: "s3cr3t" +S105.py:42:17: S105 Possible hardcoded password: "s3cr3t" | 42 | MyClass.password = "s3cr3t" 43 | MyClass._pass = "s3cr3t" @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 45 | MyClass.pwd = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:43:18: S105 Possible hardcoded password: "s3cr3t" +S105.py:43:18: S105 Possible hardcoded password: "s3cr3t" | 43 | MyClass.password = "s3cr3t" 44 | MyClass._pass = "s3cr3t" @@ -230,7 +230,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 47 | MyClass.secret = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:44:15: S105 Possible hardcoded password: "s3cr3t" +S105.py:44:15: S105 Possible hardcoded password: "s3cr3t" | 44 | MyClass._pass = "s3cr3t" 45 | MyClass.passwd = "s3cr3t" @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 48 | MyClass.token = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:45:18: S105 Possible hardcoded password: "s3cr3t" +S105.py:45:18: S105 Possible hardcoded password: "s3cr3t" | 45 | MyClass.passwd = "s3cr3t" 46 | MyClass.pwd = "s3cr3t" @@ -250,7 +250,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 49 | MyClass.secrete = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:46:17: S105 Possible hardcoded password: "s3cr3t" +S105.py:46:17: S105 Possible hardcoded password: "s3cr3t" | 46 | MyClass.pwd = "s3cr3t" 47 | MyClass.secret = "s3cr3t" @@ -259,7 +259,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 49 | MyClass.secrete = "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:47:19: S105 Possible hardcoded password: "s3cr3t" +S105.py:47:19: S105 Possible hardcoded password: "s3cr3t" | 47 | MyClass.secret = "s3cr3t" 48 | MyClass.token = "s3cr3t" @@ -269,7 +269,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 51 | password == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:49:13: S105 Possible hardcoded password: "s3cr3t" +S105.py:49:13: S105 Possible hardcoded password: "s3cr3t" | 49 | MyClass.secrete = "s3cr3t" 50 | @@ -279,7 +279,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 53 | passwd == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:50:10: S105 Possible hardcoded password: "s3cr3t" +S105.py:50:10: S105 Possible hardcoded password: "s3cr3t" | 50 | password == "s3cr3t" 51 | _pass == "s3cr3t" @@ -288,7 +288,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 53 | pwd == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:51:11: S105 Possible hardcoded password: "s3cr3t" +S105.py:51:11: S105 Possible hardcoded password: "s3cr3t" | 51 | password == "s3cr3t" 52 | _pass == "s3cr3t" @@ -298,7 +298,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 55 | secret == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:52:8: S105 Possible hardcoded password: "s3cr3t" +S105.py:52:8: S105 Possible hardcoded password: "s3cr3t" | 52 | _pass == "s3cr3t" 53 | passwd == "s3cr3t" @@ -308,7 +308,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 56 | token == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:53:11: S105 Possible hardcoded password: "s3cr3t" +S105.py:53:11: S105 Possible hardcoded password: "s3cr3t" | 53 | passwd == "s3cr3t" 54 | pwd == "s3cr3t" @@ -318,7 +318,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 57 | secrete == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:54:10: S105 Possible hardcoded password: "s3cr3t" +S105.py:54:10: S105 Possible hardcoded password: "s3cr3t" | 54 | pwd == "s3cr3t" 55 | secret == "s3cr3t" @@ -328,7 +328,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 58 | password == safe == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:55:12: S105 Possible hardcoded password: "s3cr3t" +S105.py:55:12: S105 Possible hardcoded password: "s3cr3t" | 55 | secret == "s3cr3t" 56 | token == "s3cr3t" @@ -337,7 +337,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 58 | password == safe == "s3cr3t" | -./resources/test/fixtures/flake8_bandit/S105.py:56:21: S105 Possible hardcoded password: "s3cr3t" +S105.py:56:21: S105 Possible hardcoded password: "s3cr3t" | 56 | token == "s3cr3t" 57 | secrete == "s3cr3t" @@ -347,7 +347,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 60 | if token == "1\n2": | -./resources/test/fixtures/flake8_bandit/S105.py:58:13: S105 Possible hardcoded password: "1\n2" +S105.py:58:13: S105 Possible hardcoded password: "1\n2" | 58 | password == safe == "s3cr3t" 59 | @@ -356,7 +356,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 61 | pass | -./resources/test/fixtures/flake8_bandit/S105.py:61:13: S105 Possible hardcoded password: "3\t4" +S105.py:61:13: S105 Possible hardcoded password: "3\t4" | 61 | pass 62 | @@ -365,7 +365,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 64 | pass | -./resources/test/fixtures/flake8_bandit/S105.py:64:13: S105 Possible hardcoded password: "5\r6" +S105.py:64:13: S105 Possible hardcoded password: "5\r6" | 64 | pass 65 | diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap index 0ab8f84cd5..a20ebddeef 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S106_S106.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S106.py:14:9: S106 Possible hardcoded password: "s3cr3t" +S106.py:14:9: S106 Possible hardcoded password: "s3cr3t" | 14 | # Error 15 | func(1, password="s3cr3t") diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap index b8fbfae3c0..39ac4461cb 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S107_S107.py.snap @@ -1,35 +1,35 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S107.py:5:29: S107 Possible hardcoded password: "default" +S107.py:5:29: S107 Possible hardcoded password: "default" | 5 | def default(first, password="default"): | ^^^^^^^^^ S107 6 | pass | -./resources/test/fixtures/flake8_bandit/S107.py:13:45: S107 Possible hardcoded password: "posonly" +S107.py:13:45: S107 Possible hardcoded password: "posonly" | 13 | def default_posonly(first, /, pos, password="posonly"): | ^^^^^^^^^ S107 14 | pass | -./resources/test/fixtures/flake8_bandit/S107.py:21:39: S107 Possible hardcoded password: "kwonly" +S107.py:21:39: S107 Possible hardcoded password: "kwonly" | 21 | def default_kwonly(first, *, password="kwonly"): | ^^^^^^^^ S107 22 | pass | -./resources/test/fixtures/flake8_bandit/S107.py:29:39: S107 Possible hardcoded password: "posonly" +S107.py:29:39: S107 Possible hardcoded password: "posonly" | 29 | def default_all(first, /, pos, secret="posonly", *, password="kwonly"): | ^^^^^^^^^ S107 30 | pass | -./resources/test/fixtures/flake8_bandit/S107.py:29:62: S107 Possible hardcoded password: "kwonly" +S107.py:29:62: S107 Possible hardcoded password: "kwonly" | 29 | def default_all(first, /, pos, secret="posonly", *, password="kwonly"): | ^^^^^^^^ S107 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap index a1af2786a4..ed0ea1706e 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_S108.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc" +S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc" | 5 | f.write("def") 6 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | f.write("def") | -./resources/test/fixtures/flake8_bandit/S108.py:8:11: S108 Probable insecure usage of temporary file or directory: "/var/tmp/123" +S108.py:8:11: S108 Probable insecure usage of temporary file or directory: "/var/tmp/123" | 8 | f.write("def") 9 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 11 | f.write("def") | -./resources/test/fixtures/flake8_bandit/S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/dev/shm/unit/test" +S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/dev/shm/unit/test" | 11 | f.write("def") 12 | diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap index fa46ea0b71..d375738e49 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S108_extend.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc" +S108.py:5:11: S108 Probable insecure usage of temporary file or directory: "/tmp/abc" | 5 | f.write("def") 6 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | f.write("def") | -./resources/test/fixtures/flake8_bandit/S108.py:8:11: S108 Probable insecure usage of temporary file or directory: "/var/tmp/123" +S108.py:8:11: S108 Probable insecure usage of temporary file or directory: "/var/tmp/123" | 8 | f.write("def") 9 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 11 | f.write("def") | -./resources/test/fixtures/flake8_bandit/S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/dev/shm/unit/test" +S108.py:11:11: S108 Probable insecure usage of temporary file or directory: "/dev/shm/unit/test" | 11 | f.write("def") 12 | @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 14 | f.write("def") | -./resources/test/fixtures/flake8_bandit/S108.py:15:11: S108 Probable insecure usage of temporary file or directory: "/foo/bar" +S108.py:15:11: S108 Probable insecure usage of temporary file or directory: "/foo/bar" | 15 | # not ok by config 16 | with open("/foo/bar", "w") as f: diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap index d157cc085f..6d1e7a56be 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_S110.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception +S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception | 3 | try: 4 | pass @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | try: | -./resources/test/fixtures/flake8_bandit/S110.py:8:1: S110 `try`-`except`-`pass` detected, consider logging the exception +S110.py:8:1: S110 `try`-`except`-`pass` detected, consider logging the exception | 8 | try: 9 | pass diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap index 4b03ea5d21..fddc649027 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S110_typed.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception +S110.py:3:1: S110 `try`-`except`-`pass` detected, consider logging the exception | 3 | try: 4 | pass @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | try: | -./resources/test/fixtures/flake8_bandit/S110.py:8:1: S110 `try`-`except`-`pass` detected, consider logging the exception +S110.py:8:1: S110 `try`-`except`-`pass` detected, consider logging the exception | 8 | try: 9 | pass @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 13 | try: | -./resources/test/fixtures/flake8_bandit/S110.py:13:1: S110 `try`-`except`-`pass` detected, consider logging the exception +S110.py:13:1: S110 `try`-`except`-`pass` detected, consider logging the exception | 13 | try: 14 | pass diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap index cd0d408a35..864f8e0744 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S112_S112.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S112.py:3:1: S112 `try`-`except`-`continue` detected, consider logging the exception +S112.py:3:1: S112 `try`-`except`-`continue` detected, consider logging the exception | 3 | try: 4 | pass @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | try: | -./resources/test/fixtures/flake8_bandit/S112.py:8:1: S112 `try`-`except`-`continue` detected, consider logging the exception +S112.py:8:1: S112 `try`-`except`-`continue` detected, consider logging the exception | 8 | try: 9 | pass @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 13 | try: | -./resources/test/fixtures/flake8_bandit/S112.py:13:1: S112 `try`-`except`-`continue` detected, consider logging the exception +S112.py:13:1: S112 `try`-`except`-`continue` detected, consider logging the exception | 13 | try: 14 | pass @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 18 | try: | -./resources/test/fixtures/flake8_bandit/S112.py:18:1: S112 `try`-`except`-`continue` detected, consider logging the exception +S112.py:18:1: S112 `try`-`except`-`continue` detected, consider logging the exception | 18 | try: 19 | pass diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap index 5f991f100c..4a9afcb84a 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S113_S113.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S113.py:3:1: S113 Probable use of requests call without timeout +S113.py:3:1: S113 Probable use of requests call without timeout | 3 | import requests 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 7 | requests.get('https://gmail.com', timeout=5) | -./resources/test/fixtures/flake8_bandit/S113.py:4:43: S113 Probable use of requests call with timeout set to `None` +S113.py:4:43: S113 Probable use of requests call with timeout set to `None` | 4 | requests.get('https://gmail.com') 5 | requests.get('https://gmail.com', timeout=None) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 7 | requests.post('https://gmail.com') | -./resources/test/fixtures/flake8_bandit/S113.py:6:1: S113 Probable use of requests call without timeout +S113.py:6:1: S113 Probable use of requests call without timeout | 6 | requests.get('https://gmail.com', timeout=None) 7 | requests.get('https://gmail.com', timeout=5) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 10 | requests.post('https://gmail.com', timeout=5) | -./resources/test/fixtures/flake8_bandit/S113.py:7:44: S113 Probable use of requests call with timeout set to `None` +S113.py:7:44: S113 Probable use of requests call with timeout set to `None` | 7 | requests.get('https://gmail.com', timeout=5) 8 | requests.post('https://gmail.com') @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 11 | requests.put('https://gmail.com') | -./resources/test/fixtures/flake8_bandit/S113.py:9:1: S113 Probable use of requests call without timeout +S113.py:9:1: S113 Probable use of requests call without timeout | 9 | requests.post('https://gmail.com', timeout=None) 10 | requests.post('https://gmail.com', timeout=5) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 13 | requests.put('https://gmail.com', timeout=5) | -./resources/test/fixtures/flake8_bandit/S113.py:10:43: S113 Probable use of requests call with timeout set to `None` +S113.py:10:43: S113 Probable use of requests call with timeout set to `None` | 10 | requests.post('https://gmail.com', timeout=5) 11 | requests.put('https://gmail.com') @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 14 | requests.delete('https://gmail.com') | -./resources/test/fixtures/flake8_bandit/S113.py:12:1: S113 Probable use of requests call without timeout +S113.py:12:1: S113 Probable use of requests call without timeout | 12 | requests.put('https://gmail.com', timeout=None) 13 | requests.put('https://gmail.com', timeout=5) @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 16 | requests.delete('https://gmail.com', timeout=5) | -./resources/test/fixtures/flake8_bandit/S113.py:13:46: S113 Probable use of requests call with timeout set to `None` +S113.py:13:46: S113 Probable use of requests call with timeout set to `None` | 13 | requests.put('https://gmail.com', timeout=5) 14 | requests.delete('https://gmail.com') @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 17 | requests.patch('https://gmail.com') | -./resources/test/fixtures/flake8_bandit/S113.py:15:1: S113 Probable use of requests call without timeout +S113.py:15:1: S113 Probable use of requests call without timeout | 15 | requests.delete('https://gmail.com', timeout=None) 16 | requests.delete('https://gmail.com', timeout=5) @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 19 | requests.patch('https://gmail.com', timeout=5) | -./resources/test/fixtures/flake8_bandit/S113.py:16:45: S113 Probable use of requests call with timeout set to `None` +S113.py:16:45: S113 Probable use of requests call with timeout set to `None` | 16 | requests.delete('https://gmail.com', timeout=5) 17 | requests.patch('https://gmail.com') @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 20 | requests.options('https://gmail.com') | -./resources/test/fixtures/flake8_bandit/S113.py:18:1: S113 Probable use of requests call without timeout +S113.py:18:1: S113 Probable use of requests call without timeout | 18 | requests.patch('https://gmail.com', timeout=None) 19 | requests.patch('https://gmail.com', timeout=5) @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 22 | requests.options('https://gmail.com', timeout=5) | -./resources/test/fixtures/flake8_bandit/S113.py:19:47: S113 Probable use of requests call with timeout set to `None` +S113.py:19:47: S113 Probable use of requests call with timeout set to `None` | 19 | requests.patch('https://gmail.com', timeout=5) 20 | requests.options('https://gmail.com') @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 23 | requests.head('https://gmail.com') | -./resources/test/fixtures/flake8_bandit/S113.py:21:1: S113 Probable use of requests call without timeout +S113.py:21:1: S113 Probable use of requests call without timeout | 21 | requests.options('https://gmail.com', timeout=None) 22 | requests.options('https://gmail.com', timeout=5) @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 25 | requests.head('https://gmail.com', timeout=5) | -./resources/test/fixtures/flake8_bandit/S113.py:22:44: S113 Probable use of requests call with timeout set to `None` +S113.py:22:44: S113 Probable use of requests call with timeout set to `None` | 22 | requests.options('https://gmail.com', timeout=5) 23 | requests.head('https://gmail.com') diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S301_S301.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S301_S301.py.snap index 496616f42d..94dfce0741 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S301_S301.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S301_S301.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S301.py:3:1: S301 `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue +S301.py:3:1: S301 `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue | 3 | import pickle 4 | diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S312_S312.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S312_S312.py.snap index 7878b54f59..efa543acb5 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S312_S312.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S312_S312.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S312.py:3:1: S312 Telnet-related functions are being called. Telnet is considered insecure. Use SSH or some other encrypted protocol. +S312.py:3:1: S312 Telnet-related functions are being called. Telnet is considered insecure. Use SSH or some other encrypted protocol. | 3 | from telnetlib import Telnet 4 | diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap index 46730fb6f2..56cb517c09 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S324_S324.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S324.py:7:13: S324 Probable use of insecure hash functions in `hashlib`: `md5` +S324.py:7:13: S324 Probable use of insecure hash functions in `hashlib`: `md5` | 7 | # Invalid 8 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 11 | hashlib.new('md4', b'test') | -./resources/test/fixtures/flake8_bandit/S324.py:9:13: S324 Probable use of insecure hash functions in `hashlib`: `md4` +S324.py:9:13: S324 Probable use of insecure hash functions in `hashlib`: `md4` | 9 | hashlib.new('md5') 10 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 13 | hashlib.new(name='md5', data=b'test') | -./resources/test/fixtures/flake8_bandit/S324.py:11:18: S324 Probable use of insecure hash functions in `hashlib`: `md5` +S324.py:11:18: S324 Probable use of insecure hash functions in `hashlib`: `md5` | 11 | hashlib.new('md4', b'test') 12 | @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 15 | hashlib.new('MD4', data=b'test') | -./resources/test/fixtures/flake8_bandit/S324.py:13:13: S324 Probable use of insecure hash functions in `hashlib`: `MD4` +S324.py:13:13: S324 Probable use of insecure hash functions in `hashlib`: `MD4` | 13 | hashlib.new(name='md5', data=b'test') 14 | @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 17 | hashlib.new('sha1') | -./resources/test/fixtures/flake8_bandit/S324.py:15:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` +S324.py:15:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` | 15 | hashlib.new('MD4', data=b'test') 16 | @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 19 | hashlib.new('sha1', data=b'test') | -./resources/test/fixtures/flake8_bandit/S324.py:17:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` +S324.py:17:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` | 17 | hashlib.new('sha1') 18 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 21 | hashlib.new('sha', data=b'test') | -./resources/test/fixtures/flake8_bandit/S324.py:19:13: S324 Probable use of insecure hash functions in `hashlib`: `sha` +S324.py:19:13: S324 Probable use of insecure hash functions in `hashlib`: `sha` | 19 | hashlib.new('sha1', data=b'test') 20 | @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 23 | hashlib.new(name='SHA', data=b'test') | -./resources/test/fixtures/flake8_bandit/S324.py:21:18: S324 Probable use of insecure hash functions in `hashlib`: `SHA` +S324.py:21:18: S324 Probable use of insecure hash functions in `hashlib`: `SHA` | 21 | hashlib.new('sha', data=b'test') 22 | @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 25 | hashlib.sha(data=b'test') | -./resources/test/fixtures/flake8_bandit/S324.py:23:1: S324 Probable use of insecure hash functions in `hashlib`: `sha` +S324.py:23:1: S324 Probable use of insecure hash functions in `hashlib`: `sha` | 23 | hashlib.new(name='SHA', data=b'test') 24 | @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 27 | hashlib.md5() | -./resources/test/fixtures/flake8_bandit/S324.py:25:1: S324 Probable use of insecure hash functions in `hashlib`: `md5` +S324.py:25:1: S324 Probable use of insecure hash functions in `hashlib`: `md5` | 25 | hashlib.sha(data=b'test') 26 | @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 29 | hashlib_new('sha1') | -./resources/test/fixtures/flake8_bandit/S324.py:27:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` +S324.py:27:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` | 27 | hashlib.md5() 28 | @@ -111,7 +111,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 31 | hashlib_sha1('sha1') | -./resources/test/fixtures/flake8_bandit/S324.py:29:1: S324 Probable use of insecure hash functions in `hashlib`: `sha1` +S324.py:29:1: S324 Probable use of insecure hash functions in `hashlib`: `sha1` | 29 | hashlib_new('sha1') 30 | @@ -121,7 +121,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 33 | # usedforsecurity arg only available in Python 3.9+ | -./resources/test/fixtures/flake8_bandit/S324.py:32:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` +S324.py:32:13: S324 Probable use of insecure hash functions in `hashlib`: `sha1` | 32 | # usedforsecurity arg only available in Python 3.9+ 33 | hashlib.new('sha1', usedforsecurity=True) diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap index e6e403ff99..e192bd5011 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S501_S501.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S501.py:5:54: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks +S501.py:5:54: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks | 5 | requests.get('https://gmail.com', timeout=30, verify=True) 6 | requests.get('https://gmail.com', timeout=30, verify=False) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | requests.post('https://gmail.com', timeout=30, verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:7:55: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks +S501.py:7:55: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks | 7 | requests.get('https://gmail.com', timeout=30, verify=False) 8 | requests.post('https://gmail.com', timeout=30, verify=True) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 11 | requests.put('https://gmail.com', timeout=30, verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:9:54: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks +S501.py:9:54: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks | 9 | requests.post('https://gmail.com', timeout=30, verify=False) 10 | requests.put('https://gmail.com', timeout=30, verify=True) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 13 | requests.delete('https://gmail.com', timeout=30, verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:11:57: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks +S501.py:11:57: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks | 11 | requests.put('https://gmail.com', timeout=30, verify=False) 12 | requests.delete('https://gmail.com', timeout=30, verify=True) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 15 | requests.patch('https://gmail.com', timeout=30, verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:13:56: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks +S501.py:13:56: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks | 13 | requests.delete('https://gmail.com', timeout=30, verify=False) 14 | requests.patch('https://gmail.com', timeout=30, verify=True) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 17 | requests.options('https://gmail.com', timeout=30, verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:15:58: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks +S501.py:15:58: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks | 15 | requests.patch('https://gmail.com', timeout=30, verify=False) 16 | requests.options('https://gmail.com', timeout=30, verify=True) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 19 | requests.head('https://gmail.com', timeout=30, verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:17:55: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks +S501.py:17:55: S501 Probable use of `requests` call with `verify=False` disabling SSL certificate checks | 17 | requests.options('https://gmail.com', timeout=30, verify=False) 18 | requests.head('https://gmail.com', timeout=30, verify=True) @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 21 | httpx.request('GET', 'https://gmail.com', verify=True) | -./resources/test/fixtures/flake8_bandit/S501.py:20:50: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:20:50: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 20 | httpx.request('GET', 'https://gmail.com', verify=True) 21 | httpx.request('GET', 'https://gmail.com', verify=False) @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 23 | httpx.get('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:22:39: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:22:39: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 22 | httpx.request('GET', 'https://gmail.com', verify=False) 23 | httpx.get('https://gmail.com', verify=True) @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 26 | httpx.options('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:24:43: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:24:43: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 24 | httpx.get('https://gmail.com', verify=False) 25 | httpx.options('https://gmail.com', verify=True) @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 28 | httpx.head('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:26:40: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:26:40: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 26 | httpx.options('https://gmail.com', verify=False) 27 | httpx.head('https://gmail.com', verify=True) @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 30 | httpx.post('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:28:40: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:28:40: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 28 | httpx.head('https://gmail.com', verify=False) 29 | httpx.post('https://gmail.com', verify=True) @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 32 | httpx.put('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:30:39: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:30:39: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 30 | httpx.post('https://gmail.com', verify=False) 31 | httpx.put('https://gmail.com', verify=True) @@ -129,7 +129,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 34 | httpx.patch('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:32:41: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:32:41: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 32 | httpx.put('https://gmail.com', verify=False) 33 | httpx.patch('https://gmail.com', verify=True) @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 36 | httpx.delete('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:34:42: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:34:42: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 34 | httpx.patch('https://gmail.com', verify=False) 35 | httpx.delete('https://gmail.com', verify=True) @@ -149,7 +149,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 38 | httpx.stream('https://gmail.com', verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:36:42: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:36:42: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 36 | httpx.delete('https://gmail.com', verify=False) 37 | httpx.stream('https://gmail.com', verify=True) @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 40 | httpx.Client(verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:38:21: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:38:21: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 38 | httpx.stream('https://gmail.com', verify=False) 39 | httpx.Client() @@ -169,7 +169,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 42 | httpx.AsyncClient(verify=False) | -./resources/test/fixtures/flake8_bandit/S501.py:40:26: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks +S501.py:40:26: S501 Probable use of `httpx` call with `verify=False` disabling SSL certificate checks | 40 | httpx.Client(verify=False) 41 | httpx.AsyncClient() diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap index 3f85f1181a..08b55dce40 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S506_S506.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S506.py:10:9: S506 Probable use of unsafe `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`. +S506.py:10:9: S506 Probable use of unsafe `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`. | 10 | def test_yaml_load(): 11 | ystr = yaml.dump({"a": 1, "b": 2, "c": 3}) @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 14 | try: | -./resources/test/fixtures/flake8_bandit/S506.py:24:24: S506 Probable use of unsafe loader `Loader` with `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`. +S506.py:24:24: S506 Probable use of unsafe loader `Loader` with `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`. | 24 | yaml.load("{}", Loader=yaml.Loader) | ^^^^^^^^^^^ S506 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap index 1c03ad909b..77f4b65d04 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S508_S508.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S508.py:3:33: S508 The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. +S508.py:3:33: S508 The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. | 3 | from pysnmp.hlapi import CommunityData 4 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 6 | CommunityData("public", mpModel=1) # S508 | -./resources/test/fixtures/flake8_bandit/S508.py:4:33: S508 The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. +S508.py:4:33: S508 The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. | 4 | CommunityData("public", mpModel=0) # S508 5 | CommunityData("public", mpModel=1) # S508 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap index d67beece19..9f67a20696 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S509_S509.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S509.py:4:12: S509 You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure. +S509.py:4:12: S509 You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure. | 4 | insecure = UsmUserData("securityName") # S509 | ^^^^^^^^^^^ S509 5 | auth_no_priv = UsmUserData("securityName", "authName") # S509 | -./resources/test/fixtures/flake8_bandit/S509.py:5:16: S509 You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure. +S509.py:5:16: S509 You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure. | 5 | insecure = UsmUserData("securityName") # S509 6 | auth_no_priv = UsmUserData("securityName", "authName") # S509 diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap index dd0cc89a57..c182e6ea1c 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S608_S608.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S608.py:2:10: S608 Possible SQL injection vector through string-based query construction +S608.py:2:10: S608 Possible SQL injection vector through string-based query construction | 2 | # single-line failures 3 | query1 = "SELECT %s FROM table" % (var,) # bad @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 5 | query3 = "SELECT " + val + " FROM " + table | -./resources/test/fixtures/flake8_bandit/S608.py:3:10: S608 Possible SQL injection vector through string-based query construction +S608.py:3:10: S608 Possible SQL injection vector through string-based query construction | 3 | # single-line failures 4 | query1 = "SELECT %s FROM table" % (var,) # bad @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 7 | query4 = "SELECT {} FROM table;".format(var) | -./resources/test/fixtures/flake8_bandit/S608.py:4:10: S608 Possible SQL injection vector through string-based query construction +S608.py:4:10: S608 Possible SQL injection vector through string-based query construction | 4 | query1 = "SELECT %s FROM table" % (var,) # bad 5 | query2 = "SELECT var FROM " + table @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | query5 = f"SELECT * FROM table WHERE var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:5:10: S608 Possible SQL injection vector through string-based query construction +S608.py:5:10: S608 Possible SQL injection vector through string-based query construction | 5 | query2 = "SELECT var FROM " + table 6 | query3 = "SELECT " + val + " FROM " + table @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 8 | query5 = f"SELECT * FROM table WHERE var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:6:10: S608 Possible SQL injection vector through string-based query construction +S608.py:6:10: S608 Possible SQL injection vector through string-based query construction | 6 | query3 = "SELECT " + val + " FROM " + table 7 | query4 = "SELECT {} FROM table;".format(var) @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 10 | query6 = "DELETE FROM table WHERE var = %s" % (var,) | -./resources/test/fixtures/flake8_bandit/S608.py:8:10: S608 Possible SQL injection vector through string-based query construction +S608.py:8:10: S608 Possible SQL injection vector through string-based query construction | 8 | query5 = f"SELECT * FROM table WHERE var = {var}" 9 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 12 | query8 = "DELETE FROM " + table + "WHERE var = " + var | -./resources/test/fixtures/flake8_bandit/S608.py:9:10: S608 Possible SQL injection vector through string-based query construction +S608.py:9:10: S608 Possible SQL injection vector through string-based query construction | 9 | query6 = "DELETE FROM table WHERE var = %s" % (var,) 10 | query7 = "DELETE FROM table WHERE VAR = " + var @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 12 | query9 = "DELETE FROM table WHERE var = {}".format(var) | -./resources/test/fixtures/flake8_bandit/S608.py:10:10: S608 Possible SQL injection vector through string-based query construction +S608.py:10:10: S608 Possible SQL injection vector through string-based query construction | 10 | query6 = "DELETE FROM table WHERE var = %s" % (var,) 11 | query7 = "DELETE FROM table WHERE VAR = " + var @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 14 | query10 = f"DELETE FROM table WHERE var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:11:10: S608 Possible SQL injection vector through string-based query construction +S608.py:11:10: S608 Possible SQL injection vector through string-based query construction | 11 | query7 = "DELETE FROM table WHERE VAR = " + var 12 | query8 = "DELETE FROM " + table + "WHERE var = " + var @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 14 | query10 = f"DELETE FROM table WHERE var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:12:11: S608 Possible SQL injection vector through string-based query construction +S608.py:12:11: S608 Possible SQL injection vector through string-based query construction | 12 | query8 = "DELETE FROM " + table + "WHERE var = " + var 13 | query9 = "DELETE FROM table WHERE var = {}".format(var) @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 16 | query11 = "INSERT INTO table VALUES (%s)" % (var,) | -./resources/test/fixtures/flake8_bandit/S608.py:14:11: S608 Possible SQL injection vector through string-based query construction +S608.py:14:11: S608 Possible SQL injection vector through string-based query construction | 14 | query10 = f"DELETE FROM table WHERE var = {var}" 15 | @@ -107,7 +107,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 18 | query13 = "INSERT INTO {} VALUES ({})".format(table, var) | -./resources/test/fixtures/flake8_bandit/S608.py:15:11: S608 Possible SQL injection vector through string-based query construction +S608.py:15:11: S608 Possible SQL injection vector through string-based query construction | 15 | query11 = "INSERT INTO table VALUES (%s)" % (var,) 16 | query12 = "INSERT INTO TABLE VALUES (" + var + ")" @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 18 | query14 = f"INSERT INTO {table} VALUES var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:16:11: S608 Possible SQL injection vector through string-based query construction +S608.py:16:11: S608 Possible SQL injection vector through string-based query construction | 16 | query11 = "INSERT INTO table VALUES (%s)" % (var,) 17 | query12 = "INSERT INTO TABLE VALUES (" + var + ")" @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 19 | query14 = f"INSERT INTO {table} VALUES var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:17:11: S608 Possible SQL injection vector through string-based query construction +S608.py:17:11: S608 Possible SQL injection vector through string-based query construction | 17 | query12 = "INSERT INTO TABLE VALUES (" + var + ")" 18 | query13 = "INSERT INTO {} VALUES ({})".format(table, var) @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 21 | query15 = "UPDATE %s SET var = %s" % (table, var) | -./resources/test/fixtures/flake8_bandit/S608.py:19:11: S608 Possible SQL injection vector through string-based query construction +S608.py:19:11: S608 Possible SQL injection vector through string-based query construction | 19 | query14 = f"INSERT INTO {table} VALUES var = {var}" 20 | @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 23 | query17 = "UPDATE {} SET var = {}".format(table, var) | -./resources/test/fixtures/flake8_bandit/S608.py:20:11: S608 Possible SQL injection vector through string-based query construction +S608.py:20:11: S608 Possible SQL injection vector through string-based query construction | 20 | query15 = "UPDATE %s SET var = %s" % (table, var) 21 | query16 = "UPDATE " + table + " SET var = " + var @@ -154,7 +154,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 23 | query18 = f"UPDATE {table} SET var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:21:11: S608 Possible SQL injection vector through string-based query construction +S608.py:21:11: S608 Possible SQL injection vector through string-based query construction | 21 | query15 = "UPDATE %s SET var = %s" % (table, var) 22 | query16 = "UPDATE " + table + " SET var = " + var @@ -163,7 +163,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 24 | query18 = f"UPDATE {table} SET var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:22:11: S608 Possible SQL injection vector through string-based query construction +S608.py:22:11: S608 Possible SQL injection vector through string-based query construction | 22 | query16 = "UPDATE " + table + " SET var = " + var 23 | query17 = "UPDATE {} SET var = {}".format(table, var) @@ -173,7 +173,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 26 | query19 = "select %s from table" % (var,) | -./resources/test/fixtures/flake8_bandit/S608.py:24:11: S608 Possible SQL injection vector through string-based query construction +S608.py:24:11: S608 Possible SQL injection vector through string-based query construction | 24 | query18 = f"UPDATE {table} SET var = {var}" 25 | @@ -183,7 +183,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 28 | query21 = "select " + val + " from " + table | -./resources/test/fixtures/flake8_bandit/S608.py:25:11: S608 Possible SQL injection vector through string-based query construction +S608.py:25:11: S608 Possible SQL injection vector through string-based query construction | 25 | query19 = "select %s from table" % (var,) 26 | query20 = "select var from " + table @@ -192,7 +192,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 28 | query22 = "select {} from table;".format(var) | -./resources/test/fixtures/flake8_bandit/S608.py:26:11: S608 Possible SQL injection vector through string-based query construction +S608.py:26:11: S608 Possible SQL injection vector through string-based query construction | 26 | query19 = "select %s from table" % (var,) 27 | query20 = "select var from " + table @@ -202,7 +202,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 30 | query23 = f"select * from table where var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:27:11: S608 Possible SQL injection vector through string-based query construction +S608.py:27:11: S608 Possible SQL injection vector through string-based query construction | 27 | query20 = "select var from " + table 28 | query21 = "select " + val + " from " + table @@ -211,7 +211,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 30 | query23 = f"select * from table where var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:28:11: S608 Possible SQL injection vector through string-based query construction +S608.py:28:11: S608 Possible SQL injection vector through string-based query construction | 28 | query21 = "select " + val + " from " + table 29 | query22 = "select {} from table;".format(var) @@ -221,7 +221,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 32 | query24 = "delete from table where var = %s" % (var,) | -./resources/test/fixtures/flake8_bandit/S608.py:30:11: S608 Possible SQL injection vector through string-based query construction +S608.py:30:11: S608 Possible SQL injection vector through string-based query construction | 30 | query23 = f"select * from table where var = {var}" 31 | @@ -231,7 +231,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 34 | query26 = "delete from " + table + "where var = " + var | -./resources/test/fixtures/flake8_bandit/S608.py:31:11: S608 Possible SQL injection vector through string-based query construction +S608.py:31:11: S608 Possible SQL injection vector through string-based query construction | 31 | query24 = "delete from table where var = %s" % (var,) 32 | query25 = "delete from table where var = " + var @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 34 | query27 = "delete from table where var = {}".format(var) | -./resources/test/fixtures/flake8_bandit/S608.py:32:11: S608 Possible SQL injection vector through string-based query construction +S608.py:32:11: S608 Possible SQL injection vector through string-based query construction | 32 | query24 = "delete from table where var = %s" % (var,) 33 | query25 = "delete from table where var = " + var @@ -250,7 +250,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 36 | query28 = f"delete from table where var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:33:11: S608 Possible SQL injection vector through string-based query construction +S608.py:33:11: S608 Possible SQL injection vector through string-based query construction | 33 | query25 = "delete from table where var = " + var 34 | query26 = "delete from " + table + "where var = " + var @@ -259,7 +259,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 36 | query28 = f"delete from table where var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:34:11: S608 Possible SQL injection vector through string-based query construction +S608.py:34:11: S608 Possible SQL injection vector through string-based query construction | 34 | query26 = "delete from " + table + "where var = " + var 35 | query27 = "delete from table where var = {}".format(var) @@ -269,7 +269,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 38 | query29 = "insert into table values (%s)" % (var,) | -./resources/test/fixtures/flake8_bandit/S608.py:36:11: S608 Possible SQL injection vector through string-based query construction +S608.py:36:11: S608 Possible SQL injection vector through string-based query construction | 36 | query28 = f"delete from table where var = {var}" 37 | @@ -279,7 +279,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 40 | query31 = "insert into {} values ({})".format(table, var) | -./resources/test/fixtures/flake8_bandit/S608.py:37:11: S608 Possible SQL injection vector through string-based query construction +S608.py:37:11: S608 Possible SQL injection vector through string-based query construction | 37 | query29 = "insert into table values (%s)" % (var,) 38 | query30 = "insert into table values (" + var + ")" @@ -288,7 +288,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 40 | query32 = f"insert into {table} values var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:38:11: S608 Possible SQL injection vector through string-based query construction +S608.py:38:11: S608 Possible SQL injection vector through string-based query construction | 38 | query29 = "insert into table values (%s)" % (var,) 39 | query30 = "insert into table values (" + var + ")" @@ -297,7 +297,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 41 | query32 = f"insert into {table} values var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:39:11: S608 Possible SQL injection vector through string-based query construction +S608.py:39:11: S608 Possible SQL injection vector through string-based query construction | 39 | query30 = "insert into table values (" + var + ")" 40 | query31 = "insert into {} values ({})".format(table, var) @@ -307,7 +307,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 43 | query33 = "update %s set var = %s" % (table, var) | -./resources/test/fixtures/flake8_bandit/S608.py:41:11: S608 Possible SQL injection vector through string-based query construction +S608.py:41:11: S608 Possible SQL injection vector through string-based query construction | 41 | query32 = f"insert into {table} values var = {var}" 42 | @@ -317,7 +317,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 45 | query35 = "update {} set var = {}".format(table, var) | -./resources/test/fixtures/flake8_bandit/S608.py:42:11: S608 Possible SQL injection vector through string-based query construction +S608.py:42:11: S608 Possible SQL injection vector through string-based query construction | 42 | query33 = "update %s set var = %s" % (table, var) 43 | query34 = "update " + table + " set var = " + var @@ -326,7 +326,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 45 | query36 = f"update {table} set var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:43:11: S608 Possible SQL injection vector through string-based query construction +S608.py:43:11: S608 Possible SQL injection vector through string-based query construction | 43 | query33 = "update %s set var = %s" % (table, var) 44 | query34 = "update " + table + " set var = " + var @@ -335,7 +335,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 46 | query36 = f"update {table} set var = {var}" | -./resources/test/fixtures/flake8_bandit/S608.py:44:11: S608 Possible SQL injection vector through string-based query construction +S608.py:44:11: S608 Possible SQL injection vector through string-based query construction | 44 | query34 = "update " + table + " set var = " + var 45 | query35 = "update {} set var = {}".format(table, var) @@ -345,7 +345,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 48 | # multi-line failures | -./resources/test/fixtures/flake8_bandit/S608.py:48:12: S608 Possible SQL injection vector through string-based query construction +S608.py:48:12: S608 Possible SQL injection vector through string-based query construction | 48 | # multi-line failures 49 | def query37(): @@ -360,7 +360,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 56 | def query38(): | -./resources/test/fixtures/flake8_bandit/S608.py:55:12: S608 Possible SQL injection vector through string-based query construction +S608.py:55:12: S608 Possible SQL injection vector through string-based query construction | 55 | def query38(): 56 | return """ @@ -374,7 +374,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 62 | def query39(): | -./resources/test/fixtures/flake8_bandit/S608.py:62:12: S608 Possible SQL injection vector through string-based query construction +S608.py:62:12: S608 Possible SQL injection vector through string-based query construction | 62 | def query39(): 63 | return """ @@ -388,7 +388,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 69 | def query40(): | -./resources/test/fixtures/flake8_bandit/S608.py:69:12: S608 Possible SQL injection vector through string-based query construction +S608.py:69:12: S608 Possible SQL injection vector through string-based query construction | 69 | def query40(): 70 | return f""" @@ -402,7 +402,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 76 | def query41(): | -./resources/test/fixtures/flake8_bandit/S608.py:77:9: S608 Possible SQL injection vector through string-based query construction +S608.py:77:9: S608 Possible SQL injection vector through string-based query construction | 77 | def query41(): 78 | return ( @@ -414,7 +414,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 82 | ) | -./resources/test/fixtures/flake8_bandit/S608.py:83:26: S608 Possible SQL injection vector through string-based query construction +S608.py:83:26: S608 Possible SQL injection vector through string-based query construction | 83 | # # cursor-wrapped failures 84 | query42 = cursor.execute("SELECT * FROM table WHERE var = %s" % var) @@ -423,7 +423,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 86 | query44 = cursor.execute("SELECT * FROM table WHERE var = {}".format(var)) | -./resources/test/fixtures/flake8_bandit/S608.py:84:26: S608 Possible SQL injection vector through string-based query construction +S608.py:84:26: S608 Possible SQL injection vector through string-based query construction | 84 | # # cursor-wrapped failures 85 | query42 = cursor.execute("SELECT * FROM table WHERE var = %s" % var) @@ -433,7 +433,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 88 | query45 = cursor.executemany("SELECT * FROM table WHERE var = %s" % var, []) | -./resources/test/fixtures/flake8_bandit/S608.py:85:26: S608 Possible SQL injection vector through string-based query construction +S608.py:85:26: S608 Possible SQL injection vector through string-based query construction | 85 | query42 = cursor.execute("SELECT * FROM table WHERE var = %s" % var) 86 | query43 = cursor.execute(f"SELECT * FROM table WHERE var = {var}") @@ -442,7 +442,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 88 | query45 = cursor.executemany("SELECT * FROM table WHERE var = %s" % var, []) | -./resources/test/fixtures/flake8_bandit/S608.py:86:30: S608 Possible SQL injection vector through string-based query construction +S608.py:86:30: S608 Possible SQL injection vector through string-based query construction | 86 | query43 = cursor.execute(f"SELECT * FROM table WHERE var = {var}") 87 | query44 = cursor.execute("SELECT * FROM table WHERE var = {}".format(var)) diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap index 32ae5e3d27..80241b1075 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S612_S612.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S612.py:3:5: S612 Use of insecure `logging.config.listen` detected +S612.py:3:5: S612 Use of insecure `logging.config.listen` detected | 3 | import logging.config 4 | diff --git a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap index 924bd64131..e50163d621 100644 --- a/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap +++ b/crates/ruff/src/rules/flake8_bandit/snapshots/ruff__rules__flake8_bandit__tests__S701_S701.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bandit/mod.rs --- -./resources/test/fixtures/flake8_bandit/S701.py:9:68: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. +S701.py:9:68: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. | 9 | templateEnv = jinja2.Environment(autoescape=True, 10 | loader=templateLoader ) @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 13 | Environment(loader=templateLoader, | -./resources/test/fixtures/flake8_bandit/S701.py:10:45: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. +S701.py:10:45: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. | 10 | loader=templateLoader ) 11 | Environment(loader=templateLoader, load=templateLoader, autoescape=something) # S701 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 14 | load=templateLoader, | -./resources/test/fixtures/flake8_bandit/S701.py:13:24: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. +S701.py:13:24: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. | 13 | Environment(loader=templateLoader, 14 | load=templateLoader, @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 17 | Environment(loader=templateLoader, # S701 | -./resources/test/fixtures/flake8_bandit/S701.py:15:1: S701 By default, jinja2 sets `autoescape` to `False`. Consider using `autoescape=True` or the `select_autoescape` function to mitigate XSS vulnerabilities. +S701.py:15:1: S701 By default, jinja2 sets `autoescape` to `False`. Consider using `autoescape=True` or the `select_autoescape` function to mitigate XSS vulnerabilities. | 15 | autoescape=False) # S701 16 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_bandit/mod.rs 18 | load=templateLoader) | -./resources/test/fixtures/flake8_bandit/S701.py:29:47: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. +S701.py:29:47: S701 Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function. | 29 | def fake_func(): 30 | return 'foobar' diff --git a/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap b/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap index f3014a10f8..821e4e07b9 100644 --- a/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap +++ b/crates/ruff/src/rules/flake8_blind_except/snapshots/ruff__rules__flake8_blind_except__tests__BLE001_BLE.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_blind_except/mod.rs --- -./resources/test/fixtures/flake8_blind_except/BLE.py:25:8: BLE001 Do not catch blind exception: `BaseException` +BLE.py:25:8: BLE001 Do not catch blind exception: `BaseException` | 25 | except Exception as e: 26 | raise e @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 28 | pass | -./resources/test/fixtures/flake8_blind_except/BLE.py:31:8: BLE001 Do not catch blind exception: `Exception` +BLE.py:31:8: BLE001 Do not catch blind exception: `Exception` | 31 | try: 32 | pass @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 35 | finally: | -./resources/test/fixtures/flake8_blind_except/BLE.py:42:8: BLE001 Do not catch blind exception: `Exception` +BLE.py:42:8: BLE001 Do not catch blind exception: `Exception` | 42 | try: 43 | pass @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 46 | raise e | -./resources/test/fixtures/flake8_blind_except/BLE.py:45:12: BLE001 Do not catch blind exception: `BaseException` +BLE.py:45:12: BLE001 Do not catch blind exception: `BaseException` | 45 | try: 46 | raise e @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 48 | pass | -./resources/test/fixtures/flake8_blind_except/BLE.py:54:8: BLE001 Do not catch blind exception: `Exception` +BLE.py:54:8: BLE001 Do not catch blind exception: `Exception` | 54 | except BaseException as e: 55 | raise e @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 57 | pass | -./resources/test/fixtures/flake8_blind_except/BLE.py:60:8: BLE001 Do not catch blind exception: `Exception` +BLE.py:60:8: BLE001 Do not catch blind exception: `Exception` | 60 | try: 61 | pass @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 64 | except BaseException: | -./resources/test/fixtures/flake8_blind_except/BLE.py:62:8: BLE001 Do not catch blind exception: `BaseException` +BLE.py:62:8: BLE001 Do not catch blind exception: `BaseException` | 62 | except Exception as e: 63 | raise bad @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 65 | pass | -./resources/test/fixtures/flake8_blind_except/BLE.py:69:8: BLE001 Do not catch blind exception: `Exception` +BLE.py:69:8: BLE001 Do not catch blind exception: `Exception` | 69 | try: 70 | pass @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 72 | logging.error("...") | -./resources/test/fixtures/flake8_blind_except/BLE.py:75:8: BLE001 Do not catch blind exception: `Exception` +BLE.py:75:8: BLE001 Do not catch blind exception: `Exception` | 75 | try: 76 | pass @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/flake8_blind_except/mod.rs 78 | logging.error("...", exc_info=False) | -./resources/test/fixtures/flake8_blind_except/BLE.py:81:8: BLE001 Do not catch blind exception: `Exception` +BLE.py:81:8: BLE001 Do not catch blind exception: `Exception` | 81 | try: 82 | pass diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap index 069ae5b151..c940e93364 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT001_FBT.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs --- -./resources/test/fixtures/flake8_boolean_trap/FBT.py:4:5: FBT001 Boolean positional arg in function definition +FBT.py:4:5: FBT001 Boolean positional arg in function definition | 4 | posonly_nohint, 5 | posonly_nonboolhint: int, @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 8 | /, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:5:5: FBT001 Boolean positional arg in function definition +FBT.py:5:5: FBT001 Boolean positional arg in function definition | 5 | posonly_nonboolhint: int, 6 | posonly_boolhint: bool, @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 9 | offset, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:10:5: FBT001 Boolean positional arg in function definition +FBT.py:10:5: FBT001 Boolean positional arg in function definition | 10 | posorkw_nonvalued_nohint, 11 | posorkw_nonvalued_nonboolhint: int, @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 14 | posorkw_boolvalued_nohint=True, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:11:5: FBT001 Boolean positional arg in function definition +FBT.py:11:5: FBT001 Boolean positional arg in function definition | 11 | posorkw_nonvalued_nonboolhint: int, 12 | posorkw_nonvalued_boolhint: bool, @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 15 | posorkw_boolvalued_nonboolhint: int = True, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:14:5: FBT001 Boolean positional arg in function definition +FBT.py:14:5: FBT001 Boolean positional arg in function definition | 14 | posorkw_boolvalued_nohint=True, 15 | posorkw_boolvalued_nonboolhint: int = True, @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 18 | posorkw_nonboolvalued_nohint=1, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:15:5: FBT001 Boolean positional arg in function definition +FBT.py:15:5: FBT001 Boolean positional arg in function definition | 15 | posorkw_boolvalued_nonboolhint: int = True, 16 | posorkw_boolvalued_boolhint: bool = True, @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 19 | posorkw_nonboolvalued_nonboolhint: int = 2, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:18:5: FBT001 Boolean positional arg in function definition +FBT.py:18:5: FBT001 Boolean positional arg in function definition | 18 | posorkw_nonboolvalued_nohint=1, 19 | posorkw_nonboolvalued_nonboolhint: int = 2, @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 22 | *, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:19:5: FBT001 Boolean positional arg in function definition +FBT.py:19:5: FBT001 Boolean positional arg in function definition | 19 | posorkw_nonboolvalued_nonboolhint: int = 2, 20 | posorkw_nonboolvalued_boolhint: bool = 3, @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 23 | kwonly_nonvalued_nohint, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:81:19: FBT001 Boolean positional arg in function definition +FBT.py:81:19: FBT001 Boolean positional arg in function definition | 81 | # FBT001: Boolean positional arg in function definition 82 | def foo(self, value: bool) -> None: diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap index 1f1c0833b2..4462697099 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT002_FBT.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs --- -./resources/test/fixtures/flake8_boolean_trap/FBT.py:12:31: FBT002 Boolean default value in function definition +FBT.py:12:31: FBT002 Boolean default value in function definition | 12 | posorkw_nonvalued_boolhint: bool, 13 | posorkw_nonvalued_boolstrhint: "bool", @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 16 | posorkw_boolvalued_boolhint: bool = True, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:13:43: FBT002 Boolean default value in function definition +FBT.py:13:43: FBT002 Boolean default value in function definition | 13 | posorkw_nonvalued_boolstrhint: "bool", 14 | posorkw_boolvalued_nohint=True, @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 17 | posorkw_boolvalued_boolstrhint: "bool" = True, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:14:41: FBT002 Boolean default value in function definition +FBT.py:14:41: FBT002 Boolean default value in function definition | 14 | posorkw_boolvalued_nohint=True, 15 | posorkw_boolvalued_nonboolhint: int = True, @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 18 | posorkw_nonboolvalued_nohint=1, | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:15:46: FBT002 Boolean default value in function definition +FBT.py:15:46: FBT002 Boolean default value in function definition | 15 | posorkw_boolvalued_nonboolhint: int = True, 16 | posorkw_boolvalued_boolhint: bool = True, diff --git a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap index cd5691ca07..43058488d3 100644 --- a/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap +++ b/crates/ruff/src/rules/flake8_boolean_trap/snapshots/ruff__rules__flake8_boolean_trap__tests__FBT003_FBT.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs --- -./resources/test/fixtures/flake8_boolean_trap/FBT.py:42:11: FBT003 Boolean positional value in function call +FBT.py:42:11: FBT003 Boolean positional value in function call | 42 | used("a", True) | ^^^^ FBT003 43 | used(do=True) | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:57:11: FBT003 Boolean positional value in function call +FBT.py:57:11: FBT003 Boolean positional value in function call | 57 | {}.pop(True, False) 58 | dict.fromkeys(("world",), True) @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_boolean_trap/mod.rs 61 | mylist.index(True) | -./resources/test/fixtures/flake8_boolean_trap/FBT.py:57:17: FBT003 Boolean positional value in function call +FBT.py:57:17: FBT003 Boolean positional value in function call | 57 | {}.pop(True, False) 58 | dict.fromkeys(("world",), True) diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap index 4be5c72019..dbb3a120f8 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B002_B002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B002.py:15:9: B002 Python does not support the unary prefix increment +B002.py:15:9: B002 Python does not support the unary prefix increment | 15 | def this_is_buggy(n): 16 | x = ++n @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 17 | return x | -./resources/test/fixtures/flake8_bugbear/B002.py:20:12: B002 Python does not support the unary prefix increment +B002.py:20:12: B002 Python does not support the unary prefix increment | 20 | def this_is_buggy_too(n): 21 | return ++n diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap index db1326cf0a..670b7b4e89 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B003_B003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B003.py:9:1: B003 Assigning to `os.environ` doesn't clear the environment +B003.py:9:1: B003 Assigning to `os.environ` doesn't clear the environment | 9 | from os import environ 10 | diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap index 727aba7006..4fed02c6aa 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B004_B004.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B004.py:3:8: B004 Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results. +B004.py:3:8: B004 Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results. | 3 | def this_is_a_bug(): 4 | o = object() @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 7 | if getattr(o, "__call__", False): | -./resources/test/fixtures/flake8_bugbear/B004.py:5:8: B004 Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results. +B004.py:5:8: B004 Using `hasattr(x, '__call__')` to test if x is callable is unreliable. Use `callable(x)` for consistent results. | 5 | if hasattr(o, "__call__"): 6 | print("Ooh, callable! Or is it?") diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap index 96baadded6..ec26c8969a 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B005_B005.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B005.py:4:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:4:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 4 | s.strip(s) # no warning 5 | s.strip("we") # no warning @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 8 | s.strip("\n\t ") # no warning | -./resources/test/fixtures/flake8_bugbear/B005.py:7:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:7:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 7 | s.strip("e") # no warning 8 | s.strip("\n\t ") # no warning @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 11 | s.lstrip("we") # no warning | -./resources/test/fixtures/flake8_bugbear/B005.py:10:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:10:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 10 | s.lstrip(s) # no warning 11 | s.lstrip("we") # no warning @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 14 | s.lstrip("\n\t ") # no warning | -./resources/test/fixtures/flake8_bugbear/B005.py:13:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:13:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 13 | s.lstrip("e") # no warning 14 | s.lstrip("\n\t ") # no warning @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 17 | s.rstrip("we") # warning | -./resources/test/fixtures/flake8_bugbear/B005.py:16:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:16:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 16 | s.rstrip(s) # no warning 17 | s.rstrip("we") # warning @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 20 | s.rstrip("\n\t ") # no warning | -./resources/test/fixtures/flake8_bugbear/B005.py:19:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:19:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 19 | s.rstrip("e") # no warning 20 | s.rstrip("\n\t ") # no warning @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 23 | s.strip("あ") # no warning | -./resources/test/fixtures/flake8_bugbear/B005.py:22:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:22:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 22 | s.strip("a") # no warning 23 | s.strip("あ") # no warning @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 26 | s.strip("\u0074\u0065\u0073\u0074") # warning | -./resources/test/fixtures/flake8_bugbear/B005.py:24:1: B005 Using `.strip()` with multi-character strings is misleading the reader +B005.py:24:1: B005 Using `.strip()` with multi-character strings is misleading the reader | 24 | s.strip("ああ") # warning 25 | s.strip("\ufeff") # no warning diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap index 61a5a829a4..2cb0b33275 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B006_B006_B008.py.snap @@ -1,49 +1,49 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B006_B008.py:62:25: B006 Do not use mutable data structures for argument defaults +B006_B008.py:62:25: B006 Do not use mutable data structures for argument defaults | 62 | def this_is_wrong(value=[1, 2, 3]): | ^^^^^^^^^ B006 63 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:66:30: B006 Do not use mutable data structures for argument defaults +B006_B008.py:66:30: B006 Do not use mutable data structures for argument defaults | 66 | def this_is_also_wrong(value={}): | ^^ B006 67 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:70:20: B006 Do not use mutable data structures for argument defaults +B006_B008.py:70:20: B006 Do not use mutable data structures for argument defaults | 70 | def and_this(value=set()): | ^^^^^ B006 71 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:74:20: B006 Do not use mutable data structures for argument defaults +B006_B008.py:74:20: B006 Do not use mutable data structures for argument defaults | 74 | def this_too(value=collections.OrderedDict()): | ^^^^^^^^^^^^^^^^^^^^^^^^^ B006 75 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:78:32: B006 Do not use mutable data structures for argument defaults +B006_B008.py:78:32: B006 Do not use mutable data structures for argument defaults | 78 | async def async_this_too(value=collections.defaultdict()): | ^^^^^^^^^^^^^^^^^^^^^^^^^ B006 79 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:82:26: B006 Do not use mutable data structures for argument defaults +B006_B008.py:82:26: B006 Do not use mutable data structures for argument defaults | 82 | def dont_forget_me(value=collections.deque()): | ^^^^^^^^^^^^^^^^^^^ B006 83 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:87:46: B006 Do not use mutable data structures for argument defaults +B006_B008.py:87:46: B006 Do not use mutable data structures for argument defaults | 87 | # N.B. we're also flagging the function call in the comprehension 88 | def list_comprehension_also_not_okay(default=[i**2 for i in range(3)]): @@ -51,28 +51,28 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 89 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:91:46: B006 Do not use mutable data structures for argument defaults +B006_B008.py:91:46: B006 Do not use mutable data structures for argument defaults | 91 | def dict_comprehension_also_not_okay(default={i: i**2 for i in range(3)}): | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B006 92 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:95:45: B006 Do not use mutable data structures for argument defaults +B006_B008.py:95:45: B006 Do not use mutable data structures for argument defaults | 95 | def set_comprehension_also_not_okay(default={i**2 for i in range(3)}): | ^^^^^^^^^^^^^^^^^^^^^^^^ B006 96 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:99:33: B006 Do not use mutable data structures for argument defaults +B006_B008.py:99:33: B006 Do not use mutable data structures for argument defaults | 99 | def kwonlyargs_mutable(*, value=[]): | ^^ B006 100 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:192:20: B006 Do not use mutable data structures for argument defaults +B006_B008.py:192:20: B006 Do not use mutable data structures for argument defaults | 192 | # B006 and B008 193 | # We should handle arbitrary nesting of these B008. @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 195 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:225:27: B006 Do not use mutable data structures for argument defaults +B006_B008.py:225:27: B006 Do not use mutable data structures for argument defaults | 225 | def mutable_annotations( 226 | a: list[int] | None = [], @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 228 | c: Annotated[Union[Set[str], abc.Sized], "annotation"] = set(), | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:226:35: B006 Do not use mutable data structures for argument defaults +B006_B008.py:226:35: B006 Do not use mutable data structures for argument defaults | 226 | def mutable_annotations( 227 | a: list[int] | None = [], @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 230 | ): | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:227:62: B006 Do not use mutable data structures for argument defaults +B006_B008.py:227:62: B006 Do not use mutable data structures for argument defaults | 227 | a: list[int] | None = [], 228 | b: Optional[Dict[int, int]] = {}, diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap index 0c84d219f9..3960383665 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B007_B007.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B007.py:6:5: B007 [*] Loop control variable `i` not used within loop body +B007.py:6:5: B007 [*] Loop control variable `i` not used within loop body | 6 | print(i) # name no longer defined on Python 3; no warning yet 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | = help: Rename unused `i` to `_i` -./resources/test/fixtures/flake8_bugbear/B007.py:18:13: B007 [*] Loop control variable `k` not used within loop body +B007.py:18:13: B007 [*] Loop control variable `k` not used within loop body | 18 | for i in range(10): 19 | for j in range(10): @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 20 20 | 21 21 | -./resources/test/fixtures/flake8_bugbear/B007.py:30:5: B007 [*] Loop control variable `i` not used within loop body +B007.py:30:5: B007 [*] Loop control variable `i` not used within loop body | 30 | for i, (j, (k, l)) in strange_generator(): # i, k not used | ^ B007 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | = help: Rename unused `i` to `_i` -./resources/test/fixtures/flake8_bugbear/B007.py:30:13: B007 [*] Loop control variable `k` not used within loop body +B007.py:30:13: B007 [*] Loop control variable `k` not used within loop body | 30 | for i, (j, (k, l)) in strange_generator(): # i, k not used | ^ B007 @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 32 32 | 33 33 | FMT = "{foo} {bar}" -./resources/test/fixtures/flake8_bugbear/B007.py:34:10: B007 Loop control variable `bar` may not be used within loop body +B007.py:34:10: B007 Loop control variable `bar` may not be used within loop body | 34 | FMT = "{foo} {bar}" 35 | for foo, bar in [(1, 2)]: @@ -66,7 +66,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 37 | print(FMT.format(**locals())) | -./resources/test/fixtures/flake8_bugbear/B007.py:38:10: B007 Loop control variable `bar` may not be used within loop body +B007.py:38:10: B007 Loop control variable `bar` may not be used within loop body | 38 | print(FMT.format(**locals())) 39 | @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 42 | print(FMT.format(**globals())) | -./resources/test/fixtures/flake8_bugbear/B007.py:42:10: B007 Loop control variable `bar` may not be used within loop body +B007.py:42:10: B007 Loop control variable `bar` may not be used within loop body | 42 | print(FMT.format(**globals())) 43 | @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 46 | print(FMT.format(**vars())) | -./resources/test/fixtures/flake8_bugbear/B007.py:46:10: B007 Loop control variable `bar` may not be used within loop body +B007.py:46:10: B007 Loop control variable `bar` may not be used within loop body | 46 | print(FMT.format(**vars())) 47 | @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 49 | print(FMT.format(foo=foo, bar=eval("bar"))) | -./resources/test/fixtures/flake8_bugbear/B007.py:52:14: B007 [*] Loop control variable `bar` not used within loop body +B007.py:52:14: B007 [*] Loop control variable `bar` not used within loop body | 52 | def f(): 53 | # Fixable. @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 54 54 | break 55 55 | -./resources/test/fixtures/flake8_bugbear/B007.py:59:14: B007 [*] Loop control variable `bar` not used within loop body +B007.py:59:14: B007 [*] Loop control variable `bar` not used within loop body | 59 | def f(): 60 | # Unfixable due to usage of `bar` outside of loop. @@ -127,7 +127,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | = help: Rename unused `bar` to `_bar` -./resources/test/fixtures/flake8_bugbear/B007.py:68:14: B007 [*] Loop control variable `bar` not used within loop body +B007.py:68:14: B007 [*] Loop control variable `bar` not used within loop body | 68 | def f(): 69 | # Fixable. @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 70 70 | break 71 71 | -./resources/test/fixtures/flake8_bugbear/B007.py:77:14: B007 [*] Loop control variable `bar` not used within loop body +B007.py:77:14: B007 [*] Loop control variable `bar` not used within loop body | 77 | def f(): 78 | # Fixable. @@ -169,7 +169,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 79 79 | break 80 80 | -./resources/test/fixtures/flake8_bugbear/B007.py:87:5: B007 Loop control variable `line_` not used within loop body +B007.py:87:5: B007 Loop control variable `line_` not used within loop body | 87 | # Unfixable due to trailing underscore (`_line_` wouldn't be considered an ignorable 88 | # variable name). diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap index e497d85fff..7ec11c3ab1 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B008_B006_B008.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B006_B008.py:87:61: B008 Do not perform function call `range` in argument defaults +B006_B008.py:87:61: B008 Do not perform function call `range` in argument defaults | 87 | # N.B. we're also flagging the function call in the comprehension 88 | def list_comprehension_also_not_okay(default=[i**2 for i in range(3)]): @@ -9,21 +9,21 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 89 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:91:64: B008 Do not perform function call `range` in argument defaults +B006_B008.py:91:64: B008 Do not perform function call `range` in argument defaults | 91 | def dict_comprehension_also_not_okay(default={i: i**2 for i in range(3)}): | ^^^^^^^^ B008 92 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:95:60: B008 Do not perform function call `range` in argument defaults +B006_B008.py:95:60: B008 Do not perform function call `range` in argument defaults | 95 | def set_comprehension_also_not_okay(default={i**2 for i in range(3)}): | ^^^^^^^^ B008 96 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:111:39: B008 Do not perform function call `time.time` in argument defaults +B006_B008.py:111:39: B008 Do not perform function call `time.time` in argument defaults | 111 | # B008 112 | # Flag function calls as default args (including if they are part of a sub-expression) @@ -32,28 +32,28 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 114 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:115:12: B008 Do not perform function call `dt.datetime.now` in argument defaults +B006_B008.py:115:12: B008 Do not perform function call `dt.datetime.now` in argument defaults | 115 | def f(when=dt.datetime.now() + dt.timedelta(days=7)): | ^^^^^^^^^^^^^^^^^ B008 116 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:119:30: B008 Do not perform function call in argument defaults +B006_B008.py:119:30: B008 Do not perform function call in argument defaults | 119 | def can_even_catch_lambdas(a=(lambda x: x)()): | ^^^^^^^^^^^^^^^ B008 120 | ... | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:157:34: B008 Do not perform function call `float` in argument defaults +B006_B008.py:157:34: B008 Do not perform function call `float` in argument defaults | 157 | def float_infinity_literal(value=float("1e999")): | ^^^^^^^^^^^^^^ B008 158 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:162:30: B008 Do not perform function call `float` in argument defaults +B006_B008.py:162:30: B008 Do not perform function call `float` in argument defaults | 162 | # But don't allow standard floats 163 | def float_int_is_wrong(value=float(3)): @@ -61,14 +61,14 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 164 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:166:45: B008 Do not perform function call `float` in argument defaults +B006_B008.py:166:45: B008 Do not perform function call `float` in argument defaults | 166 | def float_str_not_inf_or_nan_is_wrong(value=float("3.14")): | ^^^^^^^^^^^^^ B008 167 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:192:21: B008 Do not perform function call `float` in argument defaults +B006_B008.py:192:21: B008 Do not perform function call `float` in argument defaults | 192 | # B006 and B008 193 | # We should handle arbitrary nesting of these B008. @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 195 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:192:31: B008 Do not perform function call `dt.datetime.now` in argument defaults +B006_B008.py:192:31: B008 Do not perform function call `dt.datetime.now` in argument defaults | 192 | # B006 and B008 193 | # We should handle arbitrary nesting of these B008. @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 195 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:198:22: B008 Do not perform function call `map` in argument defaults +B006_B008.py:198:22: B008 Do not perform function call `map` in argument defaults | 198 | # Don't flag nested B006 since we can't guarantee that 199 | # it isn't made mutable by the outer operation. @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 201 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:203:19: B008 Do not perform function call `random.randint` in argument defaults +B006_B008.py:203:19: B008 Do not perform function call `random.randint` in argument defaults | 203 | # B008-ception. 204 | def nested_b008(a=random.randint(0, dt.datetime.now().year)): @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 205 | pass | -./resources/test/fixtures/flake8_bugbear/B006_B008.py:203:37: B008 Do not perform function call `dt.datetime.now` in argument defaults +B006_B008.py:203:37: B008 Do not perform function call `dt.datetime.now` in argument defaults | 203 | # B008-ception. 204 | def nested_b008(a=random.randint(0, dt.datetime.now().year)): diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap index d9fa30e32b..992c441fc0 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B009_B009_B010.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B009_B010.py:19:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:19:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 19 | # Invalid usage 20 | getattr(foo, "bar") @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 21 21 | getattr(foo, "__123abc__") 22 22 | getattr(foo, "abc123") -./resources/test/fixtures/flake8_bugbear/B009_B010.py:20:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:20:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 20 | # Invalid usage 21 | getattr(foo, "bar") @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 22 22 | getattr(foo, "abc123") 23 23 | getattr(foo, r"abc123") -./resources/test/fixtures/flake8_bugbear/B009_B010.py:21:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:21:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 21 | getattr(foo, "bar") 22 | getattr(foo, "_123abc") @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 23 23 | getattr(foo, r"abc123") 24 24 | _ = lambda x: getattr(x, "bar") -./resources/test/fixtures/flake8_bugbear/B009_B010.py:22:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:22:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 22 | getattr(foo, "_123abc") 23 | getattr(foo, "__123abc__") @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 24 24 | _ = lambda x: getattr(x, "bar") 25 25 | if getattr(x, "bar"): -./resources/test/fixtures/flake8_bugbear/B009_B010.py:23:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:23:1: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 23 | getattr(foo, "__123abc__") 24 | getattr(foo, "abc123") @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 25 25 | if getattr(x, "bar"): 26 26 | pass -./resources/test/fixtures/flake8_bugbear/B009_B010.py:24:15: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:24:15: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 24 | getattr(foo, "abc123") 25 | getattr(foo, r"abc123") @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 26 26 | pass 27 27 | -./resources/test/fixtures/flake8_bugbear/B009_B010.py:25:4: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:25:4: B009 [*] Do not call `getattr` with a constant attribute value. It is not any safer than normal property access. | 25 | getattr(foo, r"abc123") 26 | _ = lambda x: getattr(x, "bar") diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap index f28b4603be..5dc92f5f78 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B010_B009_B010.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B009_B010.py:40:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:40:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 40 | # Invalid usage 41 | setattr(foo, "bar", None) @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 42 42 | setattr(foo, "__123abc__", None) 43 43 | setattr(foo, "abc123", None) -./resources/test/fixtures/flake8_bugbear/B009_B010.py:41:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:41:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 41 | # Invalid usage 42 | setattr(foo, "bar", None) @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 43 43 | setattr(foo, "abc123", None) 44 44 | setattr(foo, r"abc123", None) -./resources/test/fixtures/flake8_bugbear/B009_B010.py:42:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:42:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 42 | setattr(foo, "bar", None) 43 | setattr(foo, "_123abc", None) @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 44 44 | setattr(foo, r"abc123", None) 45 45 | setattr(foo.bar, r"baz", None) -./resources/test/fixtures/flake8_bugbear/B009_B010.py:43:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:43:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 43 | setattr(foo, "_123abc", None) 44 | setattr(foo, "__123abc__", None) @@ -83,7 +83,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 44 44 | setattr(foo, r"abc123", None) 45 45 | setattr(foo.bar, r"baz", None) -./resources/test/fixtures/flake8_bugbear/B009_B010.py:44:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:44:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 44 | setattr(foo, "__123abc__", None) 45 | setattr(foo, "abc123", None) @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 44 |+foo.abc123 = None 45 45 | setattr(foo.bar, r"baz", None) -./resources/test/fixtures/flake8_bugbear/B009_B010.py:45:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. +B009_B010.py:45:1: B010 [*] Do not call `setattr` with a constant attribute value. It is not any safer than normal property access. | 45 | setattr(foo, "abc123", None) 46 | setattr(foo, r"abc123", None) diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap index fa7d3dfc68..5da3456b34 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B011_B011.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B011.py:8:8: B011 [*] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` +B011.py:8:8: B011 [*] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` | 8 | assert 1 != 2 9 | assert False @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 9 9 | assert 1 != 2, "message" 10 10 | assert False, "message" -./resources/test/fixtures/flake8_bugbear/B011.py:10:8: B011 [*] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` +B011.py:10:8: B011 [*] Do not `assert False` (`python -O` removes these calls), raise `AssertionError()` | 10 | assert False 11 | assert 1 != 2, "message" diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap index e6f6e97626..a3a5aa4f09 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B012_B012.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B012.py:5:9: B012 `return` inside `finally` blocks cause exceptions to be silenced +B012.py:5:9: B012 `return` inside `finally` blocks cause exceptions to be silenced | 5 | pass 6 | finally: @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^ B012 | -./resources/test/fixtures/flake8_bugbear/B012.py:13:13: B012 `return` inside `finally` blocks cause exceptions to be silenced +B012.py:13:13: B012 `return` inside `finally` blocks cause exceptions to be silenced | 13 | finally: 14 | if 1 + 0 == 2 - 1: @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^ B012 | -./resources/test/fixtures/flake8_bugbear/B012.py:21:13: B012 `return` inside `finally` blocks cause exceptions to be silenced +B012.py:21:13: B012 `return` inside `finally` blocks cause exceptions to be silenced | 21 | finally: 22 | try: @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 25 | pass | -./resources/test/fixtures/flake8_bugbear/B012.py:31:13: B012 `return` inside `finally` blocks cause exceptions to be silenced +B012.py:31:13: B012 `return` inside `finally` blocks cause exceptions to be silenced | 31 | pass 32 | finally: @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 35 | pass | -./resources/test/fixtures/flake8_bugbear/B012.py:44:21: B012 `return` inside `finally` blocks cause exceptions to be silenced +B012.py:44:21: B012 `return` inside `finally` blocks cause exceptions to be silenced | 44 | pass 45 | finally: @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 48 | finally: | -./resources/test/fixtures/flake8_bugbear/B012.py:66:13: B012 `break` inside `finally` blocks cause exceptions to be silenced +B012.py:66:13: B012 `break` inside `finally` blocks cause exceptions to be silenced | 66 | pass 67 | finally: @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 70 | def j(): | -./resources/test/fixtures/flake8_bugbear/B012.py:78:13: B012 `continue` inside `finally` blocks cause exceptions to be silenced +B012.py:78:13: B012 `continue` inside `finally` blocks cause exceptions to be silenced | 78 | pass 79 | finally: @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 82 | def j(): | -./resources/test/fixtures/flake8_bugbear/B012.py:94:13: B012 `return` inside `finally` blocks cause exceptions to be silenced +B012.py:94:13: B012 `return` inside `finally` blocks cause exceptions to be silenced | 94 | continue # no warning 95 | while True: @@ -75,7 +75,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^ B012 | -./resources/test/fixtures/flake8_bugbear/B012.py:101:9: B012 `continue` inside `finally` blocks cause exceptions to be silenced +B012.py:101:9: B012 `continue` inside `finally` blocks cause exceptions to be silenced | 101 | pass 102 | finally: @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 105 | while True: | -./resources/test/fixtures/flake8_bugbear/B012.py:107:9: B012 `break` inside `finally` blocks cause exceptions to be silenced +B012.py:107:9: B012 `break` inside `finally` blocks cause exceptions to be silenced | 107 | pass 108 | finally: @@ -93,7 +93,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^ B012 | -./resources/test/fixtures/flake8_bugbear/B012.py:118:17: B012 `break` inside `finally` blocks cause exceptions to be silenced +B012.py:118:17: B012 `break` inside `finally` blocks cause exceptions to be silenced | 118 | y = 0 119 | case 0, *x: diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap index 6b514ffe1b..da61eecc72 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B013_B013.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B013.py:3:8: B013 [*] A length-one tuple literal is redundant. Write `except ValueError` instead of `except (ValueError,)`. +B013.py:3:8: B013 [*] A length-one tuple literal is redundant. Write `except ValueError` instead of `except (ValueError,)`. | 3 | try: 4 | pass diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap index faccf7b00d..75773319f8 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B014_B014.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B014.py:17:8: B014 [*] Exception handler with duplicate exception: `OSError` +B014.py:17:8: B014 [*] Exception handler with duplicate exception: `OSError` | 17 | try: 18 | pass @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 19 19 | pass 20 20 | -./resources/test/fixtures/flake8_bugbear/B014.py:28:8: B014 [*] Exception handler with duplicate exception: `MyError` +B014.py:28:8: B014 [*] Exception handler with duplicate exception: `MyError` | 28 | try: 29 | pass @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 30 30 | pass 31 31 | -./resources/test/fixtures/flake8_bugbear/B014.py:49:8: B014 [*] Exception handler with duplicate exception: `re.error` +B014.py:49:8: B014 [*] Exception handler with duplicate exception: `re.error` | 49 | try: 50 | pass diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap index d681393d9e..1743053775 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B015_B015.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B015.py:3:1: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. +B015.py:3:1: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. | 3 | assert 1 == 1 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 7 | assert 1 in (1, 2) | -./resources/test/fixtures/flake8_bugbear/B015.py:7:1: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. +B015.py:7:1: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. | 7 | assert 1 in (1, 2) 8 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^^^^^^ B015 | -./resources/test/fixtures/flake8_bugbear/B015.py:17:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. +B015.py:17:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. | 17 | assert 1 in (1, 2) 18 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^^^^^^ B015 | -./resources/test/fixtures/flake8_bugbear/B015.py:24:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. +B015.py:24:5: B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it. | 24 | class TestClass: 25 | 1 == 1 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap index 7a59bd0376..00c21395a3 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B016_B016.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B016.py:6:7: B016 Cannot raise a literal. Did you intend to return it or raise an Exception? +B016.py:6:7: B016 Cannot raise a literal. Did you intend to return it or raise an Exception? | 6 | """ 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 10 | raise "string" | -./resources/test/fixtures/flake8_bugbear/B016.py:7:7: B016 Cannot raise a literal. Did you intend to return it or raise an Exception? +B016.py:7:7: B016 Cannot raise a literal. Did you intend to return it or raise an Exception? | 7 | raise False 8 | raise 1 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 10 | raise Exception(False) | -./resources/test/fixtures/flake8_bugbear/B016.py:8:7: B016 Cannot raise a literal. Did you intend to return it or raise an Exception? +B016.py:8:7: B016 Cannot raise a literal. Did you intend to return it or raise an Exception? | 8 | raise False 9 | raise 1 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap index b6c15c8168..a5d580fbaf 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B017_B017.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B017.py:22:9: B017 `assertRaises(Exception)` should be considered evil +B017.py:22:9: B017 `assertRaises(Exception)` should be considered evil | 22 | class Foobar(unittest.TestCase): 23 | def evil_raises(self) -> None: diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap index e800fd7d9b..5a81ec31f0 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B018_B018.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B018.py:11:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:11:5: B018 Found useless expression. Either assign it to a variable or remove it. | 11 | "str" # Str (no raise) 12 | f"{int}" # JoinedStr (no raise) @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 15 | 1.0 # Number (float) | -./resources/test/fixtures/flake8_bugbear/B018.py:12:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:12:5: B018 Found useless expression. Either assign it to a variable or remove it. | 12 | f"{int}" # JoinedStr (no raise) 13 | 1j # Number (complex) @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 16 | b"foo" # Binary | -./resources/test/fixtures/flake8_bugbear/B018.py:13:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:13:5: B018 Found useless expression. Either assign it to a variable or remove it. | 13 | 1j # Number (complex) 14 | 1 # Number (int) @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 17 | True # NameConstant (True) | -./resources/test/fixtures/flake8_bugbear/B018.py:14:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:14:5: B018 Found useless expression. Either assign it to a variable or remove it. | 14 | 1 # Number (int) 15 | 1.0 # Number (float) @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 18 | False # NameConstant (False) | -./resources/test/fixtures/flake8_bugbear/B018.py:15:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:15:5: B018 Found useless expression. Either assign it to a variable or remove it. | 15 | 1.0 # Number (float) 16 | b"foo" # Binary @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 19 | None # NameConstant (None) | -./resources/test/fixtures/flake8_bugbear/B018.py:16:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:16:5: B018 Found useless expression. Either assign it to a variable or remove it. | 16 | b"foo" # Binary 17 | True # NameConstant (True) @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 20 | [1, 2] # list | -./resources/test/fixtures/flake8_bugbear/B018.py:17:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:17:5: B018 Found useless expression. Either assign it to a variable or remove it. | 17 | True # NameConstant (True) 18 | False # NameConstant (False) @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 21 | {1, 2} # set | -./resources/test/fixtures/flake8_bugbear/B018.py:18:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:18:5: B018 Found useless expression. Either assign it to a variable or remove it. | 18 | False # NameConstant (False) 19 | None # NameConstant (None) @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 22 | {"foo": "bar"} # dict | -./resources/test/fixtures/flake8_bugbear/B018.py:19:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:19:5: B018 Found useless expression. Either assign it to a variable or remove it. | 19 | None # NameConstant (None) 20 | [1, 2] # list @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 22 | {"foo": "bar"} # dict | -./resources/test/fixtures/flake8_bugbear/B018.py:20:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:20:5: B018 Found useless expression. Either assign it to a variable or remove it. | 20 | [1, 2] # list 21 | {1, 2} # set @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^^^^^^^^^ B018 | -./resources/test/fixtures/flake8_bugbear/B018.py:24:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:24:5: B018 Found useless expression. Either assign it to a variable or remove it. | 24 | class Foo3: 25 | 123 @@ -107,7 +107,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 27 | "str" | -./resources/test/fixtures/flake8_bugbear/B018.py:27:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:27:5: B018 Found useless expression. Either assign it to a variable or remove it. | 27 | a = 2 28 | "str" @@ -115,7 +115,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^ B018 | -./resources/test/fixtures/flake8_bugbear/B018.py:39:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:39:5: B018 Found useless expression. Either assign it to a variable or remove it. | 39 | "str" # Str (no raise) 40 | f"{int}" # JoinedStr (no raise) @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 43 | 1.0 # Number (float) | -./resources/test/fixtures/flake8_bugbear/B018.py:40:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:40:5: B018 Found useless expression. Either assign it to a variable or remove it. | 40 | f"{int}" # JoinedStr (no raise) 41 | 1j # Number (complex) @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 44 | b"foo" # Binary | -./resources/test/fixtures/flake8_bugbear/B018.py:41:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:41:5: B018 Found useless expression. Either assign it to a variable or remove it. | 41 | 1j # Number (complex) 42 | 1 # Number (int) @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 45 | True # NameConstant (True) | -./resources/test/fixtures/flake8_bugbear/B018.py:42:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:42:5: B018 Found useless expression. Either assign it to a variable or remove it. | 42 | 1 # Number (int) 43 | 1.0 # Number (float) @@ -155,7 +155,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 46 | False # NameConstant (False) | -./resources/test/fixtures/flake8_bugbear/B018.py:43:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:43:5: B018 Found useless expression. Either assign it to a variable or remove it. | 43 | 1.0 # Number (float) 44 | b"foo" # Binary @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 47 | None # NameConstant (None) | -./resources/test/fixtures/flake8_bugbear/B018.py:44:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:44:5: B018 Found useless expression. Either assign it to a variable or remove it. | 44 | b"foo" # Binary 45 | True # NameConstant (True) @@ -175,7 +175,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 48 | [1, 2] # list | -./resources/test/fixtures/flake8_bugbear/B018.py:45:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:45:5: B018 Found useless expression. Either assign it to a variable or remove it. | 45 | True # NameConstant (True) 46 | False # NameConstant (False) @@ -185,7 +185,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 49 | {1, 2} # set | -./resources/test/fixtures/flake8_bugbear/B018.py:46:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:46:5: B018 Found useless expression. Either assign it to a variable or remove it. | 46 | False # NameConstant (False) 47 | None # NameConstant (None) @@ -195,7 +195,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 50 | {"foo": "bar"} # dict | -./resources/test/fixtures/flake8_bugbear/B018.py:47:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:47:5: B018 Found useless expression. Either assign it to a variable or remove it. | 47 | None # NameConstant (None) 48 | [1, 2] # list @@ -204,7 +204,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 50 | {"foo": "bar"} # dict | -./resources/test/fixtures/flake8_bugbear/B018.py:48:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:48:5: B018 Found useless expression. Either assign it to a variable or remove it. | 48 | [1, 2] # list 49 | {1, 2} # set @@ -212,7 +212,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^^^^^^^^^ B018 | -./resources/test/fixtures/flake8_bugbear/B018.py:52:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:52:5: B018 Found useless expression. Either assign it to a variable or remove it. | 52 | def foo3(): 53 | 123 @@ -221,7 +221,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 55 | "str" | -./resources/test/fixtures/flake8_bugbear/B018.py:55:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:55:5: B018 Found useless expression. Either assign it to a variable or remove it. | 55 | a = 2 56 | "str" @@ -229,7 +229,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^ B018 | -./resources/test/fixtures/flake8_bugbear/B018.py:63:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:63:5: B018 Found useless expression. Either assign it to a variable or remove it. | 63 | def foo5(): 64 | foo.bar # Attribute (raise) @@ -238,7 +238,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 66 | "foo" + "bar" # BinOp (raise) | -./resources/test/fixtures/flake8_bugbear/B018.py:64:5: B018 Found useless attribute access. Either assign it to a variable or remove it. +B018.py:64:5: B018 Found useless attribute access. Either assign it to a variable or remove it. | 64 | def foo5(): 65 | foo.bar # Attribute (raise) @@ -247,7 +247,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 67 | "foo" + "bar" # BinOp (raise) | -./resources/test/fixtures/flake8_bugbear/B018.py:65:5: B018 Found useless expression. Either assign it to a variable or remove it. +B018.py:65:5: B018 Found useless expression. Either assign it to a variable or remove it. | 65 | foo.bar # Attribute (raise) 66 | object().__class__ # Attribute (raise) diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap index 107ad3c4b9..07e5374807 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B019_B019.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B019.py:78:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:78:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 78 | # Remaining methods should emit B019 79 | @functools.cache @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 81 | ... | -./resources/test/fixtures/flake8_bugbear/B019.py:82:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:82:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 82 | ... 83 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 86 | ... | -./resources/test/fixtures/flake8_bugbear/B019.py:86:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:86:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 86 | ... 87 | @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 90 | ... | -./resources/test/fixtures/flake8_bugbear/B019.py:90:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:90:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 90 | ... 91 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 94 | ... | -./resources/test/fixtures/flake8_bugbear/B019.py:94:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:94:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 94 | ... 95 | @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 98 | ... | -./resources/test/fixtures/flake8_bugbear/B019.py:98:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:98:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 98 | ... 99 | @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 102 | ... | -./resources/test/fixtures/flake8_bugbear/B019.py:102:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:102:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 102 | ... 103 | @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 106 | ... | -./resources/test/fixtures/flake8_bugbear/B019.py:106:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks +B019.py:106:6: B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks | 106 | ... 107 | diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap index b9e778d0d3..197d363d6b 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B020_B020.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B020.py:8:5: B020 Loop control variable `items` overrides iterable it iterates +B020.py:8:5: B020 Loop control variable `items` overrides iterable it iterates | 8 | items = [1, 2, 3] 9 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 11 | print(items) | -./resources/test/fixtures/flake8_bugbear/B020.py:21:10: B020 Loop control variable `values` overrides iterable it iterates +B020.py:21:10: B020 Loop control variable `values` overrides iterable it iterates | 21 | print(f"{key}, {value}") 22 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 24 | print(f"{key}, {values}") | -./resources/test/fixtures/flake8_bugbear/B020.py:36:5: B020 Loop control variable `vars` overrides iterable it iterates +B020.py:36:5: B020 Loop control variable `vars` overrides iterable it iterates | 36 | # However we still call out reassigning the iterable in the comprehension. 37 | for vars in [i for i in vars]: diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap index 069184c92b..77d34cb658 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B021_B021.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B021.py:1:1: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:1:1: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 1 | / f""" 2 | | Should emit: @@ -12,63 +12,63 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 6 | VARIABLE = "world" | -./resources/test/fixtures/flake8_bugbear/B021.py:14:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:14:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 14 | def foo2(): 15 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:22:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:22:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 22 | class bar2: 23 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:30:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:30:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 30 | def foo2(): 31 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:38:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:38:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 38 | class bar2: 39 | f"""hello {VARIABLE}!""" | ^^^^^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:46:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:46:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 46 | def foo2(): 47 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:54:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:54:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 54 | class bar2: 55 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:62:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:62:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 62 | def foo2(): 63 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:70:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:70:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 70 | class bar2: 71 | f"hello {VARIABLE}!" | ^^^^^^^^^^^^^^^^^^^^ B021 | -./resources/test/fixtures/flake8_bugbear/B021.py:74:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. +B021.py:74:5: B021 f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring. | 74 | def baz(): 75 | f"""I'm probably a docstring: {VARIABLE}!""" diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap index b595e6e473..26faac2a7f 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B022_B022.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B022.py:9:6: B022 No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant +B022.py:9:6: B022 No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant | 9 | from contextlib import suppress 10 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 12 | raise ValueError | -./resources/test/fixtures/flake8_bugbear/B022.py:12:6: B022 No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant +B022.py:12:6: B022 No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant | 12 | raise ValueError 13 | diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap index f53afe4d28..4bd4531207 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B023_B023.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B023.py:12:30: B023 Function definition does not bind loop variable `x` +B023.py:12:30: B023 Function definition does not bind loop variable `x` | 12 | y = x + 1 13 | # Subject to late-binding problems @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 15 | functions.append(lambda: y) # not just the loop var | -./resources/test/fixtures/flake8_bugbear/B023.py:13:30: B023 Function definition does not bind loop variable `y` +B023.py:13:30: B023 Function definition does not bind loop variable `y` | 13 | # Subject to late-binding problems 14 | functions.append(lambda: x) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 17 | def f_bad_1(): | -./resources/test/fixtures/flake8_bugbear/B023.py:16:16: B023 Function definition does not bind loop variable `x` +B023.py:16:16: B023 Function definition does not bind loop variable `x` | 16 | def f_bad_1(): 17 | return x @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 19 | # Actually OK | -./resources/test/fixtures/flake8_bugbear/B023.py:28:19: B023 Function definition does not bind loop variable `x` +B023.py:28:19: B023 Function definition does not bind loop variable `x` | 28 | def check_inside_functions_too(): 29 | ls = [lambda: x for x in range(2)] # error @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 31 | gn = (lambda: x for x in range(2)) # error | -./resources/test/fixtures/flake8_bugbear/B023.py:29:19: B023 Function definition does not bind loop variable `x` +B023.py:29:19: B023 Function definition does not bind loop variable `x` | 29 | def check_inside_functions_too(): 30 | ls = [lambda: x for x in range(2)] # error @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 33 | dt = {x: lambda: x for x in range(2)} # error | -./resources/test/fixtures/flake8_bugbear/B023.py:30:19: B023 Function definition does not bind loop variable `x` +B023.py:30:19: B023 Function definition does not bind loop variable `x` | 30 | ls = [lambda: x for x in range(2)] # error 31 | st = {lambda: x for x in range(2)} # error @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 33 | dt = {x: lambda: x for x in range(2)} # error | -./resources/test/fixtures/flake8_bugbear/B023.py:31:22: B023 Function definition does not bind loop variable `x` +B023.py:31:22: B023 Function definition does not bind loop variable `x` | 31 | st = {lambda: x for x in range(2)} # error 32 | gn = (lambda: x for x in range(2)) # error @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^ B023 | -./resources/test/fixtures/flake8_bugbear/B023.py:40:34: B023 Function definition does not bind loop variable `x` +B023.py:40:34: B023 Function definition does not bind loop variable `x` | 40 | async def container_for_problems(): 41 | async for x in pointless_async_iterable(): @@ -75,7 +75,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 44 | [lambda: x async for x in pointless_async_iterable()] # error | -./resources/test/fixtures/flake8_bugbear/B023.py:42:14: B023 Function definition does not bind loop variable `x` +B023.py:42:14: B023 Function definition does not bind loop variable `x` | 42 | functions.append(lambda: x) # error 43 | @@ -83,7 +83,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^ B023 | -./resources/test/fixtures/flake8_bugbear/B023.py:50:30: B023 Function definition does not bind loop variable `a` +B023.py:50:30: B023 Function definition does not bind loop variable `a` | 50 | a = a_ = a - 1 51 | b += 1 @@ -93,7 +93,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 54 | functions.append(lambda: b) # error | -./resources/test/fixtures/flake8_bugbear/B023.py:51:30: B023 Function definition does not bind loop variable `a_` +B023.py:51:30: B023 Function definition does not bind loop variable `a_` | 51 | b += 1 52 | functions.append(lambda: a) # error @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 55 | functions.append(lambda: c) # error, but not a name error due to late binding | -./resources/test/fixtures/flake8_bugbear/B023.py:52:30: B023 Function definition does not bind loop variable `b` +B023.py:52:30: B023 Function definition does not bind loop variable `b` | 52 | functions.append(lambda: a) # error 53 | functions.append(lambda: a_) # error @@ -113,7 +113,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 56 | c: bool = a > 3 | -./resources/test/fixtures/flake8_bugbear/B023.py:53:30: B023 Function definition does not bind loop variable `c` +B023.py:53:30: B023 Function definition does not bind loop variable `c` | 53 | functions.append(lambda: a_) # error 54 | functions.append(lambda: b) # error @@ -123,7 +123,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 57 | if not c: | -./resources/test/fixtures/flake8_bugbear/B023.py:61:17: B023 Function definition does not bind loop variable `j` +B023.py:61:17: B023 Function definition does not bind loop variable `j` | 61 | for j in range(2): 62 | for k in range(3): @@ -131,7 +131,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^ B023 | -./resources/test/fixtures/flake8_bugbear/B023.py:61:21: B023 Function definition does not bind loop variable `k` +B023.py:61:21: B023 Function definition does not bind loop variable `k` | 61 | for j in range(2): 62 | for k in range(3): @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^ B023 | -./resources/test/fixtures/flake8_bugbear/B023.py:68:10: B023 Function definition does not bind loop variable `l` +B023.py:68:10: B023 Function definition does not bind loop variable `l` | 68 | def f(): 69 | j = None # OK because it's an assignment @@ -149,14 +149,14 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 72 | assert a and functions | -./resources/test/fixtures/flake8_bugbear/B023.py:82:16: B023 Function definition does not bind loop variable `i` +B023.py:82:16: B023 Function definition does not bind loop variable `i` | 82 | for i in range(3): 83 | lambda: f"{i}" | ^ B023 | -./resources/test/fixtures/flake8_bugbear/B023.py:117:24: B023 Function definition does not bind loop variable `x` +B023.py:117:24: B023 Function definition does not bind loop variable `x` | 117 | for x in range(2): 118 | # It's not a complete get-out-of-linting-free construct - these should fail: @@ -166,7 +166,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 121 | any(filter(bool, [None, lambda: x])) | -./resources/test/fixtures/flake8_bugbear/B023.py:118:27: B023 Function definition does not bind loop variable `x` +B023.py:118:27: B023 Function definition does not bind loop variable `x` | 118 | # It's not a complete get-out-of-linting-free construct - these should fail: 119 | min([None, lambda: x], key=repr) @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 122 | list(filter(bool, [None, lambda: x])) | -./resources/test/fixtures/flake8_bugbear/B023.py:119:37: B023 Function definition does not bind loop variable `x` +B023.py:119:37: B023 Function definition does not bind loop variable `x` | 119 | min([None, lambda: x], key=repr) 120 | sorted([None, lambda: x], key=repr) @@ -186,7 +186,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 123 | all(reduce(bool, [None, lambda: x])) | -./resources/test/fixtures/flake8_bugbear/B023.py:120:38: B023 Function definition does not bind loop variable `x` +B023.py:120:38: B023 Function definition does not bind loop variable `x` | 120 | sorted([None, lambda: x], key=repr) 121 | any(filter(bool, [None, lambda: x])) @@ -195,7 +195,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 123 | all(reduce(bool, [None, lambda: x])) | -./resources/test/fixtures/flake8_bugbear/B023.py:121:37: B023 Function definition does not bind loop variable `x` +B023.py:121:37: B023 Function definition does not bind loop variable `x` | 121 | any(filter(bool, [None, lambda: x])) 122 | list(filter(bool, [None, lambda: x])) @@ -205,7 +205,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 125 | # But all these should be OK: | -./resources/test/fixtures/flake8_bugbear/B023.py:171:29: B023 Function definition does not bind loop variable `name` +B023.py:171:29: B023 Function definition does not bind loop variable `name` | 171 | if foo(name): 172 | return [lambda: name] # known false alarm @@ -214,7 +214,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 174 | if False: | -./resources/test/fixtures/flake8_bugbear/B023.py:174:29: B023 Function definition does not bind loop variable `i` +B023.py:174:29: B023 Function definition does not bind loop variable `i` | 174 | if False: 175 | return [lambda: i for i in range(3)] # error diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap index 6033dd2300..72378202ef 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B024_B024.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B024.py:18:1: B024 `Base_1` is an abstract base class, but it has no abstract methods +B024.py:18:1: B024 `Base_1` is an abstract base class, but it has no abstract methods | 18 | / class Base_1(ABC): # error 19 | | def method(self): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | |_____________^ B024 | -./resources/test/fixtures/flake8_bugbear/B024.py:71:1: B024 `MetaBase_1` is an abstract base class, but it has no abstract methods +B024.py:71:1: B024 `MetaBase_1` is an abstract base class, but it has no abstract methods | 71 | / class MetaBase_1(metaclass=ABCMeta): # error 72 | | def method(self): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | |_____________^ B024 | -./resources/test/fixtures/flake8_bugbear/B024.py:82:1: B024 `abc_Base_1` is an abstract base class, but it has no abstract methods +B024.py:82:1: B024 `abc_Base_1` is an abstract base class, but it has no abstract methods | 82 | / class abc_Base_1(abc.ABC): # error 83 | | def method(self): @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | |_____________^ B024 | -./resources/test/fixtures/flake8_bugbear/B024.py:87:1: B024 `abc_Base_2` is an abstract base class, but it has no abstract methods +B024.py:87:1: B024 `abc_Base_2` is an abstract base class, but it has no abstract methods | 87 | / class abc_Base_2(metaclass=abc.ABCMeta): # error 88 | | def method(self): @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | |_____________^ B024 | -./resources/test/fixtures/flake8_bugbear/B024.py:92:1: B024 `notabc_Base_1` is an abstract base class, but it has no abstract methods +B024.py:92:1: B024 `notabc_Base_1` is an abstract base class, but it has no abstract methods | 92 | / class notabc_Base_1(notabc.ABC): # error 93 | | def method(self): @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | |_____________^ B024 | -./resources/test/fixtures/flake8_bugbear/B024.py:141:1: B024 `abc_set_class_variable_4` is an abstract base class, but it has no abstract methods +B024.py:141:1: B024 `abc_set_class_variable_4` is an abstract base class, but it has no abstract methods | 141 | # this doesn't actually declare a class variable, it's just an expression 142 | / class abc_set_class_variable_4(ABC): # error diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap index a2959a3f0d..e25210df1b 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B025_B025.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B025.py:19:8: B025 try-except block with duplicate exception `ValueError` +B025.py:19:8: B025 try-except block with duplicate exception `ValueError` | 19 | except ValueError: 20 | a = 2 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 22 | a = 2 | -./resources/test/fixtures/flake8_bugbear/B025.py:28:8: B025 try-except block with duplicate exception `pickle.PickleError` +B025.py:28:8: B025 try-except block with duplicate exception `pickle.PickleError` | 28 | except ValueError: 29 | a = 2 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 31 | a = 2 | -./resources/test/fixtures/flake8_bugbear/B025.py:35:8: B025 try-except block with duplicate exception `ValueError` +B025.py:35:8: B025 try-except block with duplicate exception `ValueError` | 35 | except (ValueError, TypeError): 36 | a = 2 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 39 | except (OSError, TypeError): | -./resources/test/fixtures/flake8_bugbear/B025.py:37:18: B025 try-except block with duplicate exception `TypeError` +B025.py:37:18: B025 try-except block with duplicate exception `TypeError` | 37 | except ValueError: 38 | a = 2 diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap index bf94818a67..784acbeaf7 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B026_B026.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B026.py:16:16: B026 Star-arg unpacking after a keyword argument is strongly discouraged +B026.py:16:16: B026 Star-arg unpacking after a keyword argument is strongly discouraged | 16 | foo("bar", baz="baz", bam="bam") 17 | foo(bar="bar", baz="baz", bam="bam") @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 20 | foo(baz="baz", bam="bam", *["bar"]) | -./resources/test/fixtures/flake8_bugbear/B026.py:17:16: B026 Star-arg unpacking after a keyword argument is strongly discouraged +B026.py:17:16: B026 Star-arg unpacking after a keyword argument is strongly discouraged | 17 | foo(bar="bar", baz="baz", bam="bam") 18 | foo(bam="bam", *["bar", "baz"]) @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 21 | foo(bar="bar", baz="baz", bam="bam", *[]) | -./resources/test/fixtures/flake8_bugbear/B026.py:18:27: B026 Star-arg unpacking after a keyword argument is strongly discouraged +B026.py:18:27: B026 Star-arg unpacking after a keyword argument is strongly discouraged | 18 | foo(bam="bam", *["bar", "baz"]) 19 | foo(bam="bam", *bar_baz) @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 22 | foo(bam="bam", *["bar"], *["baz"]) | -./resources/test/fixtures/flake8_bugbear/B026.py:19:38: B026 Star-arg unpacking after a keyword argument is strongly discouraged +B026.py:19:38: B026 Star-arg unpacking after a keyword argument is strongly discouraged | 19 | foo(bam="bam", *bar_baz) 20 | foo(baz="baz", bam="bam", *["bar"]) @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 23 | foo(*["bar"], bam="bam", *["baz"]) | -./resources/test/fixtures/flake8_bugbear/B026.py:20:16: B026 Star-arg unpacking after a keyword argument is strongly discouraged +B026.py:20:16: B026 Star-arg unpacking after a keyword argument is strongly discouraged | 20 | foo(baz="baz", bam="bam", *["bar"]) 21 | foo(bar="bar", baz="baz", bam="bam", *[]) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 23 | foo(*["bar"], bam="bam", *["baz"]) | -./resources/test/fixtures/flake8_bugbear/B026.py:20:26: B026 Star-arg unpacking after a keyword argument is strongly discouraged +B026.py:20:26: B026 Star-arg unpacking after a keyword argument is strongly discouraged | 20 | foo(baz="baz", bam="bam", *["bar"]) 21 | foo(bar="bar", baz="baz", bam="bam", *[]) @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 23 | foo(*["bar"], bam="bam", *["baz"]) | -./resources/test/fixtures/flake8_bugbear/B026.py:21:26: B026 Star-arg unpacking after a keyword argument is strongly discouraged +B026.py:21:26: B026 Star-arg unpacking after a keyword argument is strongly discouraged | 21 | foo(bar="bar", baz="baz", bam="bam", *[]) 22 | foo(bam="bam", *["bar"], *["baz"]) diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap index 211cc77be3..0385d12459 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B027_B027.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B027.py:13:5: B027 `AbstractClass.empty_1` is an empty method in an abstract base class, but has no abstract decorator +B027.py:13:5: B027 `AbstractClass.empty_1` is an empty method in an abstract base class, but has no abstract decorator | 13 | class AbstractClass(ABC): 14 | def empty_1(self): # error @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 17 | def empty_2(self): # error | -./resources/test/fixtures/flake8_bugbear/B027.py:16:5: B027 `AbstractClass.empty_2` is an empty method in an abstract base class, but has no abstract decorator +B027.py:16:5: B027 `AbstractClass.empty_2` is an empty method in an abstract base class, but has no abstract decorator | 16 | ... 17 | @@ -24,7 +24,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 21 | def empty_3(self): # error | -./resources/test/fixtures/flake8_bugbear/B027.py:19:5: B027 `AbstractClass.empty_3` is an empty method in an abstract base class, but has no abstract decorator +B027.py:19:5: B027 `AbstractClass.empty_3` is an empty method in an abstract base class, but has no abstract decorator | 19 | pass 20 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 25 | def empty_4(self): # error | -./resources/test/fixtures/flake8_bugbear/B027.py:23:5: B027 `AbstractClass.empty_4` is an empty method in an abstract base class, but has no abstract decorator +B027.py:23:5: B027 `AbstractClass.empty_4` is an empty method in an abstract base class, but has no abstract decorator | 23 | ... 24 | diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B028_B028.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B028_B028.py.snap index 8c42e84306..2f2f3a7363 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B028_B028.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B028_B028.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B028.py:8:1: B028 No explicit `stacklevel` keyword argument found +B028.py:8:1: B028 No explicit `stacklevel` keyword argument found | 8 | """ 9 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 12 | warnings.warn(DeprecationWarning("test"), source=None, stacklevel=2) | -./resources/test/fixtures/flake8_bugbear/B028.py:9:1: B028 No explicit `stacklevel` keyword argument found +B028.py:9:1: B028 No explicit `stacklevel` keyword argument found | 9 | warnings.warn(DeprecationWarning("test")) 10 | warnings.warn(DeprecationWarning("test"), source=None) diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap index aad9e067c4..d976f9f03d 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B029_B029.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B029.py:8:1: B029 Using `except ():` with an empty tuple does not catch anything; add exceptions to handle +B029.py:8:1: B029 Using `except ():` with an empty tuple does not catch anything; add exceptions to handle | 8 | try: 9 | pass @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 13 | try: | -./resources/test/fixtures/flake8_bugbear/B029.py:13:1: B029 Using `except ():` with an empty tuple does not catch anything; add exceptions to handle +B029.py:13:1: B029 Using `except ():` with an empty tuple does not catch anything; add exceptions to handle | 13 | try: 14 | pass diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap index f760ceb59b..3ec4d39fc6 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B030_B030.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B030.py:12:8: B030 `except` handlers should only be exception classes or tuples of exception classes +B030.py:12:8: B030 `except` handlers should only be exception classes or tuples of exception classes | 12 | try: 13 | pass @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 15 | pass | -./resources/test/fixtures/flake8_bugbear/B030.py:17:9: B030 `except` handlers should only be exception classes or tuples of exception classes +B030.py:17:9: B030 `except` handlers should only be exception classes or tuples of exception classes | 17 | try: 18 | pass @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 20 | pass | -./resources/test/fixtures/flake8_bugbear/B030.py:22:21: B030 `except` handlers should only be exception classes or tuples of exception classes +B030.py:22:21: B030 `except` handlers should only be exception classes or tuples of exception classes | 22 | try: 23 | pass @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 25 | pass | -./resources/test/fixtures/flake8_bugbear/B030.py:27:37: B030 `except` handlers should only be exception classes or tuples of exception classes +B030.py:27:37: B030 `except` handlers should only be exception classes or tuples of exception classes | 27 | try: 28 | pass @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 30 | pass | -./resources/test/fixtures/flake8_bugbear/B030.py:33:29: B030 `except` handlers should only be exception classes or tuples of exception classes +B030.py:33:29: B030 `except` handlers should only be exception classes or tuples of exception classes | 33 | try: 34 | pass diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B031_B031.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B031_B031.py.snap index 81ffbf3a5f..8bd10dea69 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B031_B031.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B031_B031.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B031.py:27:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:27:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 27 | for shopper in shoppers: 28 | shopper = shopper.title() @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 31 | collect_shop_items(shopper, section_items) # B031 | -./resources/test/fixtures/flake8_bugbear/B031.py:29:33: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:29:33: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 29 | collect_shop_items(shopper, section_items) # B031 30 | # We're outside the nested loop and used the group again. @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 33 | for _section, section_items in groupby(items, key=lambda p: p[1]): | -./resources/test/fixtures/flake8_bugbear/B031.py:33:31: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:33:31: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 33 | for _section, section_items in groupby(items, key=lambda p: p[1]): 34 | collect_shop_items("Jane", section_items) @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^^^^^^^^ B031 | -./resources/test/fixtures/flake8_bugbear/B031.py:40:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:40:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 40 | countdown = 3 41 | while countdown > 0: @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 43 | countdown -= 1 | -./resources/test/fixtures/flake8_bugbear/B031.py:46:29: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:46:29: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 46 | collection = [] 47 | for _section, section_items in groupby(items, key=lambda p: p[1]): @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 50 | unique_items = set() | -./resources/test/fixtures/flake8_bugbear/B031.py:56:17: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:56:17: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 56 | # But it should be detected when used again 57 | for item in section_items: # B031 @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 58 | another_set.add(item) | -./resources/test/fixtures/flake8_bugbear/B031.py:79:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:79:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 79 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): 80 | for shopper in shoppers: @@ -66,7 +66,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 83 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): | -./resources/test/fixtures/flake8_bugbear/B031.py:82:38: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:82:38: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 82 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): 83 | _ = [collect_shop_items(shopper, section_items) for shopper in shoppers] # B031 @@ -75,7 +75,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 85 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): | -./resources/test/fixtures/flake8_bugbear/B031.py:94:65: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:94:65: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 94 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): 95 | # The iterator is being used for the second time. @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 98 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): | -./resources/test/fixtures/flake8_bugbear/B031.py:101:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:101:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 101 | else: 102 | collect_shop_items(shopper, section_items) @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 105 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): | -./resources/test/fixtures/flake8_bugbear/B031.py:108:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:108:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 108 | collect_shop_items(shopper, section_items) 109 | if _section == "greens": @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 112 | collect_shop_items(shopper, section_items) # B031 | -./resources/test/fixtures/flake8_bugbear/B031.py:110:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:110:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 110 | collect_shop_items(shopper, section_items) # B031 111 | elif _section == "frozen items": @@ -115,7 +115,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 114 | collect_shop_items(shopper, section_items) # B031 | -./resources/test/fixtures/flake8_bugbear/B031.py:112:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:112:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 112 | collect_shop_items(shopper, section_items) # B031 113 | else: @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 116 | elif _section == "frozen items": | -./resources/test/fixtures/flake8_bugbear/B031.py:113:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:113:37: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 113 | else: 114 | collect_shop_items(shopper, section_items) # B031 @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 117 | # Mix `match` and `if` statements | -./resources/test/fixtures/flake8_bugbear/B031.py:120:49: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:120:49: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 120 | collect_shop_items(shopper, section_items) 121 | if _section == "fourth": @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 124 | collect_shop_items(shopper, section_items) | -./resources/test/fixtures/flake8_bugbear/B031.py:126:33: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:126:33: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 126 | collect_shop_items(shopper, section_items) 127 | # Now, it should detect @@ -155,7 +155,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 130 | for _section, section_items in itertools.groupby(items, key=lambda p: p[1]): | -./resources/test/fixtures/flake8_bugbear/B031.py:135:49: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:135:49: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 135 | match shopper: 136 | case "Jane": @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 139 | collect_shop_items(shopper, section_items) # B031 | -./resources/test/fixtures/flake8_bugbear/B031.py:137:49: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:137:49: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 137 | collect_shop_items(shopper, section_items) # B031 138 | case _: @@ -175,7 +175,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 141 | collect_shop_items(shopper, section_items) | -./resources/test/fixtures/flake8_bugbear/B031.py:140:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:140:41: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 140 | case "frozen items": 141 | collect_shop_items(shopper, section_items) @@ -185,7 +185,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 144 | collect_shop_items(shopper, section_items) | -./resources/test/fixtures/flake8_bugbear/B031.py:144:33: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage +B031.py:144:33: B031 Using the generator returned from `itertools.groupby()` more than once will do nothing on the second usage | 144 | collect_shop_items(shopper, section_items) 145 | # Now, it should detect diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap index 014e7d9ed1..8550375730 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B032_B032.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B032.py:9:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:9:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 9 | dct = {"a": 1} 10 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 12 | dct.b: 2 | -./resources/test/fixtures/flake8_bugbear/B032.py:10:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:10:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 10 | dct["b"]: 2 11 | dct.b: 2 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 13 | dct["b"]: "test" | -./resources/test/fixtures/flake8_bugbear/B032.py:12:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:12:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 12 | dct.b: 2 13 | @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 15 | dct.b: "test" | -./resources/test/fixtures/flake8_bugbear/B032.py:13:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:13:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 13 | dct["b"]: "test" 14 | dct.b: "test" @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 16 | test = "test" | -./resources/test/fixtures/flake8_bugbear/B032.py:16:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:16:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 16 | test = "test" 17 | dct["b"]: test @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 19 | dct.b: test | -./resources/test/fixtures/flake8_bugbear/B032.py:17:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:17:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 17 | test = "test" 18 | dct["b"]: test @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 21 | dct.b: test.lower() | -./resources/test/fixtures/flake8_bugbear/B032.py:18:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:18:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 18 | dct["b"]: test 19 | dct["b"]: test.lower() @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 21 | dct.b: test.lower() | -./resources/test/fixtures/flake8_bugbear/B032.py:19:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? +B032.py:19:1: B032 Possible unintentional type annotation (using `:`). Did you mean to assign (using `=`)? | 19 | dct["b"]: test.lower() 20 | dct.b: test diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap index 47f5082c81..86c1e6c3b1 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B904_B904.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B904.py:10:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling +B904.py:10:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling | 10 | except ValueError: 11 | if "abc": @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 14 | except AssertionError: | -./resources/test/fixtures/flake8_bugbear/B904.py:11:5: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling +B904.py:11:5: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling | 11 | if "abc": 12 | raise TypeError @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 15 | raise # Bare `raise` should not be an error | -./resources/test/fixtures/flake8_bugbear/B904.py:16:5: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling +B904.py:16:5: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling | 16 | except Exception as err: 17 | assert err @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 20 | # Might use this instead of bare raise with the `.with_traceback()` method | -./resources/test/fixtures/flake8_bugbear/B904.py:62:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling +B904.py:62:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling | 62 | except Exception as e: 63 | if ...: @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 66 | raise RuntimeError("bang!") | -./resources/test/fixtures/flake8_bugbear/B904.py:64:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling +B904.py:64:9: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling | 64 | raise RuntimeError("boom!") 65 | else: @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B904 | -./resources/test/fixtures/flake8_bugbear/B904.py:72:13: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling +B904.py:72:13: B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling | 72 | match 0: 73 | case 0: diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap index c39c7266ae..d18f371546 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__B905_B905.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B905.py:1:1: B905 `zip()` without an explicit `strict=` parameter +B905.py:1:1: B905 `zip()` without an explicit `strict=` parameter | 1 | zip() | ^^^^^ B905 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 3 | zip("a", "b") | -./resources/test/fixtures/flake8_bugbear/B905.py:2:1: B905 `zip()` without an explicit `strict=` parameter +B905.py:2:1: B905 `zip()` without an explicit `strict=` parameter | 2 | zip() 3 | zip(range(3)) @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 5 | zip("a", "b", *zip("c")) | -./resources/test/fixtures/flake8_bugbear/B905.py:3:1: B905 `zip()` without an explicit `strict=` parameter +B905.py:3:1: B905 `zip()` without an explicit `strict=` parameter | 3 | zip() 4 | zip(range(3)) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 7 | zip(zip("a"), strict=False) | -./resources/test/fixtures/flake8_bugbear/B905.py:4:1: B905 `zip()` without an explicit `strict=` parameter +B905.py:4:1: B905 `zip()` without an explicit `strict=` parameter | 4 | zip(range(3)) 5 | zip("a", "b") @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 8 | zip(zip("a", strict=True)) | -./resources/test/fixtures/flake8_bugbear/B905.py:4:16: B905 `zip()` without an explicit `strict=` parameter +B905.py:4:16: B905 `zip()` without an explicit `strict=` parameter | 4 | zip(range(3)) 5 | zip("a", "b") @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 8 | zip(zip("a", strict=True)) | -./resources/test/fixtures/flake8_bugbear/B905.py:5:5: B905 `zip()` without an explicit `strict=` parameter +B905.py:5:5: B905 `zip()` without an explicit `strict=` parameter | 5 | zip("a", "b") 6 | zip("a", "b", *zip("c")) @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_bugbear/mod.rs 8 | zip(zip("a", strict=True)) | -./resources/test/fixtures/flake8_bugbear/B905.py:6:1: B905 `zip()` without an explicit `strict=` parameter +B905.py:6:1: B905 `zip()` without an explicit `strict=` parameter | 6 | zip("a", "b", *zip("c")) 7 | zip(zip("a"), strict=False) diff --git a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap index 6f7150e725..8efe9b260c 100644 --- a/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap +++ b/crates/ruff/src/rules/flake8_bugbear/snapshots/ruff__rules__flake8_bugbear__tests__extend_immutable_calls.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_bugbear/mod.rs --- -./resources/test/fixtures/flake8_bugbear/B008_extended.py:19:51: B008 Do not perform function call `Depends` in argument defaults +B008_extended.py:19:51: B008 Do not perform function call `Depends` in argument defaults | 19 | def error_due_to_missing_import(data: List[str] = Depends(None)): | ^^^^^^^^^^^^^ B008 diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap index 5a410b95da..41016ae017 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_builtins/mod.rs --- -./resources/test/fixtures/flake8_builtins/A001.py:1:1: A001 Variable `sum` is shadowing a python builtin +A001.py:1:1: A001 Variable `sum` is shadowing a python builtin | 1 | import some as sum | ^^^^^^^^^^^^^^^^^^ A001 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 3 | from directory import new as dir | -./resources/test/fixtures/flake8_builtins/A001.py:2:1: A001 Variable `int` is shadowing a python builtin +A001.py:2:1: A001 Variable `int` is shadowing a python builtin | 2 | import some as sum 3 | from some import other as int @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 4 | from directory import new as dir | -./resources/test/fixtures/flake8_builtins/A001.py:3:1: A001 Variable `dir` is shadowing a python builtin +A001.py:3:1: A001 Variable `dir` is shadowing a python builtin | 3 | import some as sum 4 | from some import other as int @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 7 | print = 1 | -./resources/test/fixtures/flake8_builtins/A001.py:5:1: A001 Variable `print` is shadowing a python builtin +A001.py:5:1: A001 Variable `print` is shadowing a python builtin | 5 | from directory import new as dir 6 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 9 | (complex := 3) | -./resources/test/fixtures/flake8_builtins/A001.py:6:1: A001 Variable `copyright` is shadowing a python builtin +A001.py:6:1: A001 Variable `copyright` is shadowing a python builtin | 6 | print = 1 7 | copyright: 'annotation' = 2 @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 9 | float = object = 4 | -./resources/test/fixtures/flake8_builtins/A001.py:7:2: A001 Variable `complex` is shadowing a python builtin +A001.py:7:2: A001 Variable `complex` is shadowing a python builtin | 7 | print = 1 8 | copyright: 'annotation' = 2 @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | min, max = 5, 6 | -./resources/test/fixtures/flake8_builtins/A001.py:8:1: A001 Variable `float` is shadowing a python builtin +A001.py:8:1: A001 Variable `float` is shadowing a python builtin | 8 | copyright: 'annotation' = 2 9 | (complex := 3) @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | min, max = 5, 6 | -./resources/test/fixtures/flake8_builtins/A001.py:8:9: A001 Variable `object` is shadowing a python builtin +A001.py:8:9: A001 Variable `object` is shadowing a python builtin | 8 | copyright: 'annotation' = 2 9 | (complex := 3) @@ -74,7 +74,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | min, max = 5, 6 | -./resources/test/fixtures/flake8_builtins/A001.py:9:1: A001 Variable `min` is shadowing a python builtin +A001.py:9:1: A001 Variable `min` is shadowing a python builtin | 9 | (complex := 3) 10 | float = object = 4 @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 13 | id = 4 | -./resources/test/fixtures/flake8_builtins/A001.py:9:6: A001 Variable `max` is shadowing a python builtin +A001.py:9:6: A001 Variable `max` is shadowing a python builtin | 9 | (complex := 3) 10 | float = object = 4 @@ -94,7 +94,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 13 | id = 4 | -./resources/test/fixtures/flake8_builtins/A001.py:11:1: A001 Variable `id` is shadowing a python builtin +A001.py:11:1: A001 Variable `id` is shadowing a python builtin | 11 | min, max = 5, 6 12 | @@ -104,7 +104,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 15 | def bytes(): | -./resources/test/fixtures/flake8_builtins/A001.py:13:1: A001 Variable `bytes` is shadowing a python builtin +A001.py:13:1: A001 Variable `bytes` is shadowing a python builtin | 13 | id = 4 14 | @@ -115,7 +115,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 18 | class slice: | -./resources/test/fixtures/flake8_builtins/A001.py:16:1: A001 Variable `slice` is shadowing a python builtin +A001.py:16:1: A001 Variable `slice` is shadowing a python builtin | 16 | pass 17 | @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 21 | try: | -./resources/test/fixtures/flake8_builtins/A001.py:21:1: A001 Variable `ValueError` is shadowing a python builtin +A001.py:21:1: A001 Variable `ValueError` is shadowing a python builtin | 21 | try: 22 | ... @@ -137,7 +137,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 26 | for memoryview, *bytearray in []: | -./resources/test/fixtures/flake8_builtins/A001.py:24:5: A001 Variable `memoryview` is shadowing a python builtin +A001.py:24:5: A001 Variable `memoryview` is shadowing a python builtin | 24 | ... 25 | @@ -146,7 +146,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 27 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:24:18: A001 Variable `bytearray` is shadowing a python builtin +A001.py:24:18: A001 Variable `bytearray` is shadowing a python builtin | 24 | ... 25 | @@ -155,7 +155,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 27 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:27:22: A001 Variable `str` is shadowing a python builtin +A001.py:27:22: A001 Variable `str` is shadowing a python builtin | 27 | pass 28 | @@ -164,7 +164,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 30 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:27:45: A001 Variable `all` is shadowing a python builtin +A001.py:27:45: A001 Variable `all` is shadowing a python builtin | 27 | pass 28 | @@ -173,7 +173,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 30 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:27:50: A001 Variable `any` is shadowing a python builtin +A001.py:27:50: A001 Variable `any` is shadowing a python builtin | 27 | pass 28 | @@ -182,7 +182,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 30 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:30:8: A001 Variable `sum` is shadowing a python builtin +A001.py:30:8: A001 Variable `sum` is shadowing a python builtin | 30 | pass 31 | diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap index f0a560eed7..ad582d411f 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A001_A001.py_builtins_ignorelist.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_builtins/mod.rs --- -./resources/test/fixtures/flake8_builtins/A001.py:1:1: A001 Variable `sum` is shadowing a python builtin +A001.py:1:1: A001 Variable `sum` is shadowing a python builtin | 1 | import some as sum | ^^^^^^^^^^^^^^^^^^ A001 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 3 | from directory import new as dir | -./resources/test/fixtures/flake8_builtins/A001.py:2:1: A001 Variable `int` is shadowing a python builtin +A001.py:2:1: A001 Variable `int` is shadowing a python builtin | 2 | import some as sum 3 | from some import other as int @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 4 | from directory import new as dir | -./resources/test/fixtures/flake8_builtins/A001.py:5:1: A001 Variable `print` is shadowing a python builtin +A001.py:5:1: A001 Variable `print` is shadowing a python builtin | 5 | from directory import new as dir 6 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 9 | (complex := 3) | -./resources/test/fixtures/flake8_builtins/A001.py:6:1: A001 Variable `copyright` is shadowing a python builtin +A001.py:6:1: A001 Variable `copyright` is shadowing a python builtin | 6 | print = 1 7 | copyright: 'annotation' = 2 @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 9 | float = object = 4 | -./resources/test/fixtures/flake8_builtins/A001.py:7:2: A001 Variable `complex` is shadowing a python builtin +A001.py:7:2: A001 Variable `complex` is shadowing a python builtin | 7 | print = 1 8 | copyright: 'annotation' = 2 @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | min, max = 5, 6 | -./resources/test/fixtures/flake8_builtins/A001.py:8:1: A001 Variable `float` is shadowing a python builtin +A001.py:8:1: A001 Variable `float` is shadowing a python builtin | 8 | copyright: 'annotation' = 2 9 | (complex := 3) @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | min, max = 5, 6 | -./resources/test/fixtures/flake8_builtins/A001.py:8:9: A001 Variable `object` is shadowing a python builtin +A001.py:8:9: A001 Variable `object` is shadowing a python builtin | 8 | copyright: 'annotation' = 2 9 | (complex := 3) @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | min, max = 5, 6 | -./resources/test/fixtures/flake8_builtins/A001.py:9:1: A001 Variable `min` is shadowing a python builtin +A001.py:9:1: A001 Variable `min` is shadowing a python builtin | 9 | (complex := 3) 10 | float = object = 4 @@ -74,7 +74,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 13 | id = 4 | -./resources/test/fixtures/flake8_builtins/A001.py:9:6: A001 Variable `max` is shadowing a python builtin +A001.py:9:6: A001 Variable `max` is shadowing a python builtin | 9 | (complex := 3) 10 | float = object = 4 @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 13 | id = 4 | -./resources/test/fixtures/flake8_builtins/A001.py:13:1: A001 Variable `bytes` is shadowing a python builtin +A001.py:13:1: A001 Variable `bytes` is shadowing a python builtin | 13 | id = 4 14 | @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 18 | class slice: | -./resources/test/fixtures/flake8_builtins/A001.py:16:1: A001 Variable `slice` is shadowing a python builtin +A001.py:16:1: A001 Variable `slice` is shadowing a python builtin | 16 | pass 17 | @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 21 | try: | -./resources/test/fixtures/flake8_builtins/A001.py:21:1: A001 Variable `ValueError` is shadowing a python builtin +A001.py:21:1: A001 Variable `ValueError` is shadowing a python builtin | 21 | try: 22 | ... @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 26 | for memoryview, *bytearray in []: | -./resources/test/fixtures/flake8_builtins/A001.py:24:5: A001 Variable `memoryview` is shadowing a python builtin +A001.py:24:5: A001 Variable `memoryview` is shadowing a python builtin | 24 | ... 25 | @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 27 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:24:18: A001 Variable `bytearray` is shadowing a python builtin +A001.py:24:18: A001 Variable `bytearray` is shadowing a python builtin | 24 | ... 25 | @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 27 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:27:22: A001 Variable `str` is shadowing a python builtin +A001.py:27:22: A001 Variable `str` is shadowing a python builtin | 27 | pass 28 | @@ -144,7 +144,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 30 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:27:45: A001 Variable `all` is shadowing a python builtin +A001.py:27:45: A001 Variable `all` is shadowing a python builtin | 27 | pass 28 | @@ -153,7 +153,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 30 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:27:50: A001 Variable `any` is shadowing a python builtin +A001.py:27:50: A001 Variable `any` is shadowing a python builtin | 27 | pass 28 | @@ -162,7 +162,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 30 | pass | -./resources/test/fixtures/flake8_builtins/A001.py:30:8: A001 Variable `sum` is shadowing a python builtin +A001.py:30:8: A001 Variable `sum` is shadowing a python builtin | 30 | pass 31 | diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap index 63af0005d8..b89b75c589 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py.snap @@ -1,49 +1,49 @@ --- source: crates/ruff/src/rules/flake8_builtins/mod.rs --- -./resources/test/fixtures/flake8_builtins/A002.py:1:11: A002 Argument `str` is shadowing a python builtin +A002.py:1:11: A002 Argument `str` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:19: A002 Argument `type` is shadowing a python builtin +A002.py:1:19: A002 Argument `type` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:26: A002 Argument `complex` is shadowing a python builtin +A002.py:1:26: A002 Argument `complex` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:35: A002 Argument `Exception` is shadowing a python builtin +A002.py:1:35: A002 Argument `Exception` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^^^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:48: A002 Argument `getattr` is shadowing a python builtin +A002.py:1:48: A002 Argument `getattr` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:5:17: A002 Argument `bytes` is shadowing a python builtin +A002.py:5:17: A002 Argument `bytes` is shadowing a python builtin | 5 | async def func2(bytes): | ^^^^^ A002 6 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:8:17: A002 Argument `id` is shadowing a python builtin +A002.py:8:17: A002 Argument `id` is shadowing a python builtin | 8 | pass 9 | @@ -52,7 +52,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:8:21: A002 Argument `dir` is shadowing a python builtin +A002.py:8:21: A002 Argument `dir` is shadowing a python builtin | 8 | pass 9 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 11 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:11:16: A002 Argument `float` is shadowing a python builtin +A002.py:11:16: A002 Argument `float` is shadowing a python builtin | 11 | pass 12 | diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap index 96010af453..6b7bfcd612 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A002_A002.py_builtins_ignorelist.snap @@ -1,49 +1,49 @@ --- source: crates/ruff/src/rules/flake8_builtins/mod.rs --- -./resources/test/fixtures/flake8_builtins/A002.py:1:11: A002 Argument `str` is shadowing a python builtin +A002.py:1:11: A002 Argument `str` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:19: A002 Argument `type` is shadowing a python builtin +A002.py:1:19: A002 Argument `type` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:26: A002 Argument `complex` is shadowing a python builtin +A002.py:1:26: A002 Argument `complex` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:35: A002 Argument `Exception` is shadowing a python builtin +A002.py:1:35: A002 Argument `Exception` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^^^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:1:48: A002 Argument `getattr` is shadowing a python builtin +A002.py:1:48: A002 Argument `getattr` is shadowing a python builtin | 1 | def func1(str, /, type, *complex, Exception, **getattr): | ^^^^^^^ A002 2 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:5:17: A002 Argument `bytes` is shadowing a python builtin +A002.py:5:17: A002 Argument `bytes` is shadowing a python builtin | 5 | async def func2(bytes): | ^^^^^ A002 6 | pass | -./resources/test/fixtures/flake8_builtins/A002.py:11:16: A002 Argument `float` is shadowing a python builtin +A002.py:11:16: A002 Argument `float` is shadowing a python builtin | 11 | pass 12 | diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap index 2f001c2a51..e5a2304dc0 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_builtins/mod.rs --- -./resources/test/fixtures/flake8_builtins/A003.py:2:5: A003 Class attribute `ImportError` is shadowing a python builtin +A003.py:2:5: A003 Class attribute `ImportError` is shadowing a python builtin | 2 | class MyClass: 3 | ImportError = 4 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 5 | dir = "/" | -./resources/test/fixtures/flake8_builtins/A003.py:3:5: A003 Class attribute `id` is shadowing a python builtin +A003.py:3:5: A003 Class attribute `id` is shadowing a python builtin | 3 | class MyClass: 4 | ImportError = 4 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 6 | dir = "/" | -./resources/test/fixtures/flake8_builtins/A003.py:4:5: A003 Class attribute `dir` is shadowing a python builtin +A003.py:4:5: A003 Class attribute `dir` is shadowing a python builtin | 4 | ImportError = 4 5 | id = 5 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 8 | def __init__(self): | -./resources/test/fixtures/flake8_builtins/A003.py:11:5: A003 Class attribute `str` is shadowing a python builtin +A003.py:11:5: A003 Class attribute `str` is shadowing a python builtin | 11 | self.dir = "." 12 | diff --git a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap index c44dd4c790..3b91a75f92 100644 --- a/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap +++ b/crates/ruff/src/rules/flake8_builtins/snapshots/ruff__rules__flake8_builtins__tests__A003_A003.py_builtins_ignorelist.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_builtins/mod.rs --- -./resources/test/fixtures/flake8_builtins/A003.py:2:5: A003 Class attribute `ImportError` is shadowing a python builtin +A003.py:2:5: A003 Class attribute `ImportError` is shadowing a python builtin | 2 | class MyClass: 3 | ImportError = 4 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_builtins/mod.rs 5 | dir = "/" | -./resources/test/fixtures/flake8_builtins/A003.py:11:5: A003 Class attribute `str` is shadowing a python builtin +A003.py:11:5: A003 Class attribute `str` is shadowing a python builtin | 11 | self.dir = "." 12 | diff --git a/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap b/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap index 9a7b8f24d5..0089753e67 100644 --- a/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap +++ b/crates/ruff/src/rules/flake8_commas/snapshots/ruff__rules__flake8_commas__tests__COM81.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_commas/mod.rs --- -./resources/test/fixtures/flake8_commas/COM81.py:4:18: COM812 [*] Trailing comma missing +COM81.py:4:18: COM812 [*] Trailing comma missing | 4 | bad_function_call( 5 | param1='test', @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 6 6 | # ==> bad_list.py <== 7 7 | bad_list = [ -./resources/test/fixtures/flake8_commas/COM81.py:10:6: COM812 [*] Trailing comma missing +COM81.py:10:6: COM812 [*] Trailing comma missing | 10 | 1, 11 | 2, @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 12 12 | 13 13 | bad_list_with_comment = [ -./resources/test/fixtures/flake8_commas/COM81.py:16:6: COM812 [*] Trailing comma missing +COM81.py:16:6: COM812 [*] Trailing comma missing | 16 | 1, 17 | 2, @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 18 18 | ] 19 19 | -./resources/test/fixtures/flake8_commas/COM81.py:23:6: COM812 [*] Trailing comma missing +COM81.py:23:6: COM812 [*] Trailing comma missing | 23 | 1, 24 | 2, @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 25 25 | 26 26 | -./resources/test/fixtures/flake8_commas/COM81.py:36:8: COM818 Trailing comma on bare tuple prohibited +COM81.py:36:8: COM818 Trailing comma on bare tuple prohibited | 36 | foo = (1,) 37 | @@ -92,7 +92,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 40 | bar = 1; foo = bar, | -./resources/test/fixtures/flake8_commas/COM81.py:38:19: COM818 Trailing comma on bare tuple prohibited +COM81.py:38:19: COM818 Trailing comma on bare tuple prohibited | 38 | foo = 1, 39 | @@ -102,7 +102,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 42 | foo = ( | -./resources/test/fixtures/flake8_commas/COM81.py:45:8: COM818 Trailing comma on bare tuple prohibited +COM81.py:45:8: COM818 Trailing comma on bare tuple prohibited | 45 | ) 46 | @@ -112,7 +112,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 49 | class A(object): | -./resources/test/fixtures/flake8_commas/COM81.py:49:10: COM818 Trailing comma on bare tuple prohibited +COM81.py:49:10: COM818 Trailing comma on bare tuple prohibited | 49 | class A(object): 50 | foo = 3 @@ -121,7 +121,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 52 | foo_bar = 2 | -./resources/test/fixtures/flake8_commas/COM81.py:56:32: COM818 Trailing comma on bare tuple prohibited +COM81.py:56:32: COM818 Trailing comma on bare tuple prohibited | 56 | from foo import bar, baz 57 | @@ -131,7 +131,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 60 | group_by = ('foobar' * 3), | -./resources/test/fixtures/flake8_commas/COM81.py:58:26: COM818 Trailing comma on bare tuple prohibited +COM81.py:58:26: COM818 Trailing comma on bare tuple prohibited | 58 | group_by = function_call('arg'), 59 | @@ -141,7 +141,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 62 | def foo(): | -./resources/test/fixtures/flake8_commas/COM81.py:61:17: COM818 Trailing comma on bare tuple prohibited +COM81.py:61:17: COM818 Trailing comma on bare tuple prohibited | 61 | def foo(): 62 | return False, @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 64 | # ==> callable_before_parenth_form.py <== | -./resources/test/fixtures/flake8_commas/COM81.py:70:8: COM812 [*] Trailing comma missing +COM81.py:70:8: COM812 [*] Trailing comma missing | 70 | {'foo': foo}['foo']( 71 | bar @@ -169,7 +169,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 72 72 | 73 73 | {'foo': foo}['foo']( -./resources/test/fixtures/flake8_commas/COM81.py:78:8: COM812 [*] Trailing comma missing +COM81.py:78:8: COM812 [*] Trailing comma missing | 78 | (foo)( 79 | bar @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 80 80 | 81 81 | (foo)[0]( -./resources/test/fixtures/flake8_commas/COM81.py:86:8: COM812 [*] Trailing comma missing +COM81.py:86:8: COM812 [*] Trailing comma missing | 86 | [foo][0]( 87 | bar @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 88 88 | 89 89 | [foo][0]( -./resources/test/fixtures/flake8_commas/COM81.py:152:6: COM812 [*] Trailing comma missing +COM81.py:152:6: COM812 [*] Trailing comma missing | 152 | # ==> keyword_before_parenth_form/base_bad.py <== 153 | from x import ( @@ -227,7 +227,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 154 154 | 155 155 | assert( -./resources/test/fixtures/flake8_commas/COM81.py:158:11: COM812 [*] Trailing comma missing +COM81.py:158:11: COM812 [*] Trailing comma missing | 158 | SyntaxWarning, 159 | ThrownHere, @@ -247,7 +247,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 160 160 | 161 161 | # async await is fine outside an async def -./resources/test/fixtures/flake8_commas/COM81.py:293:15: COM812 [*] Trailing comma missing +COM81.py:293:15: COM812 [*] Trailing comma missing | 293 | # ==> multiline_bad_dict.py <== 294 | multiline_bad_dict = { @@ -268,7 +268,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 295 295 | # ==> multiline_bad_function_def.py <== 296 296 | def func_good( -./resources/test/fixtures/flake8_commas/COM81.py:304:14: COM812 [*] Trailing comma missing +COM81.py:304:14: COM812 [*] Trailing comma missing | 304 | def func_bad( 305 | a = 3, @@ -289,7 +289,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 306 306 | pass 307 307 | -./resources/test/fixtures/flake8_commas/COM81.py:310:14: COM812 [*] Trailing comma missing +COM81.py:310:14: COM812 [*] Trailing comma missing | 310 | # ==> multiline_bad_function_one_param.py <== 311 | def func( @@ -310,7 +310,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 312 312 | pass 313 313 | -./resources/test/fixtures/flake8_commas/COM81.py:316:10: COM812 [*] Trailing comma missing +COM81.py:316:10: COM812 [*] Trailing comma missing | 316 | func( 317 | a = 3 @@ -329,7 +329,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 318 318 | 319 319 | # ==> multiline_bad_or_dict.py <== -./resources/test/fixtures/flake8_commas/COM81.py:322:15: COM812 [*] Trailing comma missing +COM81.py:322:15: COM812 [*] Trailing comma missing | 322 | multiline_bad_or_dict = { 323 | "good": True or False, @@ -349,7 +349,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 324 324 | 325 325 | # ==> multiline_good_dict.py <== -./resources/test/fixtures/flake8_commas/COM81.py:368:15: COM812 [*] Trailing comma missing +COM81.py:368:15: COM812 [*] Trailing comma missing | 368 | multiline_index_access[ 369 | "probably fine", @@ -369,7 +369,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 370 370 | 371 371 | multiline_index_access[ -./resources/test/fixtures/flake8_commas/COM81.py:375:15: COM812 [*] Trailing comma missing +COM81.py:375:15: COM812 [*] Trailing comma missing | 375 | "fine", 376 | : @@ -389,7 +389,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 377 377 | 378 378 | # ==> multiline_string.py <== -./resources/test/fixtures/flake8_commas/COM81.py:404:15: COM812 [*] Trailing comma missing +COM81.py:404:15: COM812 [*] Trailing comma missing | 404 | "fine" 405 | : @@ -409,7 +409,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 406 406 | 407 407 | multiline_index_access[ -./resources/test/fixtures/flake8_commas/COM81.py:432:15: COM812 [*] Trailing comma missing +COM81.py:432:15: COM812 [*] Trailing comma missing | 432 | : 433 | "fine", @@ -429,7 +429,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 434 434 | 435 435 | multiline_index_access[ -./resources/test/fixtures/flake8_commas/COM81.py:485:21: COM819 [*] Trailing comma prohibited +COM81.py:485:21: COM819 [*] Trailing comma prohibited | 485 | # ==> prohibited.py <== 486 | foo = ['a', 'b', 'c',] @@ -449,7 +449,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 487 487 | bar = { a: b,} 488 488 | -./resources/test/fixtures/flake8_commas/COM81.py:487:13: COM819 [*] Trailing comma prohibited +COM81.py:487:13: COM819 [*] Trailing comma prohibited | 487 | foo = ['a', 'b', 'c',] 488 | @@ -470,7 +470,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 489 489 | def bah(ham, spam,): 490 490 | pass -./resources/test/fixtures/flake8_commas/COM81.py:489:18: COM819 [*] Trailing comma prohibited +COM81.py:489:18: COM819 [*] Trailing comma prohibited | 489 | bar = { a: b,} 490 | @@ -490,7 +490,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 491 491 | 492 492 | (0,) -./resources/test/fixtures/flake8_commas/COM81.py:494:6: COM819 [*] Trailing comma prohibited +COM81.py:494:6: COM819 [*] Trailing comma prohibited | 494 | (0,) 495 | @@ -511,7 +511,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 496 496 | foo = ['a', 'b', 'c', ] 497 497 | -./resources/test/fixtures/flake8_commas/COM81.py:496:21: COM819 [*] Trailing comma prohibited +COM81.py:496:21: COM819 [*] Trailing comma prohibited | 496 | (0, 1,) 497 | @@ -532,7 +532,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 498 498 | bar = { a: b, } 499 499 | -./resources/test/fixtures/flake8_commas/COM81.py:498:13: COM819 [*] Trailing comma prohibited +COM81.py:498:13: COM819 [*] Trailing comma prohibited | 498 | foo = ['a', 'b', 'c', ] 499 | @@ -553,7 +553,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 500 500 | def bah(ham, spam, ): 501 501 | pass -./resources/test/fixtures/flake8_commas/COM81.py:500:18: COM819 [*] Trailing comma prohibited +COM81.py:500:18: COM819 [*] Trailing comma prohibited | 500 | bar = { a: b, } 501 | @@ -573,7 +573,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 502 502 | 503 503 | (0, ) -./resources/test/fixtures/flake8_commas/COM81.py:505:6: COM819 [*] Trailing comma prohibited +COM81.py:505:6: COM819 [*] Trailing comma prohibited | 505 | (0, ) 506 | @@ -594,7 +594,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 507 507 | image[:, :, 0] 508 508 | -./resources/test/fixtures/flake8_commas/COM81.py:511:10: COM819 [*] Trailing comma prohibited +COM81.py:511:10: COM819 [*] Trailing comma prohibited | 511 | image[:,] 512 | @@ -615,7 +615,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 513 513 | lambda x, : 514 514 | -./resources/test/fixtures/flake8_commas/COM81.py:513:9: COM819 [*] Trailing comma prohibited +COM81.py:513:9: COM819 [*] Trailing comma prohibited | 513 | image[:,:,] 514 | @@ -636,7 +636,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 515 515 | # ==> unpack.py <== 516 516 | def function( -./resources/test/fixtures/flake8_commas/COM81.py:519:13: COM812 [*] Trailing comma missing +COM81.py:519:13: COM812 [*] Trailing comma missing | 519 | foo, 520 | bar, @@ -657,7 +657,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 521 521 | pass 522 522 | -./resources/test/fixtures/flake8_commas/COM81.py:526:10: COM812 [*] Trailing comma missing +COM81.py:526:10: COM812 [*] Trailing comma missing | 526 | foo, 527 | bar, @@ -678,7 +678,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 528 528 | pass 529 529 | -./resources/test/fixtures/flake8_commas/COM81.py:534:16: COM812 [*] Trailing comma missing +COM81.py:534:16: COM812 [*] Trailing comma missing | 534 | bar, 535 | *args, @@ -699,7 +699,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 536 536 | pass 537 537 | -./resources/test/fixtures/flake8_commas/COM81.py:541:13: COM812 [*] Trailing comma missing +COM81.py:541:13: COM812 [*] Trailing comma missing | 541 | foo, 542 | bar, @@ -719,7 +719,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 543 543 | 544 544 | result = function( -./resources/test/fixtures/flake8_commas/COM81.py:547:24: COM812 [*] Trailing comma missing +COM81.py:547:24: COM812 [*] Trailing comma missing | 547 | foo, 548 | bar, @@ -739,7 +739,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 549 549 | 550 550 | def foo( -./resources/test/fixtures/flake8_commas/COM81.py:554:15: COM812 [*] Trailing comma missing +COM81.py:554:15: COM812 [*] Trailing comma missing | 554 | spam, 555 | *args, @@ -760,7 +760,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 556 556 | pass 557 557 | -./resources/test/fixtures/flake8_commas/COM81.py:561:13: COM812 [*] Trailing comma missing +COM81.py:561:13: COM812 [*] Trailing comma missing | 561 | foo( 562 | **kwargs @@ -779,7 +779,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 563 563 | 564 564 | { -./resources/test/fixtures/flake8_commas/COM81.py:565:13: COM812 [*] Trailing comma missing +COM81.py:565:13: COM812 [*] Trailing comma missing | 565 | { 566 | **kwargs @@ -798,7 +798,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 567 567 | 568 568 | ( -./resources/test/fixtures/flake8_commas/COM81.py:573:10: COM812 [*] Trailing comma missing +COM81.py:573:10: COM812 [*] Trailing comma missing | 573 | { 574 | *args @@ -817,7 +817,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 575 575 | 576 576 | [ -./resources/test/fixtures/flake8_commas/COM81.py:577:10: COM812 [*] Trailing comma missing +COM81.py:577:10: COM812 [*] Trailing comma missing | 577 | [ 578 | *args @@ -836,7 +836,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 579 579 | 580 580 | def foo( -./resources/test/fixtures/flake8_commas/COM81.py:583:10: COM812 [*] Trailing comma missing +COM81.py:583:10: COM812 [*] Trailing comma missing | 583 | ham, 584 | spam, @@ -857,7 +857,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 585 585 | pass 586 586 | -./resources/test/fixtures/flake8_commas/COM81.py:590:13: COM812 [*] Trailing comma missing +COM81.py:590:13: COM812 [*] Trailing comma missing | 590 | ham, 591 | spam, @@ -878,7 +878,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 592 592 | pass 593 593 | -./resources/test/fixtures/flake8_commas/COM81.py:598:15: COM812 [*] Trailing comma missing +COM81.py:598:15: COM812 [*] Trailing comma missing | 598 | spam, 599 | *args, @@ -899,7 +899,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 600 600 | pass 601 601 | -./resources/test/fixtures/flake8_commas/COM81.py:627:20: COM812 [*] Trailing comma missing +COM81.py:627:20: COM812 [*] Trailing comma missing | 627 | foo, 628 | bar, @@ -919,7 +919,7 @@ source: crates/ruff/src/rules/flake8_commas/mod.rs 629 629 | 630 630 | # Make sure the COM812 and UP034 rules don't autofix simultaneously and cause a syntax error. -./resources/test/fixtures/flake8_commas/COM81.py:632:42: COM812 [*] Trailing comma missing +COM81.py:632:42: COM812 [*] Trailing comma missing | 632 | # Make sure the COM812 and UP034 rules don't autofix simultaneously and cause a syntax error. 633 | the_first_one = next( diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap index 5fe6ce08ff..30135ecc0c 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C400_C400.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C400.py:1:5: C400 [*] Unnecessary generator (rewrite as a `list` comprehension) +C400.py:1:5: C400 [*] Unnecessary generator (rewrite as a `list` comprehension) | 1 | x = list(x for x in range(3)) | ^^^^^^^^^^^^^^^^^^^^^^^^^ C400 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | x for x in range(3) 4 4 | ) -./resources/test/fixtures/flake8_comprehensions/C400.py:2:5: C400 [*] Unnecessary generator (rewrite as a `list` comprehension) +C400.py:2:5: C400 [*] Unnecessary generator (rewrite as a `list` comprehension) | 2 | x = list(x for x in range(3)) 3 | x = list( diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap index b8edb42be4..57831d19de 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C401_C401.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C401.py:1:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:1:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) | 1 | x = set(x for x in range(3)) | ^^^^^^^^^^^^^^^^^^^^^^^^ C401 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | x for x in range(3) 4 4 | ) -./resources/test/fixtures/flake8_comprehensions/C401.py:2:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:2:5: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) | 2 | x = set(x for x in range(3)) 3 | x = set( @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 6 6 | _ = '{}'.format(set(a if a < 6 else 0 for a in range(3))) 7 7 | print(f'Hello {set(a for a in range(3))} World') -./resources/test/fixtures/flake8_comprehensions/C401.py:5:8: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:5:8: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) | 5 | x for x in range(3) 6 | ) @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 7 7 | print(f'Hello {set(a for a in range(3))} World') 8 8 | -./resources/test/fixtures/flake8_comprehensions/C401.py:6:17: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:6:17: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) | 6 | ) 7 | y = f'{set(a if a < 6 else 0 for a in range(3))}' @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 8 8 | 9 9 | def set(*args, **kwargs): -./resources/test/fixtures/flake8_comprehensions/C401.py:7:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) +C401.py:7:16: C401 [*] Unnecessary generator (rewrite as a `set` comprehension) | 7 | y = f'{set(a if a < 6 else 0 for a in range(3))}' 8 | _ = '{}'.format(set(a if a < 6 else 0 for a in range(3))) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap index 9f96674b9a..4f128f605f 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C402_C402.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C402.py:1:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:1:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) | 1 | dict((x, x) for x in range(3)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C402 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | (x, x) for x in range(3) 4 4 | ) -./resources/test/fixtures/flake8_comprehensions/C402.py:2:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:2:1: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) | 2 | dict((x, x) for x in range(3)) 3 | / dict( @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 6 6 | y = f'{dict((x, x) for x in range(3))}' 7 7 | print(f'Hello {dict((x, x) for x in range(3))} World') -./resources/test/fixtures/flake8_comprehensions/C402.py:6:8: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:6:8: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) | 6 | ) 7 | dict(((x, x) for x in range(3)), z=3) @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 6 |+y = f'{ {x: x for x in range(3)} }' 7 7 | print(f'Hello {dict((x, x) for x in range(3))} World') -./resources/test/fixtures/flake8_comprehensions/C402.py:7:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) +C402.py:7:16: C402 [*] Unnecessary generator (rewrite as a `dict` comprehension) | 7 | dict(((x, x) for x in range(3)), z=3) 8 | y = f'{dict((x, x) for x in range(3))}' diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap index d7b3798dcc..67c8138474 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C403_C403.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C403.py:1:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:1:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 1 | s = set([x for x in range(3)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ C403 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | [x for x in range(3)] 4 4 | ) -./resources/test/fixtures/flake8_comprehensions/C403.py:2:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) +C403.py:2:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension) | 2 | s = set([x for x in range(3)]) 3 | s = set( diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap index 978395203c..c8a543333b 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C404_C404.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C404.py:1:1: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) +C404.py:1:1: C404 [*] Unnecessary `list` comprehension (rewrite as a `dict` comprehension) | 1 | dict([(i, i) for i in range(3)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C404 diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap index a3a930cf35..e418bb820e 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C405_C405.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C405.py:1:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:1:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) | 1 | set([1, 2]) | ^^^^^^^^^^^ C405 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | set([]) 4 4 | set(()) -./resources/test/fixtures/flake8_comprehensions/C405.py:2:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:2:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) | 2 | set([1, 2]) 3 | set((1, 2)) @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 4 4 | set(()) 5 5 | set() -./resources/test/fixtures/flake8_comprehensions/C405.py:3:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:3:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) | 3 | set([1, 2]) 4 | set((1, 2)) @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 5 5 | set() 6 6 | set((1,)) -./resources/test/fixtures/flake8_comprehensions/C405.py:4:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:4:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) | 4 | set((1, 2)) 5 | set([]) @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 7 7 | set(( 8 8 | 1, -./resources/test/fixtures/flake8_comprehensions/C405.py:6:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:6:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) | 6 | set(()) 7 | set() @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 8 8 | 1, 9 9 | )) -./resources/test/fixtures/flake8_comprehensions/C405.py:7:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:7:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) | 7 | set() 8 | set((1,)) @@ -124,7 +124,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 11 11 | 1, 12 12 | ]) -./resources/test/fixtures/flake8_comprehensions/C405.py:10:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:10:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) | 10 | 1, 11 | )) @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 14 14 | (1,) 15 15 | ) -./resources/test/fixtures/flake8_comprehensions/C405.py:13:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) +C405.py:13:1: C405 [*] Unnecessary `tuple` literal (rewrite as a `set` literal) | 13 | 1, 14 | ]) @@ -175,7 +175,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 17 15 | [1,] 18 16 | ) -./resources/test/fixtures/flake8_comprehensions/C405.py:16:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) +C405.py:16:1: C405 [*] Unnecessary `list` literal (rewrite as a `set` literal) | 16 | (1,) 17 | ) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap index 1f99fa9a8a..51e4ed1531 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C406_C406.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C406.py:1:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) +C406.py:1:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) | 1 | d1 = dict([(1, 2)]) | ^^^^^^^^^^^^^^ C406 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | d3 = dict([]) 4 4 | d4 = dict(()) -./resources/test/fixtures/flake8_comprehensions/C406.py:2:6: C406 [*] Unnecessary `tuple` literal (rewrite as a `dict` literal) +C406.py:2:6: C406 [*] Unnecessary `tuple` literal (rewrite as a `dict` literal) | 2 | d1 = dict([(1, 2)]) 3 | d2 = dict(((1, 2),)) @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 4 4 | d4 = dict(()) 5 5 | d5 = dict() -./resources/test/fixtures/flake8_comprehensions/C406.py:3:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) +C406.py:3:6: C406 [*] Unnecessary `list` literal (rewrite as a `dict` literal) | 3 | d1 = dict([(1, 2)]) 4 | d2 = dict(((1, 2),)) @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 4 4 | d4 = dict(()) 5 5 | d5 = dict() -./resources/test/fixtures/flake8_comprehensions/C406.py:4:6: C406 [*] Unnecessary `tuple` literal (rewrite as a `dict` literal) +C406.py:4:6: C406 [*] Unnecessary `tuple` literal (rewrite as a `dict` literal) | 4 | d2 = dict(((1, 2),)) 5 | d3 = dict([]) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap index dd335a4a35..178c4fef39 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) +C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) | 1 | t = tuple() | ^^^^^^^ C408 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | d1 = dict() 4 4 | d2 = dict(a=1) -./resources/test/fixtures/flake8_comprehensions/C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) +C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) | 2 | t = tuple() 3 | l = list() @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 4 4 | d2 = dict(a=1) 5 5 | d3 = dict(**d2) -./resources/test/fixtures/flake8_comprehensions/C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) | 3 | t = tuple() 4 | l = list() @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 5 5 | d3 = dict(**d2) 6 6 | -./resources/test/fixtures/flake8_comprehensions/C408.py:4:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:4:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) | 4 | l = list() 5 | d1 = dict() diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap index f36eac7cee..561f619280 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C408_C408.py_allow_dict_calls_with_keyword_arguments.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) +C408.py:1:5: C408 [*] Unnecessary `tuple` call (rewrite as a literal) | 1 | t = tuple() | ^^^^^^^ C408 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | d1 = dict() 4 4 | d2 = dict(a=1) -./resources/test/fixtures/flake8_comprehensions/C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) +C408.py:2:5: C408 [*] Unnecessary `list` call (rewrite as a literal) | 2 | t = tuple() 3 | l = list() @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 4 4 | d2 = dict(a=1) 5 5 | d3 = dict(**d2) -./resources/test/fixtures/flake8_comprehensions/C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) +C408.py:3:6: C408 [*] Unnecessary `dict` call (rewrite as a literal) | 3 | t = tuple() 4 | l = list() diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap index f4cfacc44f..56394c6ce2 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C409_C409.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C409.py:1:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) +C409.py:1:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) | 1 | t1 = tuple([]) | ^^^^^^^^^ C409 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | t3 = tuple((1, 2)) 4 4 | t4 = tuple([ -./resources/test/fixtures/flake8_comprehensions/C409.py:2:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) +C409.py:2:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) | 2 | t1 = tuple([]) 3 | t2 = tuple([1, 2]) @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 4 4 | t4 = tuple([ 5 5 | 1, -./resources/test/fixtures/flake8_comprehensions/C409.py:3:6: C409 [*] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) +C409.py:3:6: C409 [*] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) | 3 | t1 = tuple([]) 4 | t2 = tuple([1, 2]) @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 5 5 | 1, 6 6 | 2 -./resources/test/fixtures/flake8_comprehensions/C409.py:4:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) +C409.py:4:6: C409 [*] Unnecessary `list` literal passed to `tuple()` (rewrite as a `tuple` literal) | 4 | t2 = tuple([1, 2]) 5 | t3 = tuple((1, 2)) @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 9 9 | (1, 2) 10 10 | ) -./resources/test/fixtures/flake8_comprehensions/C409.py:8:6: C409 [*] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) +C409.py:8:6: C409 [*] Unnecessary `tuple` literal passed to `tuple()` (remove the outer call to `tuple()`) | 8 | 2 9 | ]) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap index ecb395264f..9d16934994 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C410_C410.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C410.py:1:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) +C410.py:1:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) | 1 | l1 = list([1, 2]) | ^^^^^^^^^^^^ C410 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | l3 = list([]) 4 4 | l4 = list(()) -./resources/test/fixtures/flake8_comprehensions/C410.py:2:6: C410 [*] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) +C410.py:2:6: C410 [*] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) | 2 | l1 = list([1, 2]) 3 | l2 = list((1, 2)) @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 3 | l3 = list([]) 4 4 | l4 = list(()) -./resources/test/fixtures/flake8_comprehensions/C410.py:3:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) +C410.py:3:6: C410 [*] Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`) | 3 | l1 = list([1, 2]) 4 | l2 = list((1, 2)) @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 3 |+l3 = [] 4 4 | l4 = list(()) -./resources/test/fixtures/flake8_comprehensions/C410.py:4:6: C410 [*] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) +C410.py:4:6: C410 [*] Unnecessary `tuple` literal passed to `list()` (rewrite as a `list` literal) | 4 | l2 = list((1, 2)) 5 | l3 = list([]) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap index d6d3323f5f..1145049f63 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C411_C411.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C411.py:2:1: C411 [*] Unnecessary `list` call (remove the outer call to `list()`) +C411.py:2:1: C411 [*] Unnecessary `list` call (remove the outer call to `list()`) | 2 | x = [1, 2, 3] 3 | list([i for i in x]) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap index e221f1070d..84cf1eaf9a 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C413_C413.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C413.py:3:1: C413 [*] Unnecessary `list` call around `sorted()` +C413.py:3:1: C413 [*] Unnecessary `list` call around `sorted()` | 3 | x = [2, 3, 1] 4 | list(x) @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 5 5 | reversed(sorted(x, key=lambda e: e)) 6 6 | reversed(sorted(x, reverse=True)) -./resources/test/fixtures/flake8_comprehensions/C413.py:4:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:4:1: C413 [*] Unnecessary `reversed` call around `sorted()` | 4 | list(x) 5 | list(sorted(x)) @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 6 6 | reversed(sorted(x, reverse=True)) 7 7 | reversed(sorted(x, key=lambda e: e, reverse=True)) -./resources/test/fixtures/flake8_comprehensions/C413.py:5:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:5:1: C413 [*] Unnecessary `reversed` call around `sorted()` | 5 | list(sorted(x)) 6 | reversed(sorted(x)) @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 7 7 | reversed(sorted(x, key=lambda e: e, reverse=True)) 8 8 | reversed(sorted(x, reverse=True, key=lambda e: e)) -./resources/test/fixtures/flake8_comprehensions/C413.py:6:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:6:1: C413 [*] Unnecessary `reversed` call around `sorted()` | 6 | reversed(sorted(x)) 7 | reversed(sorted(x, key=lambda e: e)) @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 8 8 | reversed(sorted(x, reverse=True, key=lambda e: e)) 9 9 | reversed(sorted(x, reverse=False)) -./resources/test/fixtures/flake8_comprehensions/C413.py:7:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:7:1: C413 [*] Unnecessary `reversed` call around `sorted()` | 7 | reversed(sorted(x, key=lambda e: e)) 8 | reversed(sorted(x, reverse=True)) @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 9 9 | reversed(sorted(x, reverse=False)) 10 10 | -./resources/test/fixtures/flake8_comprehensions/C413.py:8:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:8:1: C413 [*] Unnecessary `reversed` call around `sorted()` | 8 | reversed(sorted(x, reverse=True)) 9 | reversed(sorted(x, key=lambda e: e, reverse=True)) @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 10 10 | 11 11 | def reversed(*args, **kwargs): -./resources/test/fixtures/flake8_comprehensions/C413.py:9:1: C413 [*] Unnecessary `reversed` call around `sorted()` +C413.py:9:1: C413 [*] Unnecessary `reversed` call around `sorted()` | 9 | reversed(sorted(x, key=lambda e: e, reverse=True)) 10 | reversed(sorted(x, reverse=True, key=lambda e: e)) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap index b31fc20437..f022c3ae18 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C414_C414.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C414.py:2:1: C414 [*] Unnecessary `list` call within `list()` +C414.py:2:1: C414 [*] Unnecessary `list` call within `list()` | 2 | x = [1, 2, 3] 3 | list(list(x)) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 4 4 | tuple(list(x)) 5 5 | tuple(tuple(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:3:1: C414 [*] Unnecessary `tuple` call within `list()` +C414.py:3:1: C414 [*] Unnecessary `tuple` call within `list()` | 3 | x = [1, 2, 3] 4 | list(list(x)) @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 5 5 | tuple(tuple(x)) 6 6 | set(set(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:4:1: C414 [*] Unnecessary `list` call within `tuple()` +C414.py:4:1: C414 [*] Unnecessary `list` call within `tuple()` | 4 | list(list(x)) 5 | list(tuple(x)) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 6 6 | set(set(x)) 7 7 | set(list(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:5:1: C414 [*] Unnecessary `tuple` call within `tuple()` +C414.py:5:1: C414 [*] Unnecessary `tuple` call within `tuple()` | 5 | list(tuple(x)) 6 | tuple(list(x)) @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 7 7 | set(list(x)) 8 8 | set(tuple(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:6:1: C414 [*] Unnecessary `set` call within `set()` +C414.py:6:1: C414 [*] Unnecessary `set` call within `set()` | 6 | tuple(list(x)) 7 | tuple(tuple(x)) @@ -102,7 +102,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 8 8 | set(tuple(x)) 9 9 | set(sorted(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:7:1: C414 [*] Unnecessary `list` call within `set()` +C414.py:7:1: C414 [*] Unnecessary `list` call within `set()` | 7 | tuple(tuple(x)) 8 | set(set(x)) @@ -123,7 +123,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 9 9 | set(sorted(x)) 10 10 | set(sorted(x, key=lambda y: y)) -./resources/test/fixtures/flake8_comprehensions/C414.py:8:1: C414 [*] Unnecessary `tuple` call within `set()` +C414.py:8:1: C414 [*] Unnecessary `tuple` call within `set()` | 8 | set(set(x)) 9 | set(list(x)) @@ -144,7 +144,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 10 10 | set(sorted(x, key=lambda y: y)) 11 11 | set(reversed(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:9:1: C414 [*] Unnecessary `sorted` call within `set()` +C414.py:9:1: C414 [*] Unnecessary `sorted` call within `set()` | 9 | set(list(x)) 10 | set(tuple(x)) @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 11 11 | set(reversed(x)) 12 12 | sorted(list(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:10:1: C414 [*] Unnecessary `sorted` call within `set()` +C414.py:10:1: C414 [*] Unnecessary `sorted` call within `set()` | 10 | set(tuple(x)) 11 | set(sorted(x)) @@ -186,7 +186,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 12 12 | sorted(list(x)) 13 13 | sorted(tuple(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:11:1: C414 [*] Unnecessary `reversed` call within `set()` +C414.py:11:1: C414 [*] Unnecessary `reversed` call within `set()` | 11 | set(sorted(x)) 12 | set(sorted(x, key=lambda y: y)) @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 13 13 | sorted(tuple(x)) 14 14 | sorted(sorted(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:12:1: C414 [*] Unnecessary `list` call within `sorted()` +C414.py:12:1: C414 [*] Unnecessary `list` call within `sorted()` | 12 | set(sorted(x, key=lambda y: y)) 13 | set(reversed(x)) @@ -228,7 +228,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 14 14 | sorted(sorted(x)) 15 15 | sorted(sorted(x, key=lambda y: y)) -./resources/test/fixtures/flake8_comprehensions/C414.py:13:1: C414 [*] Unnecessary `tuple` call within `sorted()` +C414.py:13:1: C414 [*] Unnecessary `tuple` call within `sorted()` | 13 | set(reversed(x)) 14 | sorted(list(x)) @@ -249,7 +249,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 15 15 | sorted(sorted(x, key=lambda y: y)) 16 16 | sorted(reversed(x)) -./resources/test/fixtures/flake8_comprehensions/C414.py:14:1: C414 [*] Unnecessary `sorted` call within `sorted()` +C414.py:14:1: C414 [*] Unnecessary `sorted` call within `sorted()` | 14 | sorted(list(x)) 15 | sorted(tuple(x)) @@ -270,7 +270,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 16 16 | sorted(reversed(x)) 17 17 | sorted(list(x), key=lambda y: y) -./resources/test/fixtures/flake8_comprehensions/C414.py:15:1: C414 [*] Unnecessary `sorted` call within `sorted()` +C414.py:15:1: C414 [*] Unnecessary `sorted` call within `sorted()` | 15 | sorted(tuple(x)) 16 | sorted(sorted(x)) @@ -291,7 +291,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 17 17 | sorted(list(x), key=lambda y: y) 18 18 | tuple( -./resources/test/fixtures/flake8_comprehensions/C414.py:16:1: C414 [*] Unnecessary `reversed` call within `sorted()` +C414.py:16:1: C414 [*] Unnecessary `reversed` call within `sorted()` | 16 | sorted(sorted(x)) 17 | sorted(sorted(x, key=lambda y: y)) @@ -312,7 +312,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 18 18 | tuple( 19 19 | list( -./resources/test/fixtures/flake8_comprehensions/C414.py:17:1: C414 [*] Unnecessary `list` call within `sorted()` +C414.py:17:1: C414 [*] Unnecessary `list` call within `sorted()` | 17 | sorted(sorted(x, key=lambda y: y)) 18 | sorted(reversed(x)) @@ -333,7 +333,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 19 19 | list( 20 20 | [x, 3, "hell"\ -./resources/test/fixtures/flake8_comprehensions/C414.py:18:1: C414 [*] Unnecessary `list` call within `tuple()` +C414.py:18:1: C414 [*] Unnecessary `list` call within `tuple()` | 18 | sorted(reversed(x)) 19 | sorted(list(x), key=lambda y: y) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap index e483f1061c..d42e845e70 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C415_C415.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C415.py:2:5: C415 Unnecessary subscript reversal of iterable within `set()` +C415.py:2:5: C415 Unnecessary subscript reversal of iterable within `set()` | 2 | lst = [2, 1, 3] 3 | a = set(lst[::-1]) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 5 | c = sorted(lst[::-1]) | -./resources/test/fixtures/flake8_comprehensions/C415.py:3:5: C415 Unnecessary subscript reversal of iterable within `reversed()` +C415.py:3:5: C415 Unnecessary subscript reversal of iterable within `reversed()` | 3 | lst = [2, 1, 3] 4 | a = set(lst[::-1]) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 7 | d = sorted(lst[::-1], reverse=True) | -./resources/test/fixtures/flake8_comprehensions/C415.py:4:5: C415 Unnecessary subscript reversal of iterable within `sorted()` +C415.py:4:5: C415 Unnecessary subscript reversal of iterable within `sorted()` | 4 | a = set(lst[::-1]) 5 | b = reversed(lst[::-1]) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 8 | e = set(lst[2:-1]) | -./resources/test/fixtures/flake8_comprehensions/C415.py:5:5: C415 Unnecessary subscript reversal of iterable within `sorted()` +C415.py:5:5: C415 Unnecessary subscript reversal of iterable within `sorted()` | 5 | b = reversed(lst[::-1]) 6 | c = sorted(lst[::-1]) diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap index 69668b9845..245255ca15 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C416_C416.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C416.py:6:1: C416 [*] Unnecessary `list` comprehension (rewrite using `list()`) +C416.py:6:1: C416 [*] Unnecessary `list` comprehension (rewrite using `list()`) | 6 | d = {"a": 1, "b": 2, "c": 3} 7 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 8 8 | {k: v for k, v in y} 9 9 | {k: v for k, v in d.items()} -./resources/test/fixtures/flake8_comprehensions/C416.py:7:1: C416 [*] Unnecessary `set` comprehension (rewrite using `set()`) +C416.py:7:1: C416 [*] Unnecessary `set` comprehension (rewrite using `set()`) | 7 | [i for i in x] 8 | {i for i in x} @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 9 9 | {k: v for k, v in d.items()} 10 10 | -./resources/test/fixtures/flake8_comprehensions/C416.py:8:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) +C416.py:8:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) | 8 | [i for i in x] 9 | {i for i in x} @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 10 10 | 11 11 | [i for i, in z] -./resources/test/fixtures/flake8_comprehensions/C416.py:9:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) +C416.py:9:1: C416 [*] Unnecessary `dict` comprehension (rewrite using `dict()`) | 9 | {i for i in x} 10 | {k: v for k, v in y} diff --git a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap index ac7516e097..ac28429f7c 100644 --- a/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap +++ b/crates/ruff/src/rules/flake8_comprehensions/snapshots/ruff__rules__flake8_comprehensions__tests__C417_C417.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_comprehensions/mod.rs --- -./resources/test/fixtures/flake8_comprehensions/C417.py:3:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:3:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 3 | # Errors. 4 | nums = [1, 2, 3] @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 5 5 | list(map(lambda x: x * 2, nums)) 6 6 | set(map(lambda x: x % 2 == 0, nums)) -./resources/test/fixtures/flake8_comprehensions/C417.py:4:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:4:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 4 | nums = [1, 2, 3] 5 | map(lambda x: x + 1, nums) @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 6 6 | set(map(lambda x: x % 2 == 0, nums)) 7 7 | dict(map(lambda v: (v, v**2), nums)) -./resources/test/fixtures/flake8_comprehensions/C417.py:5:1: C417 [*] Unnecessary `map` usage (rewrite using a `list` comprehension) +C417.py:5:1: C417 [*] Unnecessary `map` usage (rewrite using a `list` comprehension) | 5 | map(lambda x: x + 1, nums) 6 | map(lambda x: str(x), nums) @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 7 7 | dict(map(lambda v: (v, v**2), nums)) 8 8 | map(lambda: "const", nums) -./resources/test/fixtures/flake8_comprehensions/C417.py:6:1: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehension) +C417.py:6:1: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehension) | 6 | map(lambda x: str(x), nums) 7 | list(map(lambda x: x * 2, nums)) @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 8 8 | map(lambda: "const", nums) 9 9 | map(lambda _: 3.0, nums) -./resources/test/fixtures/flake8_comprehensions/C417.py:7:1: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehension) +C417.py:7:1: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehension) | 7 | list(map(lambda x: x * 2, nums)) 8 | set(map(lambda x: x % 2 == 0, nums)) @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 9 9 | map(lambda _: 3.0, nums) 10 10 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) -./resources/test/fixtures/flake8_comprehensions/C417.py:8:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:8:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 8 | set(map(lambda x: x % 2 == 0, nums)) 9 | dict(map(lambda v: (v, v**2), nums)) @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 10 10 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) 11 11 | all(map(lambda v: isinstance(v, dict), nums)) -./resources/test/fixtures/flake8_comprehensions/C417.py:9:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:9:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 9 | dict(map(lambda v: (v, v**2), nums)) 10 | map(lambda: "const", nums) @@ -147,7 +147,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 11 11 | all(map(lambda v: isinstance(v, dict), nums)) 12 12 | filter(func, map(lambda v: v, nums)) -./resources/test/fixtures/flake8_comprehensions/C417.py:10:13: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:10:13: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 10 | map(lambda: "const", nums) 11 | map(lambda _: 3.0, nums) @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 12 12 | filter(func, map(lambda v: v, nums)) 13 13 | -./resources/test/fixtures/flake8_comprehensions/C417.py:11:5: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:11:5: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 11 | map(lambda _: 3.0, nums) 12 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 13 13 | 14 14 | # When inside f-string, then the fix should be surrounded by whitespace -./resources/test/fixtures/flake8_comprehensions/C417.py:12:14: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:12:14: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 12 | _ = "".join(map(lambda x: x in nums and "1" or "0", range(123))) 13 | all(map(lambda v: isinstance(v, dict), nums)) @@ -209,7 +209,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 14 14 | # When inside f-string, then the fix should be surrounded by whitespace 15 15 | _ = f"{set(map(lambda x: x % 2 == 0, nums))}" -./resources/test/fixtures/flake8_comprehensions/C417.py:15:8: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehension) +C417.py:15:8: C417 [*] Unnecessary `map` usage (rewrite using a `set` comprehension) | 15 | # When inside f-string, then the fix should be surrounded by whitespace 16 | _ = f"{set(map(lambda x: x % 2 == 0, nums))}" @@ -228,7 +228,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 17 17 | 18 18 | # Error, but unfixable. -./resources/test/fixtures/flake8_comprehensions/C417.py:16:8: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehension) +C417.py:16:8: C417 [*] Unnecessary `map` usage (rewrite using a `dict` comprehension) | 16 | # When inside f-string, then the fix should be surrounded by whitespace 17 | _ = f"{set(map(lambda x: x % 2 == 0, nums))}" @@ -249,7 +249,7 @@ source: crates/ruff/src/rules/flake8_comprehensions/mod.rs 18 18 | # Error, but unfixable. 19 19 | # For simple expressions, this could be: `(x if x else 1 for x in nums)`. -./resources/test/fixtures/flake8_comprehensions/C417.py:21:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) +C417.py:21:1: C417 [*] Unnecessary `map` usage (rewrite using a generator expression) | 21 | # For simple expressions, this could be: `(x if x else 1 for x in nums)`. 22 | # For more complex expressions, this would differ: `(x + 2 if x else 3 for x in nums)`. diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap index 672454de34..f788737c1d 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ001_DTZ001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ001.py:4:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed +DTZ001.py:4:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed | 4 | # no args 5 | datetime.datetime(2000, 1, 1, 0, 0, 0) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | # none args | -./resources/test/fixtures/flake8_datetimez/DTZ001.py:7:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed +DTZ001.py:7:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed | 7 | # none args 8 | datetime.datetime(2000, 1, 1, 0, 0, 0, 0, None) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 10 | # not none arg | -./resources/test/fixtures/flake8_datetimez/DTZ001.py:13:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed +DTZ001.py:13:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed | 13 | # no kwargs 14 | datetime.datetime(2000, 1, 1, fold=1) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 16 | # none kwargs | -./resources/test/fixtures/flake8_datetimez/DTZ001.py:16:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed +DTZ001.py:16:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed | 16 | # none kwargs 17 | datetime.datetime(2000, 1, 1, tzinfo=None) @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 19 | from datetime import datetime | -./resources/test/fixtures/flake8_datetimez/DTZ001.py:21:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed +DTZ001.py:21:1: DTZ001 The use of `datetime.datetime()` without `tzinfo` argument is not allowed | 21 | # no args unqualified 22 | datetime(2000, 1, 1, 0, 0, 0) diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap index 9962084a59..516bf84e14 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ002_DTZ002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ002.py:4:1: DTZ002 The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead +DTZ002.py:4:1: DTZ002 The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead | 4 | # qualified 5 | datetime.datetime.today() @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | from datetime import datetime | -./resources/test/fixtures/flake8_datetimez/DTZ002.py:9:1: DTZ002 The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead +DTZ002.py:9:1: DTZ002 The use of `datetime.datetime.today()` is not allowed, use `datetime.datetime.now(tz=)` instead | 9 | # unqualified 10 | datetime.today() diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap index 5916874de2..96700580cf 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ003_DTZ003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ003.py:4:1: DTZ003 The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead +DTZ003.py:4:1: DTZ003 The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead | 4 | # qualified 5 | datetime.datetime.utcnow() @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | from datetime import datetime | -./resources/test/fixtures/flake8_datetimez/DTZ003.py:9:1: DTZ003 The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead +DTZ003.py:9:1: DTZ003 The use of `datetime.datetime.utcnow()` is not allowed, use `datetime.datetime.now(tz=)` instead | 9 | # unqualified 10 | datetime.utcnow() diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap index 707fbcbb3a..7ef42e8ac4 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ004_DTZ004.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ004.py:4:1: DTZ004 The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead +DTZ004.py:4:1: DTZ004 The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead | 4 | # qualified 5 | datetime.datetime.utcfromtimestamp(1234) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | from datetime import datetime | -./resources/test/fixtures/flake8_datetimez/DTZ004.py:9:1: DTZ004 The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead +DTZ004.py:9:1: DTZ004 The use of `datetime.datetime.utcfromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=)` instead | 9 | # unqualified 10 | datetime.utcfromtimestamp(1234) diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap index 69abb1aa77..e168a606d2 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ005_DTZ005.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ005.py:4:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed +DTZ005.py:4:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed | 4 | # no args 5 | datetime.datetime.now() @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | # wrong keywords | -./resources/test/fixtures/flake8_datetimez/DTZ005.py:7:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed +DTZ005.py:7:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed | 7 | # wrong keywords 8 | datetime.datetime.now(bad=datetime.timezone.utc) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 10 | # none args | -./resources/test/fixtures/flake8_datetimez/DTZ005.py:10:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed +DTZ005.py:10:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed | 10 | # none args 11 | datetime.datetime.now(None) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 13 | # none keywords | -./resources/test/fixtures/flake8_datetimez/DTZ005.py:13:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed +DTZ005.py:13:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed | 13 | # none keywords 14 | datetime.datetime.now(tz=None) @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 16 | from datetime import datetime | -./resources/test/fixtures/flake8_datetimez/DTZ005.py:18:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed +DTZ005.py:18:1: DTZ005 The use of `datetime.datetime.now()` without `tz` argument is not allowed | 18 | # no args unqualified 19 | datetime.now() diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap index 1f7bc5d76f..bb1b858437 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ006_DTZ006.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ006.py:4:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed +DTZ006.py:4:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed | 4 | # no args 5 | datetime.datetime.fromtimestamp(1234) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | # wrong keywords | -./resources/test/fixtures/flake8_datetimez/DTZ006.py:7:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed +DTZ006.py:7:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed | 7 | # wrong keywords 8 | datetime.datetime.fromtimestamp(1234, bad=datetime.timezone.utc) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 10 | # none args | -./resources/test/fixtures/flake8_datetimez/DTZ006.py:10:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed +DTZ006.py:10:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed | 10 | # none args 11 | datetime.datetime.fromtimestamp(1234, None) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 13 | # none keywords | -./resources/test/fixtures/flake8_datetimez/DTZ006.py:13:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed +DTZ006.py:13:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed | 13 | # none keywords 14 | datetime.datetime.fromtimestamp(1234, tz=None) @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 16 | from datetime import datetime | -./resources/test/fixtures/flake8_datetimez/DTZ006.py:18:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed +DTZ006.py:18:1: DTZ006 The use of `datetime.datetime.fromtimestamp()` without `tz` argument is not allowed | 18 | # no args unqualified 19 | datetime.fromtimestamp(1234) diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap index 1517158917..48a92ea8fc 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ007_DTZ007.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ007.py:4:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` +DTZ007.py:4:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` | 4 | # bad format 5 | datetime.datetime.strptime("something", "%H:%M:%S%Z") @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | # no replace or astimezone | -./resources/test/fixtures/flake8_datetimez/DTZ007.py:7:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` +DTZ007.py:7:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` | 7 | # no replace or astimezone 8 | datetime.datetime.strptime("something", "something") @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 10 | # wrong replace | -./resources/test/fixtures/flake8_datetimez/DTZ007.py:10:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` +DTZ007.py:10:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` | 10 | # wrong replace 11 | datetime.datetime.strptime("something", "something").replace(hour=1) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 13 | # none replace | -./resources/test/fixtures/flake8_datetimez/DTZ007.py:13:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` +DTZ007.py:13:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` | 13 | # none replace 14 | datetime.datetime.strptime("something", "something").replace(tzinfo=None) @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 16 | # OK | -./resources/test/fixtures/flake8_datetimez/DTZ007.py:35:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` +DTZ007.py:35:1: DTZ007 The use of `datetime.datetime.strptime()` without %z must be followed by `.replace(tzinfo=)` or `.astimezone()` | 35 | # no replace orastimezone unqualified 36 | datetime.strptime("something", "something") diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap index edff8fbb87..77bae4d235 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ011_DTZ011.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ011.py:4:1: DTZ011 The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead +DTZ011.py:4:1: DTZ011 The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead | 4 | # qualified 5 | datetime.date.today() @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | from datetime import date | -./resources/test/fixtures/flake8_datetimez/DTZ011.py:9:1: DTZ011 The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead +DTZ011.py:9:1: DTZ011 The use of `datetime.date.today()` is not allowed, use `datetime.datetime.now(tz=).date()` instead | 9 | # unqualified 10 | date.today() diff --git a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap index ed2e1b74f5..b07572c922 100644 --- a/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap +++ b/crates/ruff/src/rules/flake8_datetimez/snapshots/ruff__rules__flake8_datetimez__tests__DTZ012_DTZ012.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_datetimez/mod.rs --- -./resources/test/fixtures/flake8_datetimez/DTZ012.py:4:1: DTZ012 The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead +DTZ012.py:4:1: DTZ012 The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead | 4 | # qualified 5 | datetime.date.fromtimestamp(1234) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_datetimez/mod.rs 7 | from datetime import date | -./resources/test/fixtures/flake8_datetimez/DTZ012.py:9:1: DTZ012 The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead +DTZ012.py:9:1: DTZ012 The use of `datetime.date.fromtimestamp()` is not allowed, use `datetime.datetime.fromtimestamp(ts, tz=).date()` instead | 9 | # unqualified 10 | date.fromtimestamp(1234) diff --git a/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap b/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap index 254daf9513..40da9bf8af 100644 --- a/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap +++ b/crates/ruff/src/rules/flake8_debugger/snapshots/ruff__rules__flake8_debugger__tests__T100_T100.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_debugger/mod.rs --- -./resources/test/fixtures/flake8_debugger/T100.py:1:1: T100 Trace found: `breakpoint` used +T100.py:1:1: T100 Trace found: `breakpoint` used | 1 | breakpoint() | ^^^^^^^^^^^^ T100 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 3 | import pdb | -./resources/test/fixtures/flake8_debugger/T100.py:3:1: T100 Import for `pdb` found +T100.py:3:1: T100 Import for `pdb` found | 3 | breakpoint() 4 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 7 | from builtins import breakpoint | -./resources/test/fixtures/flake8_debugger/T100.py:5:1: T100 Import for `builtins.breakpoint` found +T100.py:5:1: T100 Import for `builtins.breakpoint` found | 5 | import pdb 6 | import builtins @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 9 | from celery.contrib.rdb import set_trace | -./resources/test/fixtures/flake8_debugger/T100.py:6:1: T100 Import for `pdb.set_trace` found +T100.py:6:1: T100 Import for `pdb.set_trace` found | 6 | import builtins 7 | from builtins import breakpoint @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 10 | from celery.contrib import rdb | -./resources/test/fixtures/flake8_debugger/T100.py:7:1: T100 Import for `celery.contrib.rdb.set_trace` found +T100.py:7:1: T100 Import for `celery.contrib.rdb.set_trace` found | 7 | from builtins import breakpoint 8 | from pdb import set_trace as st @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 11 | import celery.contrib.rdb | -./resources/test/fixtures/flake8_debugger/T100.py:9:1: T100 Import for `celery.contrib.rdb` found +T100.py:9:1: T100 Import for `celery.contrib.rdb` found | 9 | from celery.contrib.rdb import set_trace 10 | from celery.contrib import rdb @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 13 | breakpoint() | -./resources/test/fixtures/flake8_debugger/T100.py:11:1: T100 Trace found: `builtins.breakpoint` used +T100.py:11:1: T100 Trace found: `builtins.breakpoint` used | 11 | import celery.contrib.rdb 12 | @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 15 | set_trace() | -./resources/test/fixtures/flake8_debugger/T100.py:12:1: T100 Trace found: `pdb.set_trace` used +T100.py:12:1: T100 Trace found: `pdb.set_trace` used | 12 | breakpoint() 13 | st() @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_debugger/mod.rs 14 | set_trace() | -./resources/test/fixtures/flake8_debugger/T100.py:13:1: T100 Trace found: `celery.contrib.rdb.set_trace` used +T100.py:13:1: T100 Trace found: `celery.contrib.rdb.set_trace` used | 13 | breakpoint() 14 | st() diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap index 081c720639..760a769699 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ001_DJ001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_django/mod.rs --- -./resources/test/fixtures/flake8_django/DJ001.py:7:17: DJ001 Avoid using `null=True` on string-based fields such as CharField +DJ001.py:7:17: DJ001 Avoid using `null=True` on string-based fields such as CharField | 7 | class IncorrectModel(models.Model): 8 | charfield = models.CharField(max_length=255, null=True) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 10 | slugfield = models.SlugField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:8:17: DJ001 Avoid using `null=True` on string-based fields such as TextField +DJ001.py:8:17: DJ001 Avoid using `null=True` on string-based fields such as TextField | 8 | class IncorrectModel(models.Model): 9 | charfield = models.CharField(max_length=255, null=True) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 12 | emailfield = models.EmailField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:9:17: DJ001 Avoid using `null=True` on string-based fields such as SlugField +DJ001.py:9:17: DJ001 Avoid using `null=True` on string-based fields such as SlugField | 9 | charfield = models.CharField(max_length=255, null=True) 10 | textfield = models.TextField(max_length=255, null=True) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 13 | filepathfield = models.FilePathField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:10:18: DJ001 Avoid using `null=True` on string-based fields such as EmailField +DJ001.py:10:18: DJ001 Avoid using `null=True` on string-based fields such as EmailField | 10 | textfield = models.TextField(max_length=255, null=True) 11 | slugfield = models.SlugField(max_length=255, null=True) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 14 | urlfield = models.URLField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:11:21: DJ001 Avoid using `null=True` on string-based fields such as FilePathField +DJ001.py:11:21: DJ001 Avoid using `null=True` on string-based fields such as FilePathField | 11 | slugfield = models.SlugField(max_length=255, null=True) 12 | emailfield = models.EmailField(max_length=255, null=True) @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 14 | urlfield = models.URLField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:12:16: DJ001 Avoid using `null=True` on string-based fields such as URLField +DJ001.py:12:16: DJ001 Avoid using `null=True` on string-based fields such as URLField | 12 | emailfield = models.EmailField(max_length=255, null=True) 13 | filepathfield = models.FilePathField(max_length=255, null=True) @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DJ001 | -./resources/test/fixtures/flake8_django/DJ001.py:16:17: DJ001 Avoid using `null=True` on string-based fields such as CharField +DJ001.py:16:17: DJ001 Avoid using `null=True` on string-based fields such as CharField | 16 | class IncorrectModelWithAlias(DjangoModel): 17 | charfield = DjangoModel.CharField(max_length=255, null=True) @@ -66,7 +66,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 19 | slugfield = models.SlugField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:17:17: DJ001 Avoid using `null=True` on string-based fields such as CharField +DJ001.py:17:17: DJ001 Avoid using `null=True` on string-based fields such as CharField | 17 | class IncorrectModelWithAlias(DjangoModel): 18 | charfield = DjangoModel.CharField(max_length=255, null=True) @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 21 | emailfield = models.EmailField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:18:17: DJ001 Avoid using `null=True` on string-based fields such as SlugField +DJ001.py:18:17: DJ001 Avoid using `null=True` on string-based fields such as SlugField | 18 | charfield = DjangoModel.CharField(max_length=255, null=True) 19 | textfield = SmthCharField(max_length=255, null=True) @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 22 | filepathfield = models.FilePathField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:19:18: DJ001 Avoid using `null=True` on string-based fields such as EmailField +DJ001.py:19:18: DJ001 Avoid using `null=True` on string-based fields such as EmailField | 19 | textfield = SmthCharField(max_length=255, null=True) 20 | slugfield = models.SlugField(max_length=255, null=True) @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 23 | urlfield = models.URLField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:20:21: DJ001 Avoid using `null=True` on string-based fields such as FilePathField +DJ001.py:20:21: DJ001 Avoid using `null=True` on string-based fields such as FilePathField | 20 | slugfield = models.SlugField(max_length=255, null=True) 21 | emailfield = models.EmailField(max_length=255, null=True) @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 23 | urlfield = models.URLField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:21:16: DJ001 Avoid using `null=True` on string-based fields such as URLField +DJ001.py:21:16: DJ001 Avoid using `null=True` on string-based fields such as URLField | 21 | emailfield = models.EmailField(max_length=255, null=True) 22 | filepathfield = models.FilePathField(max_length=255, null=True) @@ -113,7 +113,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DJ001 | -./resources/test/fixtures/flake8_django/DJ001.py:25:17: DJ001 Avoid using `null=True` on string-based fields such as CharField +DJ001.py:25:17: DJ001 Avoid using `null=True` on string-based fields such as CharField | 25 | class IncorrectModelWithoutSuperclass: 26 | charfield = DjangoModel.CharField(max_length=255, null=True) @@ -122,7 +122,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 28 | slugfield = models.SlugField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:26:17: DJ001 Avoid using `null=True` on string-based fields such as CharField +DJ001.py:26:17: DJ001 Avoid using `null=True` on string-based fields such as CharField | 26 | class IncorrectModelWithoutSuperclass: 27 | charfield = DjangoModel.CharField(max_length=255, null=True) @@ -132,7 +132,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 30 | emailfield = models.EmailField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:27:17: DJ001 Avoid using `null=True` on string-based fields such as SlugField +DJ001.py:27:17: DJ001 Avoid using `null=True` on string-based fields such as SlugField | 27 | charfield = DjangoModel.CharField(max_length=255, null=True) 28 | textfield = SmthCharField(max_length=255, null=True) @@ -142,7 +142,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 31 | filepathfield = models.FilePathField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:28:18: DJ001 Avoid using `null=True` on string-based fields such as EmailField +DJ001.py:28:18: DJ001 Avoid using `null=True` on string-based fields such as EmailField | 28 | textfield = SmthCharField(max_length=255, null=True) 29 | slugfield = models.SlugField(max_length=255, null=True) @@ -152,7 +152,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 32 | urlfield = models.URLField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:29:21: DJ001 Avoid using `null=True` on string-based fields such as FilePathField +DJ001.py:29:21: DJ001 Avoid using `null=True` on string-based fields such as FilePathField | 29 | slugfield = models.SlugField(max_length=255, null=True) 30 | emailfield = models.EmailField(max_length=255, null=True) @@ -161,7 +161,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 32 | urlfield = models.URLField(max_length=255, null=True) | -./resources/test/fixtures/flake8_django/DJ001.py:30:16: DJ001 Avoid using `null=True` on string-based fields such as URLField +DJ001.py:30:16: DJ001 Avoid using `null=True` on string-based fields such as URLField | 30 | emailfield = models.EmailField(max_length=255, null=True) 31 | filepathfield = models.FilePathField(max_length=255, null=True) diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap index 4c387a0cb5..1bc4b9310c 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ003_DJ003.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/flake8_django/mod.rs --- -./resources/test/fixtures/flake8_django/DJ003.py:5:42: DJ003 Avoid passing `locals()` as context to a `render` function +DJ003.py:5:42: DJ003 Avoid passing `locals()` as context to a `render` function | 5 | def test_view1(request): 6 | return render(request, "index.html", locals()) | ^^^^^^^^ DJ003 | -./resources/test/fixtures/flake8_django/DJ003.py:9:50: DJ003 Avoid passing `locals()` as context to a `render` function +DJ003.py:9:50: DJ003 Avoid passing `locals()` as context to a `render` function | 9 | def test_view2(request): 10 | return render(request, "index.html", context=locals()) diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap index 17dbdadd9d..8b814fc67f 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ006_DJ006.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_django/mod.rs --- -./resources/test/fixtures/flake8_django/DJ006.py:6:9: DJ006 Do not use `exclude` with `ModelForm`, use `fields` instead +DJ006.py:6:9: DJ006 Do not use `exclude` with `ModelForm`, use `fields` instead | 6 | class TestModelForm1(forms.ModelForm): 7 | class Meta: diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap index ba24bd319b..1717bb26b5 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ007_DJ007.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_django/mod.rs --- -./resources/test/fixtures/flake8_django/DJ007.py:6:9: DJ007 Do not use `__all__` with `ModelForm`, use `fields` instead +DJ007.py:6:9: DJ007 Do not use `__all__` with `ModelForm`, use `fields` instead | 6 | class TestModelForm1(forms.ModelForm): 7 | class Meta: @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | ^^^^^^^^^^^^^^^^^^ DJ007 | -./resources/test/fixtures/flake8_django/DJ007.py:11:9: DJ007 Do not use `__all__` with `ModelForm`, use `fields` instead +DJ007.py:11:9: DJ007 Do not use `__all__` with `ModelForm`, use `fields` instead | 11 | class TestModelForm2(forms.ModelForm): 12 | class Meta: diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap index dd709f5360..7e3ef2ba22 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ008_DJ008.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_django/mod.rs --- -./resources/test/fixtures/flake8_django/DJ008.py:6:1: DJ008 Model does not define `__str__` method +DJ008.py:6:1: DJ008 Model does not define `__str__` method | 6 | # Models without __str__ 7 | / class TestModel1(models.Model): @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | |________________^ DJ008 | -./resources/test/fixtures/flake8_django/DJ008.py:21:1: DJ008 Model does not define `__str__` method +DJ008.py:21:1: DJ008 Model does not define `__str__` method | 21 | / class TestModel2(Model): 22 | | new_field = models.CharField(max_length=10) @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | |________________^ DJ008 | -./resources/test/fixtures/flake8_django/DJ008.py:36:1: DJ008 Model does not define `__str__` method +DJ008.py:36:1: DJ008 Model does not define `__str__` method | 36 | / class TestModel3(Model): 37 | | new_field = models.CharField(max_length=10) diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ012_DJ012.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ012_DJ012.py.snap index e227eb0dba..1ce01fcbce 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ012_DJ012.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ012_DJ012.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_django/mod.rs --- -./resources/test/fixtures/flake8_django/DJ012.py:28:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: field declaration should come before `Meta` class +DJ012.py:28:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: field declaration should come before `Meta` class | 28 | return "foobar" 29 | @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DJ012 | -./resources/test/fixtures/flake8_django/DJ012.py:43:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: field declaration should come before manager declaration +DJ012.py:43:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: field declaration should come before manager declaration | 43 | return "foobar" 44 | @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ DJ012 | -./resources/test/fixtures/flake8_django/DJ012.py:56:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `__str__` method should come before custom method +DJ012.py:56:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `__str__` method should come before custom method | 56 | pass 57 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs | |_______________________^ DJ012 | -./resources/test/fixtures/flake8_django/DJ012.py:69:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `save` method should come before `get_absolute_url` method +DJ012.py:69:5: DJ012 Order of model's inner classes, methods, and fields does not follow the Django Style Guide: `save` method should come before `get_absolute_url` method | 69 | pass 70 | diff --git a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap index 2187a3a9ca..9867a8e089 100644 --- a/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap +++ b/crates/ruff/src/rules/flake8_django/snapshots/ruff__rules__flake8_django__tests__DJ013_DJ013.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_django/mod.rs --- -./resources/test/fixtures/flake8_django/DJ013.py:15:2: DJ013 `@receiver` decorator must be on top of all the other decorators +DJ013.py:15:2: DJ013 `@receiver` decorator must be on top of all the other decorators | 15 | @test_decorator 16 | @receiver(pre_save, sender=MyModel) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_django/mod.rs 18 | pass | -./resources/test/fixtures/flake8_django/DJ013.py:35:2: DJ013 `@receiver` decorator must be on top of all the other decorators +DJ013.py:35:2: DJ013 `@receiver` decorator must be on top of all the other decorators | 35 | @receiver(pre_save, sender=MyModel) 36 | @test_decorator diff --git a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap index 979ebb09f2..9768f244bd 100644 --- a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap +++ b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__custom.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/flake8_errmsg/mod.rs --- -./resources/test/fixtures/flake8_errmsg/EM.py:5:24: EM101 Exception must not use a string literal, assign to variable first +EM.py:5:24: EM101 Exception must not use a string literal, assign to variable first | 5 | def f_a(): 6 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ EM101 | -./resources/test/fixtures/flake8_errmsg/EM.py:14:24: EM102 Exception must not use an f-string literal, assign to variable first +EM.py:14:24: EM102 Exception must not use an f-string literal, assign to variable first | 14 | def f_b(): 15 | example = "example" @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/flake8_errmsg/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ EM102 | -./resources/test/fixtures/flake8_errmsg/EM.py:18:24: EM103 Exception must not use a `.format()` string directly, assign to variable first +EM.py:18:24: EM103 Exception must not use a `.format()` string directly, assign to variable first | 18 | def f_c(): 19 | raise RuntimeError("This is an {example} exception".format(example="example")) diff --git a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap index e30e79beec..b1adb139c5 100644 --- a/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_errmsg/snapshots/ruff__rules__flake8_errmsg__tests__defaults.snap @@ -1,21 +1,21 @@ --- source: crates/ruff/src/rules/flake8_errmsg/mod.rs --- -./resources/test/fixtures/flake8_errmsg/EM.py:5:24: EM101 Exception must not use a string literal, assign to variable first +EM.py:5:24: EM101 Exception must not use a string literal, assign to variable first | 5 | def f_a(): 6 | raise RuntimeError("This is an example exception") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ EM101 | -./resources/test/fixtures/flake8_errmsg/EM.py:9:24: EM101 Exception must not use a string literal, assign to variable first +EM.py:9:24: EM101 Exception must not use a string literal, assign to variable first | 9 | def f_a_short(): 10 | raise RuntimeError("Error") | ^^^^^^^ EM101 | -./resources/test/fixtures/flake8_errmsg/EM.py:14:24: EM102 Exception must not use an f-string literal, assign to variable first +EM.py:14:24: EM102 Exception must not use an f-string literal, assign to variable first | 14 | def f_b(): 15 | example = "example" @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_errmsg/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ EM102 | -./resources/test/fixtures/flake8_errmsg/EM.py:18:24: EM103 Exception must not use a `.format()` string directly, assign to variable first +EM.py:18:24: EM103 Exception must not use a `.format()` string directly, assign to variable first | 18 | def f_c(): 19 | raise RuntimeError("This is an {example} exception".format(example="example")) diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap index d1c3d58e43..4d287f67bc 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE001_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE001_1.py:1:3: EXE001 Shebang is present but file is not executable +EXE001_1.py:1:3: EXE001 Shebang is present but file is not executable | 1 | #!/usr/bin/python | ^^^^^^^^^^^^^^^ EXE001 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap index 69f272bc14..a63902d2cf 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE002_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE002_1.py:1:1: EXE002 The file is executable but no shebang is present +EXE002_1.py:1:1: EXE002 The file is executable but no shebang is present | 1 | if __name__ == '__main__': | EXE002 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap index 59233f925e..5ac99db866 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE003.py:1:1: EXE003 Shebang should contain `python` +EXE003.py:1:1: EXE003 Shebang should contain `python` | 1 | #!/usr/bin/bash | ^^^^^^^^^^^^^^^ EXE003 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap index c79be2afcd..3a7d2f6f30 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE004_1.py:1:1: EXE004 [*] Avoid whitespace before shebang +EXE004_1.py:1:1: EXE004 [*] Avoid whitespace before shebang | 1 | #!/usr/bin/python | ^^^^ EXE004 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap index cc4d5f6e66..974ea12679 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE004_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE004_3.py:1:1: EXE002 The file is executable but no shebang is present +EXE004_3.py:1:1: EXE002 The file is executable but no shebang is present | 1 | | EXE002 diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap index cec3a526df..43ee318e81 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE005_1.py:3:3: EXE005 Shebang should be at the beginning of the file +EXE005_1.py:3:3: EXE005 Shebang should be at the beginning of the file | 3 | # A python comment 4 | #!/usr/bin/python diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap index f16bb92064..fd3b39da4c 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE005_2.py:4:3: EXE005 Shebang should be at the beginning of the file +EXE005_2.py:4:3: EXE005 Shebang should be at the beginning of the file | 4 | # A python comment 5 | #!/usr/bin/python diff --git a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap index 3c21c991f0..57f024bab7 100644 --- a/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap +++ b/crates/ruff/src/rules/flake8_executable/snapshots/ruff__rules__flake8_executable__tests__EXE005_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_executable/mod.rs --- -./resources/test/fixtures/flake8_executable/EXE005_3.py:6:3: EXE005 Shebang should be at the beginning of the file +EXE005_3.py:6:3: EXE005 Shebang should be at the beginning of the file | 6 | """ 7 | # A python comment diff --git a/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap b/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap index 04b3c2cc23..9a24a8c490 100644 --- a/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap +++ b/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__f-string-in-get-text-func-call_INT001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_gettext/mod.rs --- -./resources/test/fixtures/flake8_gettext/INT001.py:1:3: INT001 f-string is resolved before function call; consider `_("string %s") % arg` +INT001.py:1:3: INT001 f-string is resolved before function call; consider `_("string %s") % arg` | 1 | _(f"{'value'}") | ^^^^^^^^^^^^ INT001 diff --git a/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap b/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap index d03918422d..af74cf0ff1 100644 --- a/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap +++ b/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__format-in-get-text-func-call_INT002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_gettext/mod.rs --- -./resources/test/fixtures/flake8_gettext/INT002.py:1:3: INT002 `format` method argument is resolved before function call; consider `_("string %s") % arg` +INT002.py:1:3: INT002 `format` method argument is resolved before function call; consider `_("string %s") % arg` | 1 | _("{}".format("line")) | ^^^^^^^^^^^^^^^^^^^ INT002 diff --git a/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap b/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap index 0957d71881..aef3fd5f2b 100644 --- a/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap +++ b/crates/ruff/src/rules/flake8_gettext/snapshots/ruff__rules__flake8_gettext__tests__printf-in-get-text-func-call_INT003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_gettext/mod.rs --- -./resources/test/fixtures/flake8_gettext/INT003.py:1:3: INT003 printf-style format is resolved before function call; consider `_("string %s") % arg` +INT003.py:1:3: INT003 printf-style format is resolved before function call; consider `_("string %s") % arg` | 1 | _("%s" % "line") | ^^^^^^^^^^^^^ INT003 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap index e60fd117f2..6770789051 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC001_ISC.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs --- -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:1:5: ISC001 Implicitly concatenated string literals on one line +ISC.py:1:5: ISC001 Implicitly concatenated string literals on one line | 1 | _ = "a" "b" "c" | ^^^^^^^ ISC001 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 3 | _ = "abc" + "def" | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:1:9: ISC001 Implicitly concatenated string literals on one line +ISC.py:1:9: ISC001 Implicitly concatenated string literals on one line | 1 | _ = "a" "b" "c" | ^^^^^^^ ISC001 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap index 56a1961717..ceb28f0772 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC002_ISC.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs --- -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:5:5: ISC002 Implicitly concatenated string literals over multiple lines +ISC.py:5:5: ISC002 Implicitly concatenated string literals over multiple lines | 5 | _ = "abc" + "def" 6 | diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap index 1e5bef7753..7ab8da1b58 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__ISC003_ISC.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs --- -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:3:5: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:3:5: ISC003 Explicitly concatenated string should be implicitly concatenated | 3 | _ = "a" "b" "c" 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 7 | _ = "abc" \ | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:9:3: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:9:3: ISC003 Explicitly concatenated string should be implicitly concatenated | 9 | _ = ( 10 | "abc" + @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 12 | ) | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:14:3: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:14:3: ISC003 Explicitly concatenated string should be implicitly concatenated | 14 | _ = ( 15 | f"abc" + @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 17 | ) | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:19:3: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:19:3: ISC003 Explicitly concatenated string should be implicitly concatenated | 19 | _ = ( 20 | b"abc" + diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap index e60fd117f2..6770789051 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC001_ISC.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs --- -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:1:5: ISC001 Implicitly concatenated string literals on one line +ISC.py:1:5: ISC001 Implicitly concatenated string literals on one line | 1 | _ = "a" "b" "c" | ^^^^^^^ ISC001 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 3 | _ = "abc" + "def" | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:1:9: ISC001 Implicitly concatenated string literals on one line +ISC.py:1:9: ISC001 Implicitly concatenated string literals on one line | 1 | _ = "a" "b" "c" | ^^^^^^^ ISC001 diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap index 0688a7d1af..0ae12d84f0 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC002_ISC.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs --- -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:5:5: ISC002 Implicitly concatenated string literals over multiple lines +ISC.py:5:5: ISC002 Implicitly concatenated string literals over multiple lines | 5 | _ = "abc" + "def" 6 | @@ -13,7 +13,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 10 | _ = ( | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:24:3: ISC002 Implicitly concatenated string literals over multiple lines +ISC.py:24:3: ISC002 Implicitly concatenated string literals over multiple lines | 24 | _ = ( 25 | "abc" @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 27 | ) | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:29:3: ISC002 Implicitly concatenated string literals over multiple lines +ISC.py:29:3: ISC002 Implicitly concatenated string literals over multiple lines | 29 | _ = ( 30 | f"abc" @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 32 | ) | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:34:3: ISC002 Implicitly concatenated string literals over multiple lines +ISC.py:34:3: ISC002 Implicitly concatenated string literals over multiple lines | 34 | _ = ( 35 | b"abc" diff --git a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap index 1e5bef7753..7ab8da1b58 100644 --- a/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap +++ b/crates/ruff/src/rules/flake8_implicit_str_concat/snapshots/ruff__rules__flake8_implicit_str_concat__tests__multiline_ISC003_ISC.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs --- -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:3:5: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:3:5: ISC003 Explicitly concatenated string should be implicitly concatenated | 3 | _ = "a" "b" "c" 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 7 | _ = "abc" \ | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:9:3: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:9:3: ISC003 Explicitly concatenated string should be implicitly concatenated | 9 | _ = ( 10 | "abc" + @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 12 | ) | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:14:3: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:14:3: ISC003 Explicitly concatenated string should be implicitly concatenated | 14 | _ = ( 15 | f"abc" + @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_implicit_str_concat/mod.rs 17 | ) | -./resources/test/fixtures/flake8_implicit_str_concat/ISC.py:19:3: ISC003 Explicitly concatenated string should be implicitly concatenated +ISC.py:19:3: ISC003 Explicitly concatenated string should be implicitly concatenated | 19 | _ = ( 20 | b"abc" + diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap index fe3bc2051c..769390434c 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__custom.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_import_conventions/mod.rs --- -./resources/test/fixtures/flake8_import_conventions/custom.py:3:1: ICN001 `altair` should be imported as `alt` +custom.py:3:1: ICN001 `altair` should be imported as `alt` | 3 | import math # not checked 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import dask.dataframe # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:4:1: ICN001 `dask.array` should be imported as `da` +custom.py:4:1: ICN001 `dask.array` should be imported as `da` | 4 | import altair # unconventional 5 | import dask.array # unconventional @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import matplotlib.pyplot # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:5:1: ICN001 `dask.dataframe` should be imported as `dd` +custom.py:5:1: ICN001 `dask.dataframe` should be imported as `dd` | 5 | import altair # unconventional 6 | import dask.array # unconventional @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 9 | import numpy # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:6:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +custom.py:6:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 6 | import dask.array # unconventional 7 | import dask.dataframe # unconventional @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 10 | import pandas # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:7:1: ICN001 `numpy` should be imported as `np` +custom.py:7:1: ICN001 `numpy` should be imported as `np` | 7 | import dask.dataframe # unconventional 8 | import matplotlib.pyplot # unconventional @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 11 | import seaborn # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:8:1: ICN001 `pandas` should be imported as `pd` +custom.py:8:1: ICN001 `pandas` should be imported as `pd` | 8 | import matplotlib.pyplot # unconventional 9 | import numpy # unconventional @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 12 | import tensorflow # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:9:1: ICN001 `seaborn` should be imported as `sns` +custom.py:9:1: ICN001 `seaborn` should be imported as `sns` | 9 | import numpy # unconventional 10 | import pandas # unconventional @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 13 | import holoviews # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:10:1: ICN001 `tensorflow` should be imported as `tf` +custom.py:10:1: ICN001 `tensorflow` should be imported as `tf` | 10 | import pandas # unconventional 11 | import seaborn # unconventional @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 14 | import panel # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:11:1: ICN001 `holoviews` should be imported as `hv` +custom.py:11:1: ICN001 `holoviews` should be imported as `hv` | 11 | import seaborn # unconventional 12 | import tensorflow # unconventional @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 15 | import plotly.express # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:12:1: ICN001 `panel` should be imported as `pn` +custom.py:12:1: ICN001 `panel` should be imported as `pn` | 12 | import tensorflow # unconventional 13 | import holoviews # unconventional @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 16 | import matplotlib # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:13:1: ICN001 `plotly.express` should be imported as `px` +custom.py:13:1: ICN001 `plotly.express` should be imported as `px` | 13 | import holoviews # unconventional 14 | import panel # unconventional @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 17 | import polars # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:14:1: ICN001 `matplotlib` should be imported as `mpl` +custom.py:14:1: ICN001 `matplotlib` should be imported as `mpl` | 14 | import panel # unconventional 15 | import plotly.express # unconventional @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 18 | import pyarrow # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:15:1: ICN001 `polars` should be imported as `pl` +custom.py:15:1: ICN001 `polars` should be imported as `pl` | 15 | import plotly.express # unconventional 16 | import matplotlib # unconventional @@ -129,7 +129,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 18 | import pyarrow # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:16:1: ICN001 `pyarrow` should be imported as `pa` +custom.py:16:1: ICN001 `pyarrow` should be imported as `pa` | 16 | import matplotlib # unconventional 17 | import polars # unconventional @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 20 | import altair as altr # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:18:1: ICN001 `altair` should be imported as `alt` +custom.py:18:1: ICN001 `altair` should be imported as `alt` | 18 | import pyarrow # unconventional 19 | @@ -149,7 +149,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 22 | import dask.array as darray # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:19:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +custom.py:19:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 19 | import altair as altr # unconventional 20 | import matplotlib.pyplot as plot # unconventional @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 22 | import dask.dataframe as ddf # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:20:1: ICN001 `dask.array` should be imported as `da` +custom.py:20:1: ICN001 `dask.array` should be imported as `da` | 20 | import altair as altr # unconventional 21 | import matplotlib.pyplot as plot # unconventional @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 24 | import numpy as nmp # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:21:1: ICN001 `dask.dataframe` should be imported as `dd` +custom.py:21:1: ICN001 `dask.dataframe` should be imported as `dd` | 21 | import matplotlib.pyplot as plot # unconventional 22 | import dask.array as darray # unconventional @@ -178,7 +178,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 25 | import pandas as pdas # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:22:1: ICN001 `numpy` should be imported as `np` +custom.py:22:1: ICN001 `numpy` should be imported as `np` | 22 | import dask.array as darray # unconventional 23 | import dask.dataframe as ddf # unconventional @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 26 | import seaborn as sbrn # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:23:1: ICN001 `pandas` should be imported as `pd` +custom.py:23:1: ICN001 `pandas` should be imported as `pd` | 23 | import dask.dataframe as ddf # unconventional 24 | import numpy as nmp # unconventional @@ -198,7 +198,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 27 | import tensorflow as tfz # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:24:1: ICN001 `seaborn` should be imported as `sns` +custom.py:24:1: ICN001 `seaborn` should be imported as `sns` | 24 | import numpy as nmp # unconventional 25 | import pandas as pdas # unconventional @@ -208,7 +208,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 28 | import holoviews as hsv # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:25:1: ICN001 `tensorflow` should be imported as `tf` +custom.py:25:1: ICN001 `tensorflow` should be imported as `tf` | 25 | import pandas as pdas # unconventional 26 | import seaborn as sbrn # unconventional @@ -218,7 +218,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 29 | import panel as pns # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:26:1: ICN001 `holoviews` should be imported as `hv` +custom.py:26:1: ICN001 `holoviews` should be imported as `hv` | 26 | import seaborn as sbrn # unconventional 27 | import tensorflow as tfz # unconventional @@ -228,7 +228,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 30 | import plotly.express as pltx # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:27:1: ICN001 `panel` should be imported as `pn` +custom.py:27:1: ICN001 `panel` should be imported as `pn` | 27 | import tensorflow as tfz # unconventional 28 | import holoviews as hsv # unconventional @@ -238,7 +238,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 31 | import matplotlib as ml # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:28:1: ICN001 `plotly.express` should be imported as `px` +custom.py:28:1: ICN001 `plotly.express` should be imported as `px` | 28 | import holoviews as hsv # unconventional 29 | import panel as pns # unconventional @@ -248,7 +248,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 32 | import polars as ps # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:29:1: ICN001 `matplotlib` should be imported as `mpl` +custom.py:29:1: ICN001 `matplotlib` should be imported as `mpl` | 29 | import panel as pns # unconventional 30 | import plotly.express as pltx # unconventional @@ -258,7 +258,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 33 | import pyarrow as arr # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:30:1: ICN001 `polars` should be imported as `pl` +custom.py:30:1: ICN001 `polars` should be imported as `pl` | 30 | import plotly.express as pltx # unconventional 31 | import matplotlib as ml # unconventional @@ -267,7 +267,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 33 | import pyarrow as arr # unconventional | -./resources/test/fixtures/flake8_import_conventions/custom.py:31:1: ICN001 `pyarrow` should be imported as `pa` +custom.py:31:1: ICN001 `pyarrow` should be imported as `pa` | 31 | import matplotlib as ml # unconventional 32 | import polars as ps # unconventional diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap index cbe88712be..470740cb2b 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__defaults.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_import_conventions/mod.rs --- -./resources/test/fixtures/flake8_import_conventions/defaults.py:3:1: ICN001 `altair` should be imported as `alt` +defaults.py:3:1: ICN001 `altair` should be imported as `alt` | 3 | import math # not checked 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import numpy # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:4:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +defaults.py:4:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 4 | import altair # unconventional 5 | import matplotlib.pyplot # unconventional @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import pandas # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:5:1: ICN001 `numpy` should be imported as `np` +defaults.py:5:1: ICN001 `numpy` should be imported as `np` | 5 | import altair # unconventional 6 | import matplotlib.pyplot # unconventional @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 9 | import seaborn # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:6:1: ICN001 `pandas` should be imported as `pd` +defaults.py:6:1: ICN001 `pandas` should be imported as `pd` | 6 | import matplotlib.pyplot # unconventional 7 | import numpy # unconventional @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 9 | import seaborn # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:7:1: ICN001 `seaborn` should be imported as `sns` +defaults.py:7:1: ICN001 `seaborn` should be imported as `sns` | 7 | import numpy # unconventional 8 | import pandas # unconventional @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 11 | import altair as altr # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:9:1: ICN001 `altair` should be imported as `alt` +defaults.py:9:1: ICN001 `altair` should be imported as `alt` | 9 | import seaborn # unconventional 10 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 13 | import numpy as nmp # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:10:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +defaults.py:10:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 10 | import altair as altr # unconventional 11 | import matplotlib.pyplot as plot # unconventional @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 13 | import pandas as pdas # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:11:1: ICN001 `numpy` should be imported as `np` +defaults.py:11:1: ICN001 `numpy` should be imported as `np` | 11 | import altair as altr # unconventional 12 | import matplotlib.pyplot as plot # unconventional @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 15 | import seaborn as sbrn # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:12:1: ICN001 `pandas` should be imported as `pd` +defaults.py:12:1: ICN001 `pandas` should be imported as `pd` | 12 | import matplotlib.pyplot as plot # unconventional 13 | import numpy as nmp # unconventional @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 15 | import seaborn as sbrn # unconventional | -./resources/test/fixtures/flake8_import_conventions/defaults.py:13:1: ICN001 `seaborn` should be imported as `sns` +defaults.py:13:1: ICN001 `seaborn` should be imported as `sns` | 13 | import numpy as nmp # unconventional 14 | import pandas as pdas # unconventional diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap index 7d4ab8bdbf..1e185b057d 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__from_imports.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_import_conventions/mod.rs --- -./resources/test/fixtures/flake8_import_conventions/from_imports.py:3:1: ICN001 `xml.dom.minidom` should be imported as `md` +from_imports.py:3:1: ICN001 `xml.dom.minidom` should be imported as `md` | 3 | # Test absolute imports 4 | # Violation cases @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | from xml.dom import minidom as wrong | -./resources/test/fixtures/flake8_import_conventions/from_imports.py:4:1: ICN001 `xml.dom.minidom` should be imported as `md` +from_imports.py:4:1: ICN001 `xml.dom.minidom` should be imported as `md` | 4 | # Violation cases 5 | import xml.dom.minidom @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 8 | from xml.dom import minidom | -./resources/test/fixtures/flake8_import_conventions/from_imports.py:5:1: ICN001 `xml.dom.minidom` should be imported as `md` +from_imports.py:5:1: ICN001 `xml.dom.minidom` should be imported as `md` | 5 | import xml.dom.minidom 6 | import xml.dom.minidom as wrong @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 9 | from xml.dom.minidom import parseString as wrong # Ensure ICN001 throws on function import. | -./resources/test/fixtures/flake8_import_conventions/from_imports.py:6:1: ICN001 `xml.dom.minidom` should be imported as `md` +from_imports.py:6:1: ICN001 `xml.dom.minidom` should be imported as `md` | 6 | import xml.dom.minidom as wrong 7 | from xml.dom import minidom as wrong @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 10 | from xml.dom.minidom import parseString | -./resources/test/fixtures/flake8_import_conventions/from_imports.py:7:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` +from_imports.py:7:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` | 7 | from xml.dom import minidom as wrong 8 | from xml.dom import minidom @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 11 | from xml.dom.minidom import parse, parseString | -./resources/test/fixtures/flake8_import_conventions/from_imports.py:8:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` +from_imports.py:8:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` | 8 | from xml.dom import minidom 9 | from xml.dom.minidom import parseString as wrong # Ensure ICN001 throws on function import. @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 12 | from xml.dom.minidom import parse as ps, parseString as wrong | -./resources/test/fixtures/flake8_import_conventions/from_imports.py:9:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` +from_imports.py:9:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` | 9 | from xml.dom.minidom import parseString as wrong # Ensure ICN001 throws on function import. 10 | from xml.dom.minidom import parseString @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 12 | from xml.dom.minidom import parse as ps, parseString as wrong | -./resources/test/fixtures/flake8_import_conventions/from_imports.py:10:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` +from_imports.py:10:1: ICN001 `xml.dom.minidom.parseString` should be imported as `pstr` | 10 | from xml.dom.minidom import parseString 11 | from xml.dom.minidom import parse, parseString diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap index 6aee0b93ef..e095b14518 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__override_default.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_import_conventions/mod.rs --- -./resources/test/fixtures/flake8_import_conventions/override_default.py:3:1: ICN001 `altair` should be imported as `alt` +override_default.py:3:1: ICN001 `altair` should be imported as `alt` | 3 | import math # not checked 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import numpy # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:4:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +override_default.py:4:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 4 | import altair # unconventional 5 | import matplotlib.pyplot # unconventional @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import pandas # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:5:1: ICN001 `numpy` should be imported as `nmp` +override_default.py:5:1: ICN001 `numpy` should be imported as `nmp` | 5 | import altair # unconventional 6 | import matplotlib.pyplot # unconventional @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 9 | import seaborn # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:6:1: ICN001 `pandas` should be imported as `pd` +override_default.py:6:1: ICN001 `pandas` should be imported as `pd` | 6 | import matplotlib.pyplot # unconventional 7 | import numpy # unconventional @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 9 | import seaborn # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:7:1: ICN001 `seaborn` should be imported as `sns` +override_default.py:7:1: ICN001 `seaborn` should be imported as `sns` | 7 | import numpy # unconventional 8 | import pandas # unconventional @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 11 | import altair as altr # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:9:1: ICN001 `altair` should be imported as `alt` +override_default.py:9:1: ICN001 `altair` should be imported as `alt` | 9 | import seaborn # unconventional 10 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 13 | import numpy as np # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:10:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +override_default.py:10:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 10 | import altair as altr # unconventional 11 | import matplotlib.pyplot as plot # unconventional @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 13 | import pandas as pdas # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:11:1: ICN001 `numpy` should be imported as `nmp` +override_default.py:11:1: ICN001 `numpy` should be imported as `nmp` | 11 | import altair as altr # unconventional 12 | import matplotlib.pyplot as plot # unconventional @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 15 | import seaborn as sbrn # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:12:1: ICN001 `pandas` should be imported as `pd` +override_default.py:12:1: ICN001 `pandas` should be imported as `pd` | 12 | import matplotlib.pyplot as plot # unconventional 13 | import numpy as np # unconventional @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 15 | import seaborn as sbrn # unconventional | -./resources/test/fixtures/flake8_import_conventions/override_default.py:13:1: ICN001 `seaborn` should be imported as `sns` +override_default.py:13:1: ICN001 `seaborn` should be imported as `sns` | 13 | import numpy as np # unconventional 14 | import pandas as pdas # unconventional diff --git a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap index 269d444593..67402b6521 100644 --- a/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap +++ b/crates/ruff/src/rules/flake8_import_conventions/snapshots/ruff__rules__flake8_import_conventions__tests__remove_default.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_import_conventions/mod.rs --- -./resources/test/fixtures/flake8_import_conventions/remove_default.py:3:1: ICN001 `altair` should be imported as `alt` +remove_default.py:3:1: ICN001 `altair` should be imported as `alt` | 3 | import math # not checked 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import numpy # not checked | -./resources/test/fixtures/flake8_import_conventions/remove_default.py:4:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +remove_default.py:4:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 4 | import altair # unconventional 5 | import matplotlib.pyplot # unconventional @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 7 | import pandas # unconventional | -./resources/test/fixtures/flake8_import_conventions/remove_default.py:6:1: ICN001 `pandas` should be imported as `pd` +remove_default.py:6:1: ICN001 `pandas` should be imported as `pd` | 6 | import matplotlib.pyplot # unconventional 7 | import numpy # not checked @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 9 | import seaborn # unconventional | -./resources/test/fixtures/flake8_import_conventions/remove_default.py:7:1: ICN001 `seaborn` should be imported as `sns` +remove_default.py:7:1: ICN001 `seaborn` should be imported as `sns` | 7 | import numpy # not checked 8 | import pandas # unconventional @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 11 | import altair as altr # unconventional | -./resources/test/fixtures/flake8_import_conventions/remove_default.py:9:1: ICN001 `altair` should be imported as `alt` +remove_default.py:9:1: ICN001 `altair` should be imported as `alt` | 9 | import seaborn # unconventional 10 | @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 13 | import numpy as nmp # not checked | -./resources/test/fixtures/flake8_import_conventions/remove_default.py:10:1: ICN001 `matplotlib.pyplot` should be imported as `plt` +remove_default.py:10:1: ICN001 `matplotlib.pyplot` should be imported as `plt` | 10 | import altair as altr # unconventional 11 | import matplotlib.pyplot as plot # unconventional @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 13 | import pandas as pdas # unconventional | -./resources/test/fixtures/flake8_import_conventions/remove_default.py:12:1: ICN001 `pandas` should be imported as `pd` +remove_default.py:12:1: ICN001 `pandas` should be imported as `pd` | 12 | import matplotlib.pyplot as plot # unconventional 13 | import numpy as nmp # not checked @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/flake8_import_conventions/mod.rs 15 | import seaborn as sbrn # unconventional | -./resources/test/fixtures/flake8_import_conventions/remove_default.py:13:1: ICN001 `seaborn` should be imported as `sns` +remove_default.py:13:1: ICN001 `seaborn` should be imported as `sns` | 13 | import numpy as nmp # not checked 14 | import pandas as pdas # unconventional diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap index 7a3147a3ab..1658613337 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G001.py:4:14: G001 Logging statement uses `string.format()` +G001.py:4:14: G001 Logging statement uses `string.format()` | 4 | import logging as foo 5 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 8 | foo.info("Hello {}".format("World!")) | -./resources/test/fixtures/flake8_logging_format/G001.py:5:27: G001 Logging statement uses `string.format()` +G001.py:5:27: G001 Logging statement uses `string.format()` | 5 | logging.info("Hello {}".format("World!")) 6 | logging.log(logging.INFO, "Hello {}".format("World!")) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 8 | logging.log(logging.INFO, msg="Hello {}".format("World!")) | -./resources/test/fixtures/flake8_logging_format/G001.py:6:10: G001 Logging statement uses `string.format()` +G001.py:6:10: G001 Logging statement uses `string.format()` | 6 | logging.info("Hello {}".format("World!")) 7 | logging.log(logging.INFO, "Hello {}".format("World!")) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 10 | logging.log(level=logging.INFO, msg="Hello {}".format("World!")) | -./resources/test/fixtures/flake8_logging_format/G001.py:7:31: G001 Logging statement uses `string.format()` +G001.py:7:31: G001 Logging statement uses `string.format()` | 7 | logging.log(logging.INFO, "Hello {}".format("World!")) 8 | foo.info("Hello {}".format("World!")) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 11 | logging.log(msg="Hello {}".format("World!"), level=logging.INFO) | -./resources/test/fixtures/flake8_logging_format/G001.py:8:37: G001 Logging statement uses `string.format()` +G001.py:8:37: G001 Logging statement uses `string.format()` | 8 | foo.info("Hello {}".format("World!")) 9 | logging.log(logging.INFO, msg="Hello {}".format("World!")) @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 11 | logging.log(msg="Hello {}".format("World!"), level=logging.INFO) | -./resources/test/fixtures/flake8_logging_format/G001.py:9:17: G001 Logging statement uses `string.format()` +G001.py:9:17: G001 Logging statement uses `string.format()` | 9 | logging.log(logging.INFO, msg="Hello {}".format("World!")) 10 | logging.log(level=logging.INFO, msg="Hello {}".format("World!")) diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap index 98622b41e2..d49300aa31 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G002.py:3:14: G002 Logging statement uses `%` +G002.py:3:14: G002 Logging statement uses `%` | 3 | import logging 4 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 6 | logging.log(logging.INFO, "Hello %s" % "World!") | -./resources/test/fixtures/flake8_logging_format/G002.py:4:27: G002 Logging statement uses `%` +G002.py:4:27: G002 Logging statement uses `%` | 4 | logging.info("Hello %s" % "World!") 5 | logging.log(logging.INFO, "Hello %s" % "World!") diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap index 51e1d5d3a3..51e4354ca1 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G003.py:3:14: G003 Logging statement uses `+` +G003.py:3:14: G003 Logging statement uses `+` | 3 | import logging 4 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 6 | logging.log(logging.INFO, "Hello" + " " + "World!") | -./resources/test/fixtures/flake8_logging_format/G003.py:4:27: G003 Logging statement uses `+` +G003.py:4:27: G003 Logging statement uses `+` | 4 | logging.info("Hello" + " " + "World!") 5 | logging.log(logging.INFO, "Hello" + " " + "World!") diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap index b0d326d14f..219f7d7f78 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G004.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G004.py:4:14: G004 Logging statement uses f-string +G004.py:4:14: G004 Logging statement uses f-string | 4 | name = "world" 5 | logging.info(f"Hello {name}") @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 6 | logging.log(logging.INFO, f"Hello {name}") | -./resources/test/fixtures/flake8_logging_format/G004.py:5:27: G004 Logging statement uses f-string +G004.py:5:27: G004 Logging statement uses f-string | 5 | name = "world" 6 | logging.info(f"Hello {name}") diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap index 301054569b..6d2e4df9bc 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G010.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G010.py:4:9: G010 [*] Logging statement uses `warn` instead of `warning` +G010.py:4:9: G010 [*] Logging statement uses `warn` instead of `warning` | 4 | from distutils import log 5 | diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap index 1924391966..9ff835494c 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G101_1.py:6:9: G101 Logging statement uses an extra field that clashes with a LogRecord field: `name` +G101_1.py:6:9: G101 Logging statement uses an extra field that clashes with a LogRecord field: `name` | 6 | "Hello world!", 7 | extra={ diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap index 316c53b51a..25d1229a88 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G101_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G101_2.py:6:9: G101 Logging statement uses an extra field that clashes with a LogRecord field: `name` +G101_2.py:6:9: G101 Logging statement uses an extra field that clashes with a LogRecord field: `name` | 6 | "Hello world!", 7 | extra=dict( diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap index 72cc87d1a3..a92baa916a 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G201.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G201.py:8:13: G201 Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)` +G201.py:8:13: G201 Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)` | 8 | pass 9 | except: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 12 | try: | -./resources/test/fixtures/flake8_logging_format/G201.py:13:13: G201 Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)` +G201.py:13:13: G201 Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)` | 13 | pass 14 | except: diff --git a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap index 1bec8f67d1..0611eb541c 100644 --- a/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap +++ b/crates/ruff/src/rules/flake8_logging_format/snapshots/ruff__rules__flake8_logging_format__tests__G202.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_logging_format/mod.rs --- -./resources/test/fixtures/flake8_logging_format/G202.py:8:38: G202 Logging statement has redundant `exc_info` +G202.py:8:38: G202 Logging statement has redundant `exc_info` | 8 | pass 9 | except: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_logging_format/mod.rs 12 | try: | -./resources/test/fixtures/flake8_logging_format/G202.py:13:38: G202 Logging statement has redundant `exc_info` +G202.py:13:38: G202 Logging statement has redundant `exc_info` | 13 | pass 14 | except: diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap index 8f459b9309..b7e208fc6c 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_empty.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_no_pep420/mod.rs --- -./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py` is part of an implicit namespace package. Add an `__init__.py`. +example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_empty/example.py` is part of an implicit namespace package. Add an `__init__.py`. | | diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap index 3a17c5538f..a933366090 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_nonempty.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_no_pep420/mod.rs --- -./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py` is part of an implicit namespace package. Add an `__init__.py`. +example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_nonempty/example.py` is part of an implicit namespace package. Add an `__init__.py`. | 1 | print('hi') | INP001 diff --git a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap index 824bcfd6f0..49ef7c90a3 100644 --- a/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap +++ b/crates/ruff/src/rules/flake8_no_pep420/snapshots/ruff__rules__flake8_no_pep420__tests__test_fail_shebang.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_no_pep420/mod.rs --- -./resources/test/fixtures/flake8_no_pep420/test_fail_shebang/example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_shebang/example.py` is part of an implicit namespace package. Add an `__init__.py`. +example.py:1:1: INP001 File `./resources/test/fixtures/flake8_no_pep420/test_fail_shebang/example.py` is part of an implicit namespace package. Add an `__init__.py`. | 1 | #!/bin/env/python | INP001 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap index 5585ed2335..1d8eb9f4d8 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE790_PIE790.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE790.py:4:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:4:5: PIE790 [*] Unnecessary `pass` statement | 4 | """buzz""" 5 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 6 5 | 7 6 | if foo: -./resources/test/fixtures/flake8_pie/PIE790.py:9:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:9:5: PIE790 [*] Unnecessary `pass` statement | 9 | if foo: 10 | """foo""" @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 11 10 | 12 11 | def multi_statement() -> None: -./resources/test/fixtures/flake8_pie/PIE790.py:14:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:14:5: PIE790 [*] Unnecessary `pass` statement | 14 | def multi_statement() -> None: 15 | """This is a function.""" @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 16 16 | 17 17 | if foo: -./resources/test/fixtures/flake8_pie/PIE790.py:21:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:21:5: PIE790 [*] Unnecessary `pass` statement | 21 | else: 22 | """bar""" @@ -74,7 +74,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 23 22 | 24 23 | while True: -./resources/test/fixtures/flake8_pie/PIE790.py:28:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:28:5: PIE790 [*] Unnecessary `pass` statement | 28 | else: 29 | """bar""" @@ -92,7 +92,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 30 29 | 31 30 | for _ in range(10): -./resources/test/fixtures/flake8_pie/PIE790.py:35:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:35:5: PIE790 [*] Unnecessary `pass` statement | 35 | else: 36 | """bar""" @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 37 36 | 38 37 | async for _ in range(10): -./resources/test/fixtures/flake8_pie/PIE790.py:42:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:42:5: PIE790 [*] Unnecessary `pass` statement | 42 | else: 43 | """bar""" @@ -128,7 +128,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 44 43 | 45 44 | def foo() -> None: -./resources/test/fixtures/flake8_pie/PIE790.py:50:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:50:5: PIE790 [*] Unnecessary `pass` statement | 50 | """ 51 | @@ -146,7 +146,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 52 51 | 53 52 | async def foo(): -./resources/test/fixtures/flake8_pie/PIE790.py:58:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:58:5: PIE790 [*] Unnecessary `pass` statement | 58 | """ 59 | @@ -164,7 +164,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 60 59 | 61 60 | try: -./resources/test/fixtures/flake8_pie/PIE790.py:65:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:65:5: PIE790 [*] Unnecessary `pass` statement | 65 | buzz 66 | """ @@ -184,7 +184,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 67 66 | pass 68 67 | -./resources/test/fixtures/flake8_pie/PIE790.py:74:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:74:5: PIE790 [*] Unnecessary `pass` statement | 74 | except ValueError: 75 | """bar""" @@ -202,7 +202,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 76 75 | 77 76 | for _ in range(10): -./resources/test/fixtures/flake8_pie/PIE790.py:79:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:79:5: PIE790 [*] Unnecessary `pass` statement | 79 | for _ in range(10): 80 | """buzz""" @@ -222,7 +222,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 81 80 | async for _ in range(10): 82 81 | """buzz""" -./resources/test/fixtures/flake8_pie/PIE790.py:83:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:83:5: PIE790 [*] Unnecessary `pass` statement | 83 | async for _ in range(10): 84 | """buzz""" @@ -242,7 +242,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 85 84 | while cond: 86 85 | """buzz""" -./resources/test/fixtures/flake8_pie/PIE790.py:87:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:87:5: PIE790 [*] Unnecessary `pass` statement | 87 | while cond: 88 | """buzz""" @@ -260,7 +260,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 89 88 | 90 89 | with bar: -./resources/test/fixtures/flake8_pie/PIE790.py:92:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:92:5: PIE790 [*] Unnecessary `pass` statement | 92 | with bar: 93 | """buzz""" @@ -280,7 +280,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 94 93 | async with bar: 95 94 | """buzz""" -./resources/test/fixtures/flake8_pie/PIE790.py:96:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:96:5: PIE790 [*] Unnecessary `pass` statement | 96 | async with bar: 97 | """buzz""" @@ -298,7 +298,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 98 97 | 99 98 | def foo() -> None: -./resources/test/fixtures/flake8_pie/PIE790.py:101:5: PIE790 [*] Unnecessary `pass` statement +PIE790.py:101:5: PIE790 [*] Unnecessary `pass` statement | 101 | def foo() -> None: 102 | """buzz""" diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap index c8d7efa634..ad05e8eda7 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE794_PIE794.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE794.py:4:5: PIE794 [*] Class field `name` is defined multiple times +PIE794.py:4:5: PIE794 [*] Class field `name` is defined multiple times | 4 | name = StringField() 5 | # .... @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 6 5 | def remove(self) -> None: 7 6 | ... -./resources/test/fixtures/flake8_pie/PIE794.py:13:5: PIE794 [*] Class field `name` is defined multiple times +PIE794.py:13:5: PIE794 [*] Class field `name` is defined multiple times | 13 | name: str = StringField() 14 | # .... @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 15 14 | def foo(self) -> None: 16 15 | ... -./resources/test/fixtures/flake8_pie/PIE794.py:23:5: PIE794 [*] Class field `bar` is defined multiple times +PIE794.py:23:5: PIE794 [*] Class field `bar` is defined multiple times | 23 | foo: bool = BooleanField() 24 | # ... @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 25 24 | 26 25 | class User(BaseModel): -./resources/test/fixtures/flake8_pie/PIE794.py:40:5: PIE794 [*] Class field `bar` is defined multiple times +PIE794.py:40:5: PIE794 [*] Class field `bar` is defined multiple times | 40 | foo: bool = BooleanField() 41 | # ... diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap index 35e576a533..8101b5139c 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE796_PIE796.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE796.py:8:5: PIE796 Enum contains duplicate value: `"B"` +PIE796.py:8:5: PIE796 Enum contains duplicate value: `"B"` | 8 | A = "A" 9 | B = "B" @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs | ^^^^^^^ PIE796 | -./resources/test/fixtures/flake8_pie/PIE796.py:14:5: PIE796 Enum contains duplicate value: `2` +PIE796.py:14:5: PIE796 Enum contains duplicate value: `2` | 14 | A = 1 15 | B = 2 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs | ^^^^^ PIE796 | -./resources/test/fixtures/flake8_pie/PIE796.py:20:5: PIE796 Enum contains duplicate value: `"2"` +PIE796.py:20:5: PIE796 Enum contains duplicate value: `"2"` | 20 | A = "1" 21 | B = "2" @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs | ^^^^^^^ PIE796 | -./resources/test/fixtures/flake8_pie/PIE796.py:26:5: PIE796 Enum contains duplicate value: `2.5` +PIE796.py:26:5: PIE796 Enum contains duplicate value: `2.5` | 26 | A = 1.0 27 | B = 2.5 @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs | ^^^^^^^ PIE796 | -./resources/test/fixtures/flake8_pie/PIE796.py:33:5: PIE796 Enum contains duplicate value: `False` +PIE796.py:33:5: PIE796 Enum contains duplicate value: `False` | 33 | B = True 34 | C = False @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs | ^^^^^^^^^ PIE796 | -./resources/test/fixtures/flake8_pie/PIE796.py:40:5: PIE796 Enum contains duplicate value: `None` +PIE796.py:40:5: PIE796 Enum contains duplicate value: `None` | 40 | B = 2 41 | C = None @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs | ^^^^^^^^ PIE796 | -./resources/test/fixtures/flake8_pie/PIE796.py:54:5: PIE796 Enum contains duplicate value: `2` +PIE796.py:54:5: PIE796 Enum contains duplicate value: `2` | 54 | A = 1 55 | B = 2 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap index 5a2d589a20..9c74fcdce9 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE800_PIE800.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE800.py:1:14: PIE800 Unnecessary spread `**` +PIE800.py:1:14: PIE800 Unnecessary spread `**` | 1 | {"foo": 1, **{"bar": 1}} # PIE800 | ^^^^^^^^^^ PIE800 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 3 | foo({**foo, **{"bar": True}}) # PIE800 | -./resources/test/fixtures/flake8_pie/PIE800.py:3:15: PIE800 Unnecessary spread `**` +PIE800.py:3:15: PIE800 Unnecessary spread `**` | 3 | {"foo": 1, **{"bar": 1}} # PIE800 4 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 7 | {**foo, **{"bar": 10}} # PIE800 | -./resources/test/fixtures/flake8_pie/PIE800.py:5:11: PIE800 Unnecessary spread `**` +PIE800.py:5:11: PIE800 Unnecessary spread `**` | 5 | foo({**foo, **{"bar": True}}) # PIE800 6 | @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 9 | {**foo, **buzz, **{bar: 10}} # PIE800 | -./resources/test/fixtures/flake8_pie/PIE800.py:7:19: PIE800 Unnecessary spread `**` +PIE800.py:7:19: PIE800 Unnecessary spread `**` | 7 | {**foo, **{"bar": 10}} # PIE800 8 | diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap index 90cfe53bb5..47ad306ee2 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE802_PIE802.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE802.py:2:5: PIE802 [*] Unnecessary list comprehension. +PIE802.py:2:5: PIE802 [*] Unnecessary list comprehension. | 2 | # PIE802 3 | any([x.id for x in bar]) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 4 4 | any( # first comment 5 5 | [x.id for x in bar], # second comment -./resources/test/fixtures/flake8_pie/PIE802.py:3:5: PIE802 [*] Unnecessary list comprehension. +PIE802.py:3:5: PIE802 [*] Unnecessary list comprehension. | 3 | # PIE802 4 | any([x.id for x in bar]) @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 5 5 | [x.id for x in bar], # second comment 6 6 | ) # third comment -./resources/test/fixtures/flake8_pie/PIE802.py:5:5: PIE802 [*] Unnecessary list comprehension. +PIE802.py:5:5: PIE802 [*] Unnecessary list comprehension. | 5 | all([x.id for x in bar]) 6 | any( # first comment @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 7 7 | all( # first comment 8 8 | [x.id for x in bar], # second comment -./resources/test/fixtures/flake8_pie/PIE802.py:8:5: PIE802 [*] Unnecessary list comprehension. +PIE802.py:8:5: PIE802 [*] Unnecessary list comprehension. | 8 | ) # third comment 9 | all( # first comment @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 10 10 | any({x.id for x in bar}) 11 11 | -./resources/test/fixtures/flake8_pie/PIE802.py:10:5: PIE802 [*] Unnecessary list comprehension. +PIE802.py:10:5: PIE802 [*] Unnecessary list comprehension. | 10 | [x.id for x in bar], # second comment 11 | ) # third comment diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap index 89fd3ad259..7b6f028e21 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE804_PIE804.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE804.py:1:1: PIE804 Unnecessary `dict` kwargs +PIE804.py:1:1: PIE804 Unnecessary `dict` kwargs | 1 | foo(**{"bar": True}) # PIE804 | ^^^^^^^^^^^^^^^^^^^^ PIE804 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 3 | foo(**{"r2d2": True}) # PIE804 | -./resources/test/fixtures/flake8_pie/PIE804.py:3:1: PIE804 Unnecessary `dict` kwargs +PIE804.py:3:1: PIE804 Unnecessary `dict` kwargs | 3 | foo(**{"bar": True}) # PIE804 4 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 7 | Foo.objects.create(**{"bar": True}) # PIE804 | -./resources/test/fixtures/flake8_pie/PIE804.py:5:1: PIE804 Unnecessary `dict` kwargs +PIE804.py:5:1: PIE804 Unnecessary `dict` kwargs | 5 | foo(**{"r2d2": True}) # PIE804 6 | @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 9 | Foo.objects.create(**{"_id": some_id}) # PIE804 | -./resources/test/fixtures/flake8_pie/PIE804.py:7:1: PIE804 Unnecessary `dict` kwargs +PIE804.py:7:1: PIE804 Unnecessary `dict` kwargs | 7 | Foo.objects.create(**{"bar": True}) # PIE804 8 | @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 11 | Foo.objects.create(**{**bar}) # PIE804 | -./resources/test/fixtures/flake8_pie/PIE804.py:9:1: PIE804 Unnecessary `dict` kwargs +PIE804.py:9:1: PIE804 Unnecessary `dict` kwargs | 9 | Foo.objects.create(**{"_id": some_id}) # PIE804 10 | diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap index e98bd4b5a2..82bc88464a 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE807_PIE807.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE807.py:3:44: PIE807 [*] Prefer `list` over useless lambda +PIE807.py:3:44: PIE807 [*] Prefer `list` over useless lambda | 3 | @dataclass 4 | class Foo: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 5 5 | 6 6 | class FooTable(BaseTable): -./resources/test/fixtures/flake8_pie/PIE807.py:7:36: PIE807 [*] Prefer `list` over useless lambda +PIE807.py:7:36: PIE807 [*] Prefer `list` over useless lambda | 7 | class FooTable(BaseTable): 8 | bar = fields.ListField(default=lambda: []) # PIE807 @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 9 9 | 10 10 | class FooTable(BaseTable): -./resources/test/fixtures/flake8_pie/PIE807.py:11:28: PIE807 [*] Prefer `list` over useless lambda +PIE807.py:11:28: PIE807 [*] Prefer `list` over useless lambda | 11 | class FooTable(BaseTable): 12 | bar = fields.ListField(lambda: []) # PIE807 diff --git a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap index 371b47fc3f..4d511af2bc 100644 --- a/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap +++ b/crates/ruff/src/rules/flake8_pie/snapshots/ruff__rules__flake8_pie__tests__PIE810_PIE810.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pie/mod.rs --- -./resources/test/fixtures/flake8_pie/PIE810.py:2:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:2:1: PIE810 [*] Call `startswith` once with a `tuple` | 2 | # error 3 | obj.startswith("foo") or obj.startswith("bar") @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 4 4 | obj.endswith("foo") or obj.endswith("bar") 5 5 | # error -./resources/test/fixtures/flake8_pie/PIE810.py:4:1: PIE810 [*] Call `endswith` once with a `tuple` +PIE810.py:4:1: PIE810 [*] Call `endswith` once with a `tuple` | 4 | obj.startswith("foo") or obj.startswith("bar") 5 | # error @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 6 6 | obj.startswith(foo) or obj.startswith(bar) 7 7 | # error -./resources/test/fixtures/flake8_pie/PIE810.py:6:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:6:1: PIE810 [*] Call `startswith` once with a `tuple` | 6 | obj.endswith("foo") or obj.endswith("bar") 7 | # error @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 8 8 | obj.startswith(foo) or obj.startswith("foo") 9 9 | # error -./resources/test/fixtures/flake8_pie/PIE810.py:8:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:8:1: PIE810 [*] Call `startswith` once with a `tuple` | 8 | obj.startswith(foo) or obj.startswith(bar) 9 | # error @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/flake8_pie/mod.rs 10 10 | obj.endswith(foo) or obj.startswith(foo) or obj.startswith("foo") 11 11 | -./resources/test/fixtures/flake8_pie/PIE810.py:10:1: PIE810 [*] Call `startswith` once with a `tuple` +PIE810.py:10:1: PIE810 [*] Call `startswith` once with a `tuple` | 10 | obj.startswith(foo) or obj.startswith("foo") 11 | # error diff --git a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap index ab6e0ab519..0964c12e87 100644 --- a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap +++ b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T201_T201.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_print/mod.rs --- -./resources/test/fixtures/flake8_print/T201.py:4:1: T201 `print` found +T201.py:4:1: T201 `print` found | 4 | import tempfile 5 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_print/mod.rs 8 | print("Hello, world!", file=sys.stdout) # T201 | -./resources/test/fixtures/flake8_print/T201.py:5:1: T201 `print` found +T201.py:5:1: T201 `print` found | 5 | print("Hello, world!") # T201 6 | print("Hello, world!", file=None) # T201 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_print/mod.rs 8 | print("Hello, world!", file=sys.stderr) # T201 | -./resources/test/fixtures/flake8_print/T201.py:6:1: T201 `print` found +T201.py:6:1: T201 `print` found | 6 | print("Hello, world!") # T201 7 | print("Hello, world!", file=None) # T201 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_print/mod.rs 9 | print("Hello, world!", file=sys.stderr) # T201 | -./resources/test/fixtures/flake8_print/T201.py:7:1: T201 `print` found +T201.py:7:1: T201 `print` found | 7 | print("Hello, world!", file=None) # T201 8 | print("Hello, world!", file=sys.stdout) # T201 diff --git a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap index e221c5495c..fd4f04c68d 100644 --- a/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap +++ b/crates/ruff/src/rules/flake8_print/snapshots/ruff__rules__flake8_print__tests__T203_T203.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_print/mod.rs --- -./resources/test/fixtures/flake8_print/T203.py:3:1: T203 `pprint` found +T203.py:3:1: T203 `pprint` found | 3 | from pprint import pprint 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_print/mod.rs 7 | import pprint | -./resources/test/fixtures/flake8_print/T203.py:7:1: T203 `pprint` found +T203.py:7:1: T203 `pprint` found | 7 | import pprint 8 | diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap index 2a36150797..6e12058401 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI001_PYI001.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI001.pyi:3:5: PYI001 Name of private `TypeVar` must start with `_` +PYI001.pyi:3:5: PYI001 Name of private `TypeVar` must start with `_` | 3 | from typing import ParamSpec, TypeVar, TypeVarTuple 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 7 | TTuple = TypeVarTuple("TTuple") # Error: TypeVarTuples must also start with _ | -./resources/test/fixtures/flake8_pyi/PYI001.pyi:5:10: PYI001 Name of private `TypeVarTuple` must start with `_` +PYI001.pyi:5:10: PYI001 Name of private `TypeVarTuple` must start with `_` | 5 | T = TypeVar("T") # Error: TypeVars in stubs must start with _ 6 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 9 | P = ParamSpec("P") # Error: ParamSpecs must start with _ | -./resources/test/fixtures/flake8_pyi/PYI001.pyi:7:5: PYI001 Name of private `ParamSpec` must start with `_` +PYI001.pyi:7:5: PYI001 Name of private `ParamSpec` must start with `_` | 7 | TTuple = TypeVarTuple("TTuple") # Error: TypeVarTuples must also start with _ 8 | diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap index aa6fc6319c..51a983587c 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI006_PYI006.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI006.pyi:8:4: PYI006 Use `<` or `>=` for version info comparisons +PYI006.pyi:8:4: PYI006 Use `<` or `>=` for version info comparisons | 8 | if sys.version_info >= (3, 9): ... # OK 9 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 12 | if sys.version_info == (3, 9): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons | -./resources/test/fixtures/flake8_pyi/PYI006.pyi:10:4: PYI006 Use `<` or `>=` for version info comparisons +PYI006.pyi:10:4: PYI006 Use `<` or `>=` for version info comparisons | 10 | if sys.version_info == (3, 9): ... # OK 11 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 14 | if sys.version_info <= (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons | -./resources/test/fixtures/flake8_pyi/PYI006.pyi:12:4: PYI006 Use `<` or `>=` for version info comparisons +PYI006.pyi:12:4: PYI006 Use `<` or `>=` for version info comparisons | 12 | if sys.version_info == (3, 9): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons 13 | @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 16 | if sys.version_info <= (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons | -./resources/test/fixtures/flake8_pyi/PYI006.pyi:14:4: PYI006 Use `<` or `>=` for version info comparisons +PYI006.pyi:14:4: PYI006 Use `<` or `>=` for version info comparisons | 14 | if sys.version_info <= (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons 15 | @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 18 | if sys.version_info > (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons | -./resources/test/fixtures/flake8_pyi/PYI006.pyi:16:4: PYI006 Use `<` or `>=` for version info comparisons +PYI006.pyi:16:4: PYI006 Use `<` or `>=` for version info comparisons | 16 | if sys.version_info <= (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons 17 | @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 20 | if python_version > (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons | -./resources/test/fixtures/flake8_pyi/PYI006.pyi:18:4: PYI006 Use `<` or `>=` for version info comparisons +PYI006.pyi:18:4: PYI006 Use `<` or `>=` for version info comparisons | 18 | if sys.version_info > (3, 10): ... # Error: PYI006 Use only `<` and `>=` for version info comparisons 19 | diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap index 0b03d6b3e9..75c5a93f1b 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI007_PYI007.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI007.pyi:7:4: PYI007 Unrecognized `sys.platform` check +PYI007.pyi:7:4: PYI007 Unrecognized `sys.platform` check | 7 | if sys.platform != "platform_name_2": ... # OK 8 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 11 | if sys.platform > 3: ... # Error: PYI007 Unrecognized sys.platform check | -./resources/test/fixtures/flake8_pyi/PYI007.pyi:9:4: PYI007 Unrecognized `sys.platform` check +PYI007.pyi:9:4: PYI007 Unrecognized `sys.platform` check | 9 | if sys.platform in ["linux"]: ... # Error: PYI007 Unrecognized sys.platform check 10 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 13 | if sys.platform == 10.12: ... # Error: PYI007 Unrecognized sys.platform check | -./resources/test/fixtures/flake8_pyi/PYI007.pyi:11:4: PYI007 Unrecognized `sys.platform` check +PYI007.pyi:11:4: PYI007 Unrecognized `sys.platform` check | 11 | if sys.platform > 3: ... # Error: PYI007 Unrecognized sys.platform check 12 | diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap index 6330813828..d8a605b91a 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI008_PYI008.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI008.pyi:3:20: PYI008 Unrecognized platform `linus` +PYI008.pyi:3:20: PYI008 Unrecognized platform `linus` | 3 | import sys 4 | diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap index 7ae750aa5e..edabe9cf80 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI009_PYI009.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI009.pyi:3:5: PYI009 Empty body should contain `...`, not `pass` +PYI009.pyi:3:5: PYI009 Empty body should contain `...`, not `pass` | 3 | def bar(): ... # OK 4 | def foo(): @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 7 | class Bar: ... # OK | -./resources/test/fixtures/flake8_pyi/PYI009.pyi:8:5: PYI009 Empty body should contain `...`, not `pass` +PYI009.pyi:8:5: PYI009 Empty body should contain `...`, not `pass` | 8 | class Foo: 9 | pass # ERROR PYI009, since we're in a stub file diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap index 8316303ff3..965f11e081 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI010_PYI010.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI010.pyi:6:5: PYI010 Function body must contain only `...` +PYI010.pyi:6:5: PYI010 Function body must contain only `...` | 6 | def buzz(): 7 | print("buzz") # ERROR PYI010 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 9 | def foo2(): | -./resources/test/fixtures/flake8_pyi/PYI010.pyi:9:5: PYI010 Function body must contain only `...` +PYI010.pyi:9:5: PYI010 Function body must contain only `...` | 9 | def foo2(): 10 | 123 # ERROR PYI010 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 12 | def bizz(): | -./resources/test/fixtures/flake8_pyi/PYI010.pyi:12:5: PYI010 Function body must contain only `...` +PYI010.pyi:12:5: PYI010 Function body must contain only `...` | 12 | def bizz(): 13 | x = 123 # ERROR PYI010 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap index 28ddba4319..283b088ffc 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI011_PYI011.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI011.pyi:10:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:10:14: PYI011 [*] Only simple default values allowed for typed arguments | 10 | def f12( 11 | x, @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 12 12 | def f11(*, x: str = "x") -> None: ... # OK 13 13 | def f13( -./resources/test/fixtures/flake8_pyi/PYI011.pyi:38:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:38:9: PYI011 [*] Only simple default values allowed for typed arguments | 38 | x: dict[ 39 | int, int @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 43 40 | def f153( 44 41 | x: list[ -./resources/test/fixtures/flake8_pyi/PYI011.pyi:46:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:46:9: PYI011 [*] Only simple default values allowed for typed arguments | 46 | x: list[ 47 | int @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 60 48 | def f154( 61 49 | x: tuple[ -./resources/test/fixtures/flake8_pyi/PYI011.pyi:63:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:63:9: PYI011 [*] Only simple default values allowed for typed arguments | 63 | x: tuple[ 64 | str, tuple[str, ...] @@ -124,7 +124,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 68 65 | def f141( 69 66 | x: list[ -./resources/test/fixtures/flake8_pyi/PYI011.pyi:71:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:71:9: PYI011 [*] Only simple default values allowed for typed arguments | 71 | x: list[ 72 | int @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 75 73 | def f142( 76 74 | x: list[ -./resources/test/fixtures/flake8_pyi/PYI011.pyi:78:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:78:9: PYI011 [*] Only simple default values allowed for typed arguments | 78 | x: list[ 79 | int @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 82 80 | def f16( 83 81 | x: frozenset[ -./resources/test/fixtures/flake8_pyi/PYI011.pyi:85:9: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:85:9: PYI011 [*] Only simple default values allowed for typed arguments | 85 | x: frozenset[ 86 | bytes @@ -202,7 +202,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 89 87 | def f17( 90 88 | x: str = "foo" # Error PYI011 Only simple default values allowed for typed arguments -./resources/test/fixtures/flake8_pyi/PYI011.pyi:90:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:90:14: PYI011 [*] Only simple default values allowed for typed arguments | 90 | ) -> None: ... 91 | def f17( @@ -226,7 +226,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 93 92 | def f18( 94 93 | x: str = b"foo" # Error PYI011 Only simple default values allowed for typed arguments -./resources/test/fixtures/flake8_pyi/PYI011.pyi:94:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:94:14: PYI011 [*] Only simple default values allowed for typed arguments | 94 | ) -> None: ... 95 | def f18( @@ -250,7 +250,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 97 96 | def f19( 98 97 | x: object = "foo" # Error PYI011 Only simple default values allowed for typed arguments -./resources/test/fixtures/flake8_pyi/PYI011.pyi:98:17: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:98:17: PYI011 [*] Only simple default values allowed for typed arguments | 98 | ) -> None: ... 99 | def f19( @@ -274,7 +274,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 101 100 | def f20( 102 101 | x: int = 5 -./resources/test/fixtures/flake8_pyi/PYI011.pyi:102:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:102:14: PYI011 [*] Only simple default values allowed for typed arguments | 102 | ) -> None: ... 103 | def f20( @@ -298,7 +298,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 105 104 | def f21( 106 105 | x: complex = 3j -./resources/test/fixtures/flake8_pyi/PYI011.pyi:106:18: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:106:18: PYI011 [*] Only simple default values allowed for typed arguments | 106 | ) -> None: ... 107 | def f21( @@ -322,7 +322,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 109 108 | def f22( 110 109 | x: complex = -42.5j # Error PYI011 Only simple default values allowed for typed arguments -./resources/test/fixtures/flake8_pyi/PYI011.pyi:110:18: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:110:18: PYI011 [*] Only simple default values allowed for typed arguments | 110 | ) -> None: ... 111 | def f22( @@ -346,7 +346,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 113 112 | def f23( 114 113 | x: bool = True, # OK -./resources/test/fixtures/flake8_pyi/PYI011.pyi:138:16: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:138:16: PYI011 [*] Only simple default values allowed for typed arguments | 138 | ) -> None: ... 139 | def f31( @@ -367,7 +367,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 140 140 | def f32( 141 141 | x: float = np.inf, # Error PYI011 Only simple default values allowed for typed arguments -./resources/test/fixtures/flake8_pyi/PYI011.pyi:141:16: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:141:16: PYI011 [*] Only simple default values allowed for typed arguments | 141 | ) -> None: ... 142 | def f32( @@ -388,7 +388,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 143 143 | def f33( 144 144 | x: float = math.nan, # OK -./resources/test/fixtures/flake8_pyi/PYI011.pyi:147:16: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:147:16: PYI011 [*] Only simple default values allowed for typed arguments | 147 | ) -> None: ... 148 | def f34( @@ -409,7 +409,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 149 149 | def f35( 150 150 | x: complex = math.inf # Error PYI011 Only simple default values allowed for typed arguments -./resources/test/fixtures/flake8_pyi/PYI011.pyi:150:18: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:150:18: PYI011 [*] Only simple default values allowed for typed arguments | 150 | ) -> None: ... 151 | def f35( @@ -433,7 +433,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 153 152 | def f36( 154 153 | *, -./resources/test/fixtures/flake8_pyi/PYI011.pyi:159:14: PYI011 [*] Only simple default values allowed for typed arguments +PYI011.pyi:159:14: PYI011 [*] Only simple default values allowed for typed arguments | 159 | def f37( 160 | *, diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI012_PYI012.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI012_PYI012.pyi.snap index 3a14cc43c0..b73c948b90 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI012_PYI012.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI012_PYI012.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI012.pyi:5:5: PYI012 [*] Class body must not contain `pass` +PYI012.pyi:5:5: PYI012 [*] Class body must not contain `pass` | 5 | class OneAttributeClass: 6 | value: int @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 7 6 | class OneAttributeClassRev: 8 7 | pass # PYI012 Class body must not contain `pass` -./resources/test/fixtures/flake8_pyi/PYI012.pyi:8:5: PYI012 [*] Class body must not contain `pass` +PYI012.pyi:8:5: PYI012 [*] Class body must not contain `pass` | 8 | class OneAttributeClassRev: 9 | pass # PYI012 Class body must not contain `pass` @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 10 9 | 11 10 | class DocstringClass: -./resources/test/fixtures/flake8_pyi/PYI012.pyi:16:5: PYI012 [*] Class body must not contain `pass` +PYI012.pyi:16:5: PYI012 [*] Class body must not contain `pass` | 16 | """ 17 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 18 17 | class NonEmptyChild(Exception): 19 18 | value: int -./resources/test/fixtures/flake8_pyi/PYI012.pyi:20:5: PYI012 [*] Class body must not contain `pass` +PYI012.pyi:20:5: PYI012 [*] Class body must not contain `pass` | 20 | class NonEmptyChild(Exception): 21 | value: int @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 22 21 | class NonEmptyChild2(Exception): 23 22 | pass # PYI012 Class body must not contain `pass` -./resources/test/fixtures/flake8_pyi/PYI012.pyi:23:5: PYI012 [*] Class body must not contain `pass` +PYI012.pyi:23:5: PYI012 [*] Class body must not contain `pass` | 23 | class NonEmptyChild2(Exception): 24 | pass # PYI012 Class body must not contain `pass` @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 25 24 | 26 25 | class NonEmptyWithInit: -./resources/test/fixtures/flake8_pyi/PYI012.pyi:28:5: PYI012 [*] Class body must not contain `pass` +PYI012.pyi:28:5: PYI012 [*] Class body must not contain `pass` | 28 | class NonEmptyWithInit: 29 | value: int diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap index ea9f4fcbed..6f3e2a7aab 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI014_PYI014.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI014.pyi:3:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:3:7: PYI014 [*] Only simple default values allowed for arguments | 3 | def f12( 4 | x, @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 5 5 | def f11(*, x="x") -> None: ... # OK 6 6 | def f13( -./resources/test/fixtures/flake8_pyi/PYI014.pyi:29:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:29:7: PYI014 [*] Only simple default values allowed for arguments | 29 | def f151(x={1: 2}) -> None: ... 30 | def f152( @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 34 31 | def f153( 35 32 | x=[ # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:35:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:35:7: PYI014 [*] Only simple default values allowed for arguments | 35 | ) -> None: ... 36 | def f153( @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 49 37 | def f154( 50 38 | x=( # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:50:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:50:7: PYI014 [*] Only simple default values allowed for arguments | 50 | ) -> None: ... 51 | def f154( @@ -123,7 +123,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 55 52 | def f141( 56 53 | x=[*range(10)], # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:56:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:56:7: PYI014 [*] Only simple default values allowed for arguments | 56 | ) -> None: ... 57 | def f141( @@ -144,7 +144,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 58 58 | def f142( 59 59 | x=list(range(10)), # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:59:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:59:7: PYI014 [*] Only simple default values allowed for arguments | 59 | ) -> None: ... 60 | def f142( @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 61 61 | def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None: ... # Error PYI014 62 62 | def f17( -./resources/test/fixtures/flake8_pyi/PYI014.pyi:61:11: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:61:11: PYI014 [*] Only simple default values allowed for arguments | 61 | x=list(range(10)), # Error PYI014 62 | ) -> None: ... @@ -186,7 +186,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 63 63 | x="foo" + "bar", # Error PYI014 64 64 | ) -> None: ... -./resources/test/fixtures/flake8_pyi/PYI014.pyi:63:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:63:7: PYI014 [*] Only simple default values allowed for arguments | 63 | def f16(x=frozenset({b"foo", b"bar", b"baz"})) -> None: ... # Error PYI014 64 | def f17( @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 65 65 | def f18( 66 66 | x=b"foo" + b"bar", # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:66:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:66:7: PYI014 [*] Only simple default values allowed for arguments | 66 | ) -> None: ... 67 | def f18( @@ -228,7 +228,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 68 68 | def f19( 69 69 | x="foo" + 4, # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:69:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:69:7: PYI014 [*] Only simple default values allowed for arguments | 69 | ) -> None: ... 70 | def f19( @@ -249,7 +249,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 71 71 | def f20( 72 72 | x=5 + 5, # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:72:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:72:7: PYI014 [*] Only simple default values allowed for arguments | 72 | ) -> None: ... 73 | def f20( @@ -270,7 +270,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 74 74 | def f21( 75 75 | x=3j - 3j, # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:75:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:75:7: PYI014 [*] Only simple default values allowed for arguments | 75 | ) -> None: ... 76 | def f21( @@ -291,7 +291,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 77 77 | def f22( 78 78 | x=-42.5j + 4.3j, # Error PYI014 -./resources/test/fixtures/flake8_pyi/PYI014.pyi:78:7: PYI014 [*] Only simple default values allowed for arguments +PYI014.pyi:78:7: PYI014 [*] Only simple default values allowed for arguments | 78 | ) -> None: ... 79 | def f22( diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap index 2b492bb778..61b5cc6dec 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI015_PYI015.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI015.pyi:44:23: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:44:23: PYI015 [*] Only simple default values allowed for assignments | 44 | # We *should* emit Y015 for more complex default values 45 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] # Y015 Only simple default values are allowed for assignments @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 46 46 | field224: list[int] = list(range(10)) # Y015 Only simple default values are allowed for assignments 47 47 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:45:23: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:45:23: PYI015 [*] Only simple default values allowed for assignments | 45 | # We *should* emit Y015 for more complex default values 46 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] # Y015 Only simple default values are allowed for assignments @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 47 47 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments 48 48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:46:23: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:46:23: PYI015 [*] Only simple default values allowed for assignments | 46 | field221: list[int] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] # Y015 Only simple default values are allowed for assignments 47 | field223: list[int] = [*range(10)] # Y015 Only simple default values are allowed for assignments @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 48 48 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments 49 49 | field227: dict[str, object] = {"foo": {"foo": "bar"}} # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:47:26: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:47:26: PYI015 [*] Only simple default values allowed for assignments | 47 | field223: list[int] = [*range(10)] # Y015 Only simple default values are allowed for assignments 48 | field224: list[int] = list(range(10)) # Y015 Only simple default values are allowed for assignments @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 49 49 | field227: dict[str, object] = {"foo": {"foo": "bar"}} # Y015 Only simple default values are allowed for assignments 50 50 | field228: dict[str, list[object]] = {"foo": []} # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:48:47: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:48:47: PYI015 [*] Only simple default values allowed for assignments | 48 | field224: list[int] = list(range(10)) # Y015 Only simple default values are allowed for assignments 49 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 50 50 | field228: dict[str, list[object]] = {"foo": []} # Y015 Only simple default values are allowed for assignments 51 51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node -./resources/test/fixtures/flake8_pyi/PYI015.pyi:49:31: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:49:31: PYI015 [*] Only simple default values allowed for assignments | 49 | field225: list[object] = [{}, 1, 2] # Y015 Only simple default values are allowed for assignments 50 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 51 51 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node 52 52 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:50:37: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:50:37: PYI015 [*] Only simple default values allowed for assignments | 50 | field226: tuple[str | tuple[str, ...], ...] = ("foo", ("foo", "bar")) # Y015 Only simple default values are allowed for assignments 51 | field227: dict[str, object] = {"foo": {"foo": "bar"}} # Y015 Only simple default values are allowed for assignments @@ -147,7 +147,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 52 52 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments 53 53 | field23 = "foo" + "bar" # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:52:28: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:52:28: PYI015 [*] Only simple default values allowed for assignments | 52 | field228: dict[str, list[object]] = {"foo": []} # Y015 Only simple default values are allowed for assignments 53 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 54 54 | field24 = b"foo" + b"bar" # Y015 Only simple default values are allowed for assignments 55 55 | field25 = 5 * 5 # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:53:11: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:53:11: PYI015 [*] Only simple default values allowed for assignments | 53 | # When parsed, this case results in `None` being placed in the `.keys` list for the `ast.Dict` node 54 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 54 54 | field24 = b"foo" + b"bar" # Y015 Only simple default values are allowed for assignments 55 55 | field25 = 5 * 5 # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:54:11: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:54:11: PYI015 [*] Only simple default values allowed for assignments | 54 | field229: dict[int, int] = {1: 2, **{3: 4}} # Y015 Only simple default values are allowed for assignments 55 | field23 = "foo" + "bar" # Y015 Only simple default values are allowed for assignments @@ -206,7 +206,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 54 |+field24 = ... # Y015 Only simple default values are allowed for assignments 55 55 | field25 = 5 * 5 # Y015 Only simple default values are allowed for assignments -./resources/test/fixtures/flake8_pyi/PYI015.pyi:55:11: PYI015 [*] Only simple default values allowed for assignments +PYI015.pyi:55:11: PYI015 [*] Only simple default values allowed for assignments | 55 | field23 = "foo" + "bar" # Y015 Only simple default values are allowed for assignments 56 | field24 = b"foo" + b"bar" # Y015 Only simple default values are allowed for assignments diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap index e58a7ddd2e..0f99836f18 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI021_PYI021.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI021.pyi:1:1: PYI021 Docstrings should not be included in stubs +PYI021.pyi:1:1: PYI021 Docstrings should not be included in stubs | 1 | """foo""" # ERROR PYI021 | ^^^^^^^^^ PYI021 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 3 | def foo(): | -./resources/test/fixtures/flake8_pyi/PYI021.pyi:4:5: PYI021 Docstrings should not be included in stubs +PYI021.pyi:4:5: PYI021 Docstrings should not be included in stubs | 4 | def foo(): 5 | """foo""" # ERROR PYI021 @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 7 | class Bar: | -./resources/test/fixtures/flake8_pyi/PYI021.pyi:7:5: PYI021 Docstrings should not be included in stubs +PYI021.pyi:7:5: PYI021 Docstrings should not be included in stubs | 7 | class Bar: 8 | """bar""" # ERROR PYI021 diff --git a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap index e0c02bfe62..9d6e85a8fc 100644 --- a/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap +++ b/crates/ruff/src/rules/flake8_pyi/snapshots/ruff__rules__flake8_pyi__tests__PYI033_PYI033.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pyi/mod.rs --- -./resources/test/fixtures/flake8_pyi/PYI033.pyi:6:22: PYI033 Don't use type comments in stub file +PYI033.pyi:6:22: PYI033 Don't use type comments in stub file | 6 | from typing import TypeAlias 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 10 | C: TypeAlias = None #type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:7:22: PYI033 Don't use type comments in stub file +PYI033.pyi:7:22: PYI033 Don't use type comments in stub file | 7 | A: TypeAlias = None # type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") 8 | B: TypeAlias = None # type: str # And here's an extra comment about why it's that type # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 10 | D: TypeAlias = None # type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:8:22: PYI033 Don't use type comments in stub file +PYI033.pyi:8:22: PYI033 Don't use type comments in stub file | 8 | A: TypeAlias = None # type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") 9 | B: TypeAlias = None # type: str # And here's an extra comment about why it's that type # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 12 | E: TypeAlias = None# type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:9:22: PYI033 Don't use type comments in stub file +PYI033.pyi:9:22: PYI033 Don't use type comments in stub file | 9 | B: TypeAlias = None # type: str # And here's an extra comment about why it's that type # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") 10 | C: TypeAlias = None #type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 13 | F: TypeAlias = None#type:int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:10:20: PYI033 Don't use type comments in stub file +PYI033.pyi:10:20: PYI033 Don't use type comments in stub file | 10 | C: TypeAlias = None #type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") 11 | D: TypeAlias = None # type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 13 | F: TypeAlias = None#type:int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:11:20: PYI033 Don't use type comments in stub file +PYI033.pyi:11:20: PYI033 Don't use type comments in stub file | 11 | D: TypeAlias = None # type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") 12 | E: TypeAlias = None# type: int # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 15 | def func( | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:14:12: PYI033 Don't use type comments in stub file +PYI033.pyi:14:12: PYI033 Don't use type comments in stub file | 14 | def func( 15 | arg1, # type: dict[str, int] # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 17 | ): ... | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:15:11: PYI033 Don't use type comments in stub file +PYI033.pyi:15:11: PYI033 Don't use type comments in stub file | 15 | def func( 16 | arg1, # type: dict[str, int] # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 18 | ): ... | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:19:29: PYI033 Don't use type comments in stub file +PYI033.pyi:19:29: PYI033 Don't use type comments in stub file | 19 | class Foo: 20 | Attr: TypeAlias = None # type: set[str] # Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int") @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 22 | G: TypeAlias = None # type: ignore | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:29:22: PYI033 Don't use type comments in stub file +PYI033.pyi:29:22: PYI033 Don't use type comments in stub file | 29 | # Whole line commented out # type: int 30 | M: TypeAlias = None # type: can't parse me! @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/flake8_pyi/mod.rs 32 | class Bar: | -./resources/test/fixtures/flake8_pyi/PYI033.pyi:32:26: PYI033 Don't use type comments in stub file +PYI033.pyi:32:26: PYI033 Don't use type comments in stub file | 32 | class Bar: 33 | N: TypeAlias = None # type: can't parse me either! diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap index 7bceca2b91..434880490e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_default.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT001.py:9:2: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` +PT001.py:9:2: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` | 9 | @pytest.fixture | ^^^^^^^^^^^^^^ PT001 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 11 11 | return 42 12 12 | -./resources/test/fixtures/flake8_pytest_style/PT001.py:34:2: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` +PT001.py:34:2: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` | 34 | @fixture | ^^^^^^^ PT001 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 36 36 | return 42 37 37 | -./resources/test/fixtures/flake8_pytest_style/PT001.py:59:2: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` +PT001.py:59:2: PT001 [*] Use `@pytest.fixture()` over `@pytest.fixture` | 59 | @aliased | ^^^^^^^ PT001 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap index d45d170371..7732c59b2f 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT001_no_parentheses.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT001.py:14:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` +PT001.py:14:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` | 14 | @pytest.fixture() | ^^^^^^^^^^^^^^^^ PT001 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 16 | return 42 17 17 | -./resources/test/fixtures/flake8_pytest_style/PT001.py:24:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` +PT001.py:24:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` | 24 | @pytest.fixture( | __^ @@ -44,7 +44,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 28 26 | return 42 29 27 | -./resources/test/fixtures/flake8_pytest_style/PT001.py:39:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` +PT001.py:39:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` | 39 | @fixture() | ^^^^^^^^^ PT001 @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 41 41 | return 42 42 42 | -./resources/test/fixtures/flake8_pytest_style/PT001.py:49:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` +PT001.py:49:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` | 49 | @fixture( | __^ @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 53 51 | return 42 54 52 | -./resources/test/fixtures/flake8_pytest_style/PT001.py:64:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` +PT001.py:64:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` | 64 | @aliased() | ^^^^^^^^^ PT001 @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 66 66 | return 42 67 67 | -./resources/test/fixtures/flake8_pytest_style/PT001.py:74:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` +PT001.py:74:2: PT001 [*] Use `@pytest.fixture` over `@pytest.fixture()` | 74 | @aliased( | __^ diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap index 7f4016301e..4f923db4cd 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT002.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT002.py:14:2: PT002 Configuration for fixture `my_fixture` specified via positional args, use kwargs +PT002.py:14:2: PT002 Configuration for fixture `my_fixture` specified via positional args, use kwargs | 14 | @pytest.fixture("module") | ^^^^^^^^^^^^^^^^^^^^^^^^ PT002 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 | return 0 | -./resources/test/fixtures/flake8_pytest_style/PT002.py:19:2: PT002 Configuration for fixture `my_fixture` specified via positional args, use kwargs +PT002.py:19:2: PT002 Configuration for fixture `my_fixture` specified via positional args, use kwargs | 19 | @pytest.fixture("module", autouse=True) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT002 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap index 47ffb39ad2..c97b402733 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT003.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT003.py:14:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:14:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 14 | @pytest.fixture(scope="function") | ^^^^^^^^^^^^^^^^ PT003 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 16 | ... 17 17 | -./resources/test/fixtures/flake8_pytest_style/PT003.py:19:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:19:17: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 19 | @pytest.fixture(scope="function", name="my_fixture") | ^^^^^^^^^^^^^^^^ PT003 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 21 21 | ... 22 22 | -./resources/test/fixtures/flake8_pytest_style/PT003.py:24:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:24:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 24 | @pytest.fixture(name="my_fixture", scope="function") | ^^^^^^^^^^^^^^^^ PT003 @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 26 26 | ... 27 27 | -./resources/test/fixtures/flake8_pytest_style/PT003.py:29:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:29:36: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 29 | @pytest.fixture(name="my_fixture", scope="function", **kwargs) | ^^^^^^^^^^^^^^^^ PT003 @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 31 31 | ... 32 32 | -./resources/test/fixtures/flake8_pytest_style/PT003.py:37:31: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:37:31: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 37 | # tests the general case as we use a helper function that should 38 | # work for all cases. @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 39 39 | ... 40 40 | -./resources/test/fixtures/flake8_pytest_style/PT003.py:43:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:43:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 43 | @pytest.fixture( 44 | scope="function", @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 45 44 | ) 46 45 | def error_multiple_args(): -./resources/test/fixtures/flake8_pytest_style/PT003.py:52:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:52:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 52 | @pytest.fixture( 53 | name="my_fixture", @@ -137,7 +137,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 54 53 | def error_multiple_args(): 55 54 | ... -./resources/test/fixtures/flake8_pytest_style/PT003.py:66:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` +PT003.py:66:5: PT003 [*] `scope='function'` is implied in `@pytest.fixture()` | 66 | # another comment ,) 67 | diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap index cf9ddad78e..21c3bb62df 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT004.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT004.py:51:1: PT004 Fixture `patch_something` does not return anything, add leading underscore +PT004.py:51:1: PT004 Fixture `patch_something` does not return anything, add leading underscore | 51 | @pytest.fixture() 52 | / def patch_something(mocker): # Error simple @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | |______________________________^ PT004 | -./resources/test/fixtures/flake8_pytest_style/PT004.py:56:1: PT004 Fixture `activate_context` does not return anything, add leading underscore +PT004.py:56:1: PT004 Fixture `activate_context` does not return anything, add leading underscore | 56 | @pytest.fixture() 57 | / def activate_context(): # Error with yield diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap index 9b6b320bd3..5b3e5d58b4 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT005.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT005.py:41:1: PT005 Fixture `_my_fixture` returns a value, remove leading underscore +PT005.py:41:1: PT005 Fixture `_my_fixture` returns a value, remove leading underscore | 41 | @pytest.fixture() 42 | / def _my_fixture(mocker): # Error with return @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | |____________^ PT005 | -./resources/test/fixtures/flake8_pytest_style/PT005.py:46:1: PT005 Fixture `_activate_context` returns a value, remove leading underscore +PT005.py:46:1: PT005 Fixture `_activate_context` returns a value, remove leading underscore | 46 | @pytest.fixture() 47 | / def _activate_context(): # Error with yield @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | |_____________________^ PT005 | -./resources/test/fixtures/flake8_pytest_style/PT005.py:52:1: PT005 Fixture `_activate_context` returns a value, remove leading underscore +PT005.py:52:1: PT005 Fixture `_activate_context` returns a value, remove leading underscore | 52 | @pytest.fixture() 53 | / def _activate_context(): # Error with conditional yield from diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap index 48684b1003..06c50e4718 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_csv.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT006.py:24:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:24:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 24 | @pytest.mark.parametrize(("param1", "param2"), [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 26 26 | ... 27 27 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 29 | @pytest.mark.parametrize(("param1",), [1, 2, 3]) | ^^^^^^^^^^^ PT006 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 31 31 | ... 32 32 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:34:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:34:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 34 | @pytest.mark.parametrize(["param1", "param2"], [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 36 36 | ... 37 37 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 39 | @pytest.mark.parametrize(["param1"], [1, 2, 3]) | ^^^^^^^^^^ PT006 @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 41 41 | ... 42 42 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:44:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:44:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 44 | @pytest.mark.parametrize([some_expr, another_expr], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | = help: Use a `csv` for parameter names -./resources/test/fixtures/flake8_pytest_style/PT006.py:49:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:49:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 49 | @pytest.mark.parametrize([some_expr, "param2"], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^ PT006 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap index 4fdc751a95..7e280eccf3 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_default.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 9 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 11 11 | ... 12 12 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 14 | @pytest.mark.parametrize(" param1, , param2 , ", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 16 | ... 17 17 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:19:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:19:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 19 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 21 21 | ... 22 22 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 29 | @pytest.mark.parametrize(("param1",), [1, 2, 3]) | ^^^^^^^^^^^ PT006 @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 31 31 | ... 32 32 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:34:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:34:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 34 | @pytest.mark.parametrize(["param1", "param2"], [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 36 36 | ... 37 37 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 39 | @pytest.mark.parametrize(["param1"], [1, 2, 3]) | ^^^^^^^^^^ PT006 @@ -115,7 +115,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 41 41 | ... 42 42 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:44:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:44:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 44 | @pytest.mark.parametrize([some_expr, another_expr], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -134,7 +134,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 46 46 | ... 47 47 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:49:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` +PT006.py:49:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple` | 49 | @pytest.mark.parametrize([some_expr, "param2"], [1, 2, 3]) | ^^^^^^^^^^^^^^^^^^^^^ PT006 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap index 281b7924d9..bba294df51 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT006_list.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:9:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 9 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 11 11 | ... 12 12 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:14:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 14 | @pytest.mark.parametrize(" param1, , param2 , ", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT006 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 16 | ... 17 17 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:19:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:19:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 19 | @pytest.mark.parametrize("param1,param2", [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^ PT006 @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 21 21 | ... 22 22 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:24:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` +PT006.py:24:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `list` | 24 | @pytest.mark.parametrize(("param1", "param2"), [(1, 2), (3, 4)]) | ^^^^^^^^^^^^^^^^^^^^ PT006 @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 26 26 | ... 27 27 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:29:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 29 | @pytest.mark.parametrize(("param1",), [1, 2, 3]) | ^^^^^^^^^^^ PT006 @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 31 31 | ... 32 32 | -./resources/test/fixtures/flake8_pytest_style/PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` +PT006.py:39:26: PT006 [*] Wrong name(s) type in `@pytest.mark.parametrize`, expected `csv` | 39 | @pytest.mark.parametrize(["param1"], [1, 2, 3]) | ^^^^^^^^^^ PT006 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap index 08d2c846c1..fdeb720366 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_lists.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT007.py:4:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:4:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 4 | @pytest.mark.parametrize("param", (1, 2)) | ^^^^^^ PT007 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 6 | ... | -./resources/test/fixtures/flake8_pytest_style/PT007.py:11:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:11:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 11 | @pytest.mark.parametrize( 12 | ("param1", "param2"), @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 18 | def test_tuple_of_tuples(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:12:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:12:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 12 | ("param1", "param2"), 13 | ( @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 | ), | -./resources/test/fixtures/flake8_pytest_style/PT007.py:13:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:13:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 13 | ( 14 | (1, 2), @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 17 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:22:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:22:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 22 | @pytest.mark.parametrize( 23 | ("param1", "param2"), @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 29 | def test_tuple_of_lists(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:39:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:39:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 39 | ("param1", "param2"), 40 | [ @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 43 | ], | -./resources/test/fixtures/flake8_pytest_style/PT007.py:40:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:40:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 40 | [ 41 | (1, 2), @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 44 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:81:38: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:81:38: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 81 | @pytest.mark.parametrize("a", [1, 2]) 82 | @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6))) @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 84 | pass | -./resources/test/fixtures/flake8_pytest_style/PT007.py:81:39: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:81:39: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 81 | @pytest.mark.parametrize("a", [1, 2]) 82 | @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6))) @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 84 | pass | -./resources/test/fixtures/flake8_pytest_style/PT007.py:81:47: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` +PT007.py:81:47: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `list` | 81 | @pytest.mark.parametrize("a", [1, 2]) 82 | @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6))) diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap index eb918df2b1..8e07a0b16c 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_list_of_tuples.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT007.py:4:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:4:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 4 | @pytest.mark.parametrize("param", (1, 2)) | ^^^^^^ PT007 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 6 | ... | -./resources/test/fixtures/flake8_pytest_style/PT007.py:11:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:11:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 11 | @pytest.mark.parametrize( 12 | ("param1", "param2"), @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 18 | def test_tuple_of_tuples(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:22:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:22:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 22 | @pytest.mark.parametrize( 23 | ("param1", "param2"), @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 29 | def test_tuple_of_lists(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:23:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:23:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 23 | ("param1", "param2"), 24 | ( @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 27 | ), | -./resources/test/fixtures/flake8_pytest_style/PT007.py:24:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:24:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 24 | ( 25 | [1, 2], @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 28 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:50:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:50:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 50 | ("param1", "param2"), 51 | [ @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 54 | ], | -./resources/test/fixtures/flake8_pytest_style/PT007.py:51:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:51:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 51 | [ 52 | [1, 2], @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 55 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:61:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:61:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 61 | "param1,param2", 62 | [ @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 65 | ], | -./resources/test/fixtures/flake8_pytest_style/PT007.py:62:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:62:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 62 | [ 63 | [1, 2], @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 66 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:81:38: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` +PT007.py:81:38: PT007 Wrong values type in `@pytest.mark.parametrize` expected `list` of `tuple` | 81 | @pytest.mark.parametrize("a", [1, 2]) 82 | @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6))) diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap index 13ed765fa4..4d2790cb7f 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_lists.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT007.py:12:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:12:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 12 | ("param1", "param2"), 13 | ( @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 | ), | -./resources/test/fixtures/flake8_pytest_style/PT007.py:13:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:13:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 13 | ( 14 | (1, 2), @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 17 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:31:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:31:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 31 | @pytest.mark.parametrize("param", [1, 2]) | ^^^^^^ PT007 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 33 | ... | -./resources/test/fixtures/flake8_pytest_style/PT007.py:38:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:38:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 38 | @pytest.mark.parametrize( 39 | ("param1", "param2"), @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 45 | def test_list_of_tuples(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:39:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:39:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 39 | ("param1", "param2"), 40 | [ @@ -53,7 +53,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 43 | ], | -./resources/test/fixtures/flake8_pytest_style/PT007.py:40:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:40:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 40 | [ 41 | (1, 2), @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 44 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:49:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:49:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 49 | @pytest.mark.parametrize( 50 | ("param1", "param2"), @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 56 | def test_list_of_lists(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:60:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:60:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 60 | @pytest.mark.parametrize( 61 | "param1,param2", @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 67 | def test_csv_name_list_of_lists(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:71:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:71:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 71 | @pytest.mark.parametrize( 72 | "param", @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 78 | def test_single_list_of_lists(param): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:80:31: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:80:31: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 80 | @pytest.mark.parametrize("a", [1, 2]) | ^^^^^^ PT007 @@ -113,7 +113,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 82 | def test_multiple_decorators(a, b, c): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:81:39: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:81:39: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 81 | @pytest.mark.parametrize("a", [1, 2]) 82 | @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6))) @@ -122,7 +122,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 84 | pass | -./resources/test/fixtures/flake8_pytest_style/PT007.py:81:47: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` +PT007.py:81:47: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `list` | 81 | @pytest.mark.parametrize("a", [1, 2]) 82 | @pytest.mark.parametrize(("b", "c"), ((3, 4), (5, 6))) diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap index 44c81da54b..7dfd10227f 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT007_tuple_of_tuples.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT007.py:23:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:23:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 23 | ("param1", "param2"), 24 | ( @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 27 | ), | -./resources/test/fixtures/flake8_pytest_style/PT007.py:24:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:24:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 24 | ( 25 | [1, 2], @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 28 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:31:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:31:35: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 31 | @pytest.mark.parametrize("param", [1, 2]) | ^^^^^^ PT007 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 33 | ... | -./resources/test/fixtures/flake8_pytest_style/PT007.py:38:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:38:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 38 | @pytest.mark.parametrize( 39 | ("param1", "param2"), @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 45 | def test_list_of_tuples(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:49:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:49:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 49 | @pytest.mark.parametrize( 50 | ("param1", "param2"), @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 56 | def test_list_of_lists(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:50:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:50:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 50 | ("param1", "param2"), 51 | [ @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 54 | ], | -./resources/test/fixtures/flake8_pytest_style/PT007.py:51:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:51:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 51 | [ 52 | [1, 2], @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 55 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:60:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:60:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 60 | @pytest.mark.parametrize( 61 | "param1,param2", @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 67 | def test_csv_name_list_of_lists(param1, param2): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:61:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:61:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 61 | "param1,param2", 62 | [ @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 65 | ], | -./resources/test/fixtures/flake8_pytest_style/PT007.py:62:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:62:9: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 62 | [ 63 | [1, 2], @@ -111,7 +111,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 66 | ) | -./resources/test/fixtures/flake8_pytest_style/PT007.py:71:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:71:5: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 71 | @pytest.mark.parametrize( 72 | "param", @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 78 | def test_single_list_of_lists(param): | -./resources/test/fixtures/flake8_pytest_style/PT007.py:80:31: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` +PT007.py:80:31: PT007 Wrong values type in `@pytest.mark.parametrize` expected `tuple` of `tuple` | 80 | @pytest.mark.parametrize("a", [1, 2]) | ^^^^^^ PT007 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap index 3ef2f2905d..a16e8ef440 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT008.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT008.py:35:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:35:1: PT008 Use `return_value=` instead of patching with `lambda` | 35 | # Error 36 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 39 | mocker.patch.object(obj, "attr", lambda: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:36:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:36:1: PT008 Use `return_value=` instead of patching with `lambda` | 36 | mocker.patch("module.name", lambda: None) 37 | module_mocker.patch("module.name", lambda: None) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 39 | module_mocker.patch.object(obj, "attr", lambda: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:37:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:37:1: PT008 Use `return_value=` instead of patching with `lambda` | 37 | mocker.patch("module.name", lambda: None) 38 | module_mocker.patch("module.name", lambda: None) @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 40 | module_mocker.patch.object(obj, "attr", lambda: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:38:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:38:1: PT008 Use `return_value=` instead of patching with `lambda` | 38 | module_mocker.patch("module.name", lambda: None) 39 | mocker.patch.object(obj, "attr", lambda: None) @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 42 | mocker.patch("module.name", lambda x, y: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:40:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:40:1: PT008 Use `return_value=` instead of patching with `lambda` | 40 | module_mocker.patch.object(obj, "attr", lambda: None) 41 | @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 44 | mocker.patch.object(obj, "attr", lambda x, y: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:41:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:41:1: PT008 Use `return_value=` instead of patching with `lambda` | 41 | mocker.patch("module.name", lambda x, y: None) 42 | module_mocker.patch("module.name", lambda x, y: None) @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 44 | module_mocker.patch.object(obj, "attr", lambda x, y: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:42:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:42:1: PT008 Use `return_value=` instead of patching with `lambda` | 42 | mocker.patch("module.name", lambda x, y: None) 43 | module_mocker.patch("module.name", lambda x, y: None) @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 45 | module_mocker.patch.object(obj, "attr", lambda x, y: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:43:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:43:1: PT008 Use `return_value=` instead of patching with `lambda` | 43 | module_mocker.patch("module.name", lambda x, y: None) 44 | mocker.patch.object(obj, "attr", lambda x, y: None) @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 47 | mocker.patch("module.name", lambda *args, **kwargs: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:45:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:45:1: PT008 Use `return_value=` instead of patching with `lambda` | 45 | module_mocker.patch.object(obj, "attr", lambda x, y: None) 46 | @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 49 | mocker.patch.object(obj, "attr", lambda *args, **kwargs: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:46:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:46:1: PT008 Use `return_value=` instead of patching with `lambda` | 46 | mocker.patch("module.name", lambda *args, **kwargs: None) 47 | module_mocker.patch("module.name", lambda *args, **kwargs: None) @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 49 | module_mocker.patch.object(obj, "attr", lambda *args, **kwargs: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:47:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:47:1: PT008 Use `return_value=` instead of patching with `lambda` | 47 | mocker.patch("module.name", lambda *args, **kwargs: None) 48 | module_mocker.patch("module.name", lambda *args, **kwargs: None) @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 50 | module_mocker.patch.object(obj, "attr", lambda *args, **kwargs: None) | -./resources/test/fixtures/flake8_pytest_style/PT008.py:48:1: PT008 Use `return_value=` instead of patching with `lambda` +PT008.py:48:1: PT008 Use `return_value=` instead of patching with `lambda` | 48 | module_mocker.patch("module.name", lambda *args, **kwargs: None) 49 | mocker.patch.object(obj, "attr", lambda *args, **kwargs: None) diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap index 8187dd5680..4a9468d292 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT009.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT009.py:11:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:11:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 11 | expr = 1 12 | msg = "Must be True" @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 13 13 | self.assertTrue(expr, msg) # Error 14 14 | self.assertTrue(expr=expr, msg=msg) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:12:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:12:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 12 | msg = "Must be True" 13 | self.assertTrue(expr) # Error @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 14 14 | self.assertTrue(expr=expr, msg=msg) # Error 15 15 | self.assertTrue(msg=msg, expr=expr) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:13:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:13:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 13 | self.assertTrue(expr) # Error 14 | self.assertTrue(expr=expr) # Error @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 15 15 | self.assertTrue(msg=msg, expr=expr) # Error 16 16 | self.assertTrue(*(expr, msg)) # Error, unfixable -./resources/test/fixtures/flake8_pytest_style/PT009.py:14:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:14:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 14 | self.assertTrue(expr=expr) # Error 15 | self.assertTrue(expr, msg) # Error @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 16 | self.assertTrue(*(expr, msg)) # Error, unfixable 17 17 | self.assertTrue(**{"expr": expr, "msg": msg}) # Error, unfixable -./resources/test/fixtures/flake8_pytest_style/PT009.py:15:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:15:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 15 | self.assertTrue(expr, msg) # Error 16 | self.assertTrue(expr=expr, msg=msg) # Error @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 17 17 | self.assertTrue(**{"expr": expr, "msg": msg}) # Error, unfixable 18 18 | self.assertTrue(msg=msg, expr=expr, unexpected_arg=False) # Error, unfixable -./resources/test/fixtures/flake8_pytest_style/PT009.py:16:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:16:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 16 | self.assertTrue(expr=expr, msg=msg) # Error 17 | self.assertTrue(msg=msg, expr=expr) # Error @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | = help: Replace `assertTrue(...)` with `assert ...` -./resources/test/fixtures/flake8_pytest_style/PT009.py:17:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:17:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 17 | self.assertTrue(msg=msg, expr=expr) # Error 18 | self.assertTrue(*(expr, msg)) # Error, unfixable @@ -128,7 +128,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | = help: Replace `assertTrue(...)` with `assert ...` -./resources/test/fixtures/flake8_pytest_style/PT009.py:18:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:18:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 18 | self.assertTrue(*(expr, msg)) # Error, unfixable 19 | self.assertTrue(**{"expr": expr, "msg": msg}) # Error, unfixable @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | = help: Replace `assertTrue(...)` with `assert ...` -./resources/test/fixtures/flake8_pytest_style/PT009.py:19:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` +PT009.py:19:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertTrue` | 19 | self.assertTrue(**{"expr": expr, "msg": msg}) # Error, unfixable 20 | self.assertTrue(msg=msg, expr=expr, unexpected_arg=False) # Error, unfixable @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | = help: Replace `assertTrue(...)` with `assert ...` -./resources/test/fixtures/flake8_pytest_style/PT009.py:21:13: PT009 Use a regular `assert` instead of unittest-style `assertIsNotNone` +PT009.py:21:13: PT009 Use a regular `assert` instead of unittest-style `assertIsNotNone` | 21 | self.assertTrue(msg=msg) # Error, unfixable 22 | ( @@ -160,7 +160,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 25 | else self.assertIsNone(value) # Error, unfixable | -./resources/test/fixtures/flake8_pytest_style/PT009.py:23:18: PT009 Use a regular `assert` instead of unittest-style `assertIsNone` +PT009.py:23:18: PT009 Use a regular `assert` instead of unittest-style `assertIsNone` | 23 | self.assertIsNotNone(value) # Error, unfixable 24 | if expect_condition @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 27 | return self.assertEqual(True, False) # Error, unfixable | -./resources/test/fixtures/flake8_pytest_style/PT009.py:25:16: PT009 Use a regular `assert` instead of unittest-style `assertEqual` +PT009.py:25:16: PT009 Use a regular `assert` instead of unittest-style `assertEqual` | 25 | else self.assertIsNone(value) # Error, unfixable 26 | ) @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 29 | def test_assert_false(self): | -./resources/test/fixtures/flake8_pytest_style/PT009.py:28:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertFalse` +PT009.py:28:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertFalse` | 28 | def test_assert_false(self): 29 | self.assertFalse(True) # Error @@ -200,7 +200,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 30 30 | def test_assert_equal(self): 31 31 | self.assertEqual(1, 2) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:31:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertEqual` +PT009.py:31:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertEqual` | 31 | def test_assert_equal(self): 32 | self.assertEqual(1, 2) # Error @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 33 33 | def test_assert_not_equal(self): 34 34 | self.assertNotEqual(1, 1) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:34:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotEqual` +PT009.py:34:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotEqual` | 34 | def test_assert_not_equal(self): 35 | self.assertNotEqual(1, 1) # Error @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 36 36 | def test_assert_greater(self): 37 37 | self.assertGreater(1, 2) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:37:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertGreater` +PT009.py:37:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertGreater` | 37 | def test_assert_greater(self): 38 | self.assertGreater(1, 2) # Error @@ -260,7 +260,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 39 39 | def test_assert_greater_equal(self): 40 40 | self.assertGreaterEqual(1, 2) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:40:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertGreaterEqual` +PT009.py:40:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertGreaterEqual` | 40 | def test_assert_greater_equal(self): 41 | self.assertGreaterEqual(1, 2) # Error @@ -280,7 +280,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 42 42 | def test_assert_less(self): 43 43 | self.assertLess(2, 1) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:43:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertLess` +PT009.py:43:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertLess` | 43 | def test_assert_less(self): 44 | self.assertLess(2, 1) # Error @@ -300,7 +300,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 45 45 | def test_assert_less_equal(self): 46 46 | self.assertLessEqual(1, 2) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:46:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertLessEqual` +PT009.py:46:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertLessEqual` | 46 | def test_assert_less_equal(self): 47 | self.assertLessEqual(1, 2) # Error @@ -320,7 +320,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 48 48 | def test_assert_in(self): 49 49 | self.assertIn(1, [2, 3]) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:49:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIn` +PT009.py:49:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIn` | 49 | def test_assert_in(self): 50 | self.assertIn(1, [2, 3]) # Error @@ -340,7 +340,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 51 51 | def test_assert_not_in(self): 52 52 | self.assertNotIn(2, [2, 3]) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:52:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotIn` +PT009.py:52:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotIn` | 52 | def test_assert_not_in(self): 53 | self.assertNotIn(2, [2, 3]) # Error @@ -360,7 +360,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 54 54 | def test_assert_is_none(self): 55 55 | self.assertIsNone(0) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:55:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNone` +PT009.py:55:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNone` | 55 | def test_assert_is_none(self): 56 | self.assertIsNone(0) # Error @@ -380,7 +380,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 57 57 | def test_assert_is_not_none(self): 58 58 | self.assertIsNotNone(0) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:58:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNotNone` +PT009.py:58:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNotNone` | 58 | def test_assert_is_not_none(self): 59 | self.assertIsNotNone(0) # Error @@ -400,7 +400,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 60 60 | def test_assert_is(self): 61 61 | self.assertIs([], []) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:61:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIs` +PT009.py:61:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIs` | 61 | def test_assert_is(self): 62 | self.assertIs([], []) # Error @@ -420,7 +420,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 63 63 | def test_assert_is_not(self): 64 64 | self.assertIsNot(1, 1) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:64:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNot` +PT009.py:64:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsNot` | 64 | def test_assert_is_not(self): 65 | self.assertIsNot(1, 1) # Error @@ -440,7 +440,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 66 66 | def test_assert_is_instance(self): 67 67 | self.assertIsInstance(1, str) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:67:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsInstance` +PT009.py:67:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertIsInstance` | 67 | def test_assert_is_instance(self): 68 | self.assertIsInstance(1, str) # Error @@ -460,7 +460,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 69 69 | def test_assert_is_not_instance(self): 70 70 | self.assertNotIsInstance(1, int) # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:70:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotIsInstance` +PT009.py:70:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotIsInstance` | 70 | def test_assert_is_not_instance(self): 71 | self.assertNotIsInstance(1, int) # Error @@ -480,7 +480,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 72 72 | def test_assert_regex(self): 73 73 | self.assertRegex("abc", r"def") # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:73:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertRegex` +PT009.py:73:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertRegex` | 73 | def test_assert_regex(self): 74 | self.assertRegex("abc", r"def") # Error @@ -500,7 +500,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 75 75 | def test_assert_not_regex(self): 76 76 | self.assertNotRegex("abc", r"abc") # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:76:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotRegex` +PT009.py:76:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotRegex` | 76 | def test_assert_not_regex(self): 77 | self.assertNotRegex("abc", r"abc") # Error @@ -520,7 +520,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 78 78 | def test_assert_regexp_matches(self): 79 79 | self.assertRegexpMatches("abc", r"def") # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:79:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertRegexpMatches` +PT009.py:79:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertRegexpMatches` | 79 | def test_assert_regexp_matches(self): 80 | self.assertRegexpMatches("abc", r"def") # Error @@ -540,7 +540,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 81 81 | def test_assert_not_regexp_matches(self): 82 82 | self.assertNotRegex("abc", r"abc") # Error -./resources/test/fixtures/flake8_pytest_style/PT009.py:82:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotRegex` +PT009.py:82:9: PT009 [*] Use a regular `assert` instead of unittest-style `assertNotRegex` | 82 | def test_assert_not_regexp_matches(self): 83 | self.assertNotRegex("abc", r"abc") # Error diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap index 5e9b181890..bc3c7519a8 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT010.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT010.py:5:10: PT010 set the expected exception in `pytest.raises()` +PT010.py:5:10: PT010 set the expected exception in `pytest.raises()` | 5 | def test_ok(): 6 | with pytest.raises(): diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap index a077da9cbb..04528b8935 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_default.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT011.py:17:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:17:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 17 | def test_error_no_argument_given(): 18 | with pytest.raises(ValueError): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 19 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:20:24: PT011 `pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:20:24: PT011 `pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception | 20 | raise ValueError("Can't divide 1 by 0") 21 | @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 23 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:25:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:25:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 25 | def test_error_match_is_empty(): 26 | with pytest.raises(ValueError, match=None): @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 27 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:28:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:28:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 28 | raise ValueError("Can't divide 1 by 0") 29 | @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 31 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:31:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:31:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 31 | raise ValueError("Can't divide 1 by 0") 32 | diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap index eb657b19cd..cfde4463b2 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_extend_broad_exceptions.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT011.py:12:24: PT011 `pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:12:24: PT011 `pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception | 12 | def test_ok_different_error_from_config(): 13 | with pytest.raises(ZeroDivisionError): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 14 | raise ZeroDivisionError("Can't divide by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:17:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:17:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 17 | def test_error_no_argument_given(): 18 | with pytest.raises(ValueError): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 19 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:20:24: PT011 `pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:20:24: PT011 `pytest.raises(socket.error)` is too broad, set the `match` parameter or use a more specific exception | 20 | raise ValueError("Can't divide 1 by 0") 21 | @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 23 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:25:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:25:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 25 | def test_error_match_is_empty(): 26 | with pytest.raises(ValueError, match=None): @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 27 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:28:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:28:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 28 | raise ValueError("Can't divide 1 by 0") 29 | @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 31 | raise ValueError("Can't divide 1 by 0") | -./resources/test/fixtures/flake8_pytest_style/PT011.py:31:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:31:24: PT011 `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception | 31 | raise ValueError("Can't divide 1 by 0") 32 | diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap index e6cf57a0a5..807deda27d 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT011_replace_broad_exceptions.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT011.py:12:24: PT011 `pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception +PT011.py:12:24: PT011 `pytest.raises(ZeroDivisionError)` is too broad, set the `match` parameter or use a more specific exception | 12 | def test_ok_different_error_from_config(): 13 | with pytest.raises(ZeroDivisionError): diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap index 15b16b408c..0b9ea902c4 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT012.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT012.py:28:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:28:5: PT012 `pytest.raises()` block should contain a single simple statement | 28 | def test_error_multiple_statements(): 29 | with pytest.raises(AttributeError): @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | |_______________^ PT012 | -./resources/test/fixtures/flake8_pytest_style/PT012.py:34:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:34:5: PT012 `pytest.raises()` block should contain a single simple statement | 34 | async def test_error_complex_statement(): 35 | with pytest.raises(AttributeError): @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 39 | with pytest.raises(AttributeError): | -./resources/test/fixtures/flake8_pytest_style/PT012.py:38:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:38:5: PT012 `pytest.raises()` block should contain a single simple statement | 38 | [].size 39 | @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 44 | with pytest.raises(AttributeError): | -./resources/test/fixtures/flake8_pytest_style/PT012.py:42:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:42:5: PT012 `pytest.raises()` block should contain a single simple statement | 42 | [].size 43 | @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 48 | with pytest.raises(AttributeError): | -./resources/test/fixtures/flake8_pytest_style/PT012.py:46:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:46:5: PT012 `pytest.raises()` block should contain a single simple statement | 46 | [].size 47 | @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 52 | with pytest.raises(AttributeError): | -./resources/test/fixtures/flake8_pytest_style/PT012.py:50:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:50:5: PT012 `pytest.raises()` block should contain a single simple statement | 50 | [].size 51 | @@ -75,7 +75,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 56 | with pytest.raises(AttributeError): | -./resources/test/fixtures/flake8_pytest_style/PT012.py:54:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:54:5: PT012 `pytest.raises()` block should contain a single simple statement | 54 | [].size 55 | @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs | |___________________^ PT012 | -./resources/test/fixtures/flake8_pytest_style/PT012.py:60:5: PT012 `pytest.raises()` block should contain a single simple statement +PT012.py:60:5: PT012 `pytest.raises()` block should contain a single simple statement | 60 | def test_error_try(): 61 | with pytest.raises(AttributeError): diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap index a4a8a95ae4..4e3d40b35c 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT013.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT013.py:11:1: PT013 Found incorrect import of pytest, use simple `import pytest` instead +PT013.py:11:1: PT013 Found incorrect import of pytest, use simple `import pytest` instead | 11 | # Error 12 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 15 | from pytest import fixture as other_name | -./resources/test/fixtures/flake8_pytest_style/PT013.py:12:1: PT013 Found incorrect import of pytest, use simple `import pytest` instead +PT013.py:12:1: PT013 Found incorrect import of pytest, use simple `import pytest` instead | 12 | import pytest as other_name 13 | from pytest import fixture @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 14 | from pytest import fixture as other_name | -./resources/test/fixtures/flake8_pytest_style/PT013.py:13:1: PT013 Found incorrect import of pytest, use simple `import pytest` instead +PT013.py:13:1: PT013 Found incorrect import of pytest, use simple `import pytest` instead | 13 | import pytest as other_name 14 | from pytest import fixture diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap index f9a4d0d4e1..28c9dcd40b 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT015.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT015.py:9:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:9:5: PT015 Assertion always fails, replace with `pytest.fail()` | 9 | def test_error(): 10 | assert None @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 12 | assert 0 | -./resources/test/fixtures/flake8_pytest_style/PT015.py:10:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:10:5: PT015 Assertion always fails, replace with `pytest.fail()` | 10 | def test_error(): 11 | assert None @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 14 | assert 0.0 | -./resources/test/fixtures/flake8_pytest_style/PT015.py:11:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:11:5: PT015 Assertion always fails, replace with `pytest.fail()` | 11 | assert None 12 | assert False @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 15 | assert "" | -./resources/test/fixtures/flake8_pytest_style/PT015.py:12:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:12:5: PT015 Assertion always fails, replace with `pytest.fail()` | 12 | assert False 13 | assert 0 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 | assert f"" | -./resources/test/fixtures/flake8_pytest_style/PT015.py:13:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:13:5: PT015 Assertion always fails, replace with `pytest.fail()` | 13 | assert 0 14 | assert 0.0 @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 17 | assert [] | -./resources/test/fixtures/flake8_pytest_style/PT015.py:14:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:14:5: PT015 Assertion always fails, replace with `pytest.fail()` | 14 | assert 0.0 15 | assert "" @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 18 | assert () | -./resources/test/fixtures/flake8_pytest_style/PT015.py:15:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:15:5: PT015 Assertion always fails, replace with `pytest.fail()` | 15 | assert "" 16 | assert f"" @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 19 | assert {} | -./resources/test/fixtures/flake8_pytest_style/PT015.py:16:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:16:5: PT015 Assertion always fails, replace with `pytest.fail()` | 16 | assert f"" 17 | assert [] @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 20 | assert list() | -./resources/test/fixtures/flake8_pytest_style/PT015.py:17:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:17:5: PT015 Assertion always fails, replace with `pytest.fail()` | 17 | assert [] 18 | assert () @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 21 | assert set() | -./resources/test/fixtures/flake8_pytest_style/PT015.py:18:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:18:5: PT015 Assertion always fails, replace with `pytest.fail()` | 18 | assert () 19 | assert {} @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 22 | assert tuple() | -./resources/test/fixtures/flake8_pytest_style/PT015.py:19:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:19:5: PT015 Assertion always fails, replace with `pytest.fail()` | 19 | assert {} 20 | assert list() @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 23 | assert dict() | -./resources/test/fixtures/flake8_pytest_style/PT015.py:20:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:20:5: PT015 Assertion always fails, replace with `pytest.fail()` | 20 | assert list() 21 | assert set() @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 24 | assert frozenset() | -./resources/test/fixtures/flake8_pytest_style/PT015.py:21:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:21:5: PT015 Assertion always fails, replace with `pytest.fail()` | 21 | assert set() 22 | assert tuple() @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 25 | assert list([]) | -./resources/test/fixtures/flake8_pytest_style/PT015.py:22:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:22:5: PT015 Assertion always fails, replace with `pytest.fail()` | 22 | assert tuple() 23 | assert dict() @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 26 | assert set(set()) | -./resources/test/fixtures/flake8_pytest_style/PT015.py:23:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:23:5: PT015 Assertion always fails, replace with `pytest.fail()` | 23 | assert dict() 24 | assert frozenset() @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 27 | assert tuple("") | -./resources/test/fixtures/flake8_pytest_style/PT015.py:24:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:24:5: PT015 Assertion always fails, replace with `pytest.fail()` | 24 | assert frozenset() 25 | assert list([]) @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 27 | assert tuple("") | -./resources/test/fixtures/flake8_pytest_style/PT015.py:25:5: PT015 Assertion always fails, replace with `pytest.fail()` +PT015.py:25:5: PT015 Assertion always fails, replace with `pytest.fail()` | 25 | assert list([]) 26 | assert set(set()) diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap index 24890052ac..84de186c83 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT016.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT016.py:13:5: PT016 No message passed to `pytest.fail()` +PT016.py:13:5: PT016 No message passed to `pytest.fail()` | 13 | def test_xxx(): # Error 14 | pytest.fail() @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 | pytest.fail(f"") | -./resources/test/fixtures/flake8_pytest_style/PT016.py:14:5: PT016 No message passed to `pytest.fail()` +PT016.py:14:5: PT016 No message passed to `pytest.fail()` | 14 | def test_xxx(): # Error 15 | pytest.fail() @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 18 | pytest.fail(msg="") | -./resources/test/fixtures/flake8_pytest_style/PT016.py:15:5: PT016 No message passed to `pytest.fail()` +PT016.py:15:5: PT016 No message passed to `pytest.fail()` | 15 | pytest.fail() 16 | pytest.fail("") @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 19 | pytest.fail(msg=f"") | -./resources/test/fixtures/flake8_pytest_style/PT016.py:16:5: PT016 No message passed to `pytest.fail()` +PT016.py:16:5: PT016 No message passed to `pytest.fail()` | 16 | pytest.fail("") 17 | pytest.fail(f"") @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 19 | pytest.fail(msg=f"") | -./resources/test/fixtures/flake8_pytest_style/PT016.py:17:5: PT016 No message passed to `pytest.fail()` +PT016.py:17:5: PT016 No message passed to `pytest.fail()` | 17 | pytest.fail(f"") 18 | pytest.fail(msg="") diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap index 15b6c4ef8d..8f7828be96 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT017.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT017.py:19:9: PT017 Found assertion on exception `e` in `except` block, use `pytest.raises()` instead +PT017.py:19:9: PT017 Found assertion on exception `e` in `except` block, use `pytest.raises()` instead | 19 | something() 20 | except Exception as e: diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap index 64f29b5c0d..203e83fe9d 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT018.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT018.py:14:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:14:5: PT018 [*] Assertion should be broken down into multiple parts | 14 | def test_error(): 15 | assert something and something_else @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 17 | assert something and not something_else 17 18 | assert something and (something_else or something_third) -./resources/test/fixtures/flake8_pytest_style/PT018.py:15:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:15:5: PT018 [*] Assertion should be broken down into multiple parts | 15 | def test_error(): 16 | assert something and something_else @@ -44,7 +44,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 17 18 | assert something and (something_else or something_third) 18 19 | assert not something and something_else -./resources/test/fixtures/flake8_pytest_style/PT018.py:16:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:16:5: PT018 [*] Assertion should be broken down into multiple parts | 16 | assert something and something_else 17 | assert something and something_else and something_third @@ -66,7 +66,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 18 19 | assert not something and something_else 19 20 | assert not (something or something_else) -./resources/test/fixtures/flake8_pytest_style/PT018.py:17:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:17:5: PT018 [*] Assertion should be broken down into multiple parts | 17 | assert something and something_else and something_third 18 | assert something and not something_else @@ -88,7 +88,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 19 20 | assert not (something or something_else) 20 21 | assert not (something or something_else or something_third) -./resources/test/fixtures/flake8_pytest_style/PT018.py:18:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:18:5: PT018 [*] Assertion should be broken down into multiple parts | 18 | assert something and not something_else 19 | assert something and (something_else or something_third) @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 20 21 | assert not (something or something_else or something_third) 21 22 | assert something and something_else == """error -./resources/test/fixtures/flake8_pytest_style/PT018.py:19:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:19:5: PT018 [*] Assertion should be broken down into multiple parts | 19 | assert something and (something_else or something_third) 20 | assert not something and something_else @@ -132,7 +132,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 21 22 | assert something and something_else == """error 22 23 | message -./resources/test/fixtures/flake8_pytest_style/PT018.py:20:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:20:5: PT018 [*] Assertion should be broken down into multiple parts | 20 | assert not something and something_else 21 | assert not (something or something_else) @@ -154,7 +154,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 22 23 | message 23 24 | """ -./resources/test/fixtures/flake8_pytest_style/PT018.py:21:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:21:5: PT018 [*] Assertion should be broken down into multiple parts | 21 | assert not (something or something_else) 22 | assert not (something or something_else or something_third) @@ -179,7 +179,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 23 24 | """ 24 25 | -./resources/test/fixtures/flake8_pytest_style/PT018.py:26:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:26:5: PT018 [*] Assertion should be broken down into multiple parts | 26 | # recursive case 27 | assert not (a or not (b or c)) @@ -199,7 +199,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 28 29 | 29 30 | # detected, but no autofix for messages -./resources/test/fixtures/flake8_pytest_style/PT018.py:27:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:27:5: PT018 [*] Assertion should be broken down into multiple parts | 27 | # recursive case 28 | assert not (a or not (b or c)) @@ -221,7 +221,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 29 30 | # detected, but no autofix for messages 30 31 | assert something and something_else, "error message" -./resources/test/fixtures/flake8_pytest_style/PT018.py:30:5: PT018 Assertion should be broken down into multiple parts +PT018.py:30:5: PT018 Assertion should be broken down into multiple parts | 30 | # detected, but no autofix for messages 31 | assert something and something_else, "error message" @@ -230,7 +230,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 33 | # detected, but no autofix for mixed conditions (e.g. `a or b and c`) | -./resources/test/fixtures/flake8_pytest_style/PT018.py:31:5: PT018 Assertion should be broken down into multiple parts +PT018.py:31:5: PT018 Assertion should be broken down into multiple parts | 31 | # detected, but no autofix for messages 32 | assert something and something_else, "error message" @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 35 | assert not (something or something_else and something_third) | -./resources/test/fixtures/flake8_pytest_style/PT018.py:33:5: PT018 Assertion should be broken down into multiple parts +PT018.py:33:5: PT018 Assertion should be broken down into multiple parts | 33 | assert not (something or something_else and something_third), "with message" 34 | # detected, but no autofix for mixed conditions (e.g. `a or b and c`) @@ -250,7 +250,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 37 | assert ( | -./resources/test/fixtures/flake8_pytest_style/PT018.py:35:5: PT018 [*] Assertion should be broken down into multiple parts +PT018.py:35:5: PT018 [*] Assertion should be broken down into multiple parts | 35 | assert not (something or something_else and something_third) 36 | # detected, but no autofix for parenthesized conditions diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap index e40be04208..aac6a03e52 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT019.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT019.py:9:14: PT019 Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead +PT019.py:9:14: PT019 Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead | 9 | def test_xxx(_fixture): # Error arg | ^^^^^^^^ PT019 10 | pass | -./resources/test/fixtures/flake8_pytest_style/PT019.py:13:17: PT019 Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead +PT019.py:13:17: PT019 Fixture `_fixture` without value is injected as parameter, use `@pytest.mark.usefixtures` instead | 13 | def test_xxx(*, _fixture): # Error kwonly | ^^^^^^^^ PT019 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap index 2530f968ca..389b6882dd 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT020.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT020.py:14:2: PT020 `@pytest.yield_fixture` is deprecated, use `@pytest.fixture` +PT020.py:14:2: PT020 `@pytest.yield_fixture` is deprecated, use `@pytest.fixture` | 14 | @pytest.yield_fixture() | ^^^^^^^^^^^^^^^^^^^^^^ PT020 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 | return 0 | -./resources/test/fixtures/flake8_pytest_style/PT020.py:19:2: PT020 `@pytest.yield_fixture` is deprecated, use `@pytest.fixture` +PT020.py:19:2: PT020 `@pytest.yield_fixture` is deprecated, use `@pytest.fixture` | 19 | @pytest.yield_fixture | ^^^^^^^^^^^^^^^^^^^^ PT020 diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap index 33d78b0454..071675c7db 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT021.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT021.py:49:5: PT021 Use `yield` instead of `request.addfinalizer` +PT021.py:49:5: PT021 Use `yield` instead of `request.addfinalizer` | 49 | def my_fixture(request): # Error return 50 | resource = acquire_resource() @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 52 | return resource | -./resources/test/fixtures/flake8_pytest_style/PT021.py:56:5: PT021 Use `yield` instead of `request.addfinalizer` +PT021.py:56:5: PT021 Use `yield` instead of `request.addfinalizer` | 56 | def my_fixture(request): # Error yield 57 | resource = acquire_resource() diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap index 1be3c7b177..bbb7cf0a50 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT022.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT022.py:17:5: PT022 [*] No teardown in fixture `error`, use `return` instead of `yield` +PT022.py:17:5: PT022 [*] No teardown in fixture `error`, use `return` instead of `yield` | 17 | def error(): 18 | resource = acquire_resource() diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap index 0a3386377f..e5ac493591 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_default.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT023.py:12:2: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` +PT023.py:12:2: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` | 12 | @pytest.mark.foo | ^^^^^^^^^^^^^^^ PT023 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 14 14 | pass 15 15 | -./resources/test/fixtures/flake8_pytest_style/PT023.py:17:2: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` +PT023.py:17:2: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` | 17 | @pytest.mark.foo | ^^^^^^^^^^^^^^^ PT023 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 19 19 | def test_something(): 20 20 | pass -./resources/test/fixtures/flake8_pytest_style/PT023.py:24:6: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` +PT023.py:24:6: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` | 24 | class TestClass: 25 | @pytest.mark.foo @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 26 26 | pass 27 27 | -./resources/test/fixtures/flake8_pytest_style/PT023.py:30:6: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` +PT023.py:30:6: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` | 30 | class TestClass: 31 | @pytest.mark.foo @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 32 32 | def test_something(): 33 33 | pass -./resources/test/fixtures/flake8_pytest_style/PT023.py:38:10: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` +PT023.py:38:10: PT023 [*] Use `@pytest.mark.foo()` over `@pytest.mark.foo` | 38 | class TestClass: 39 | class TestNestedClass: diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap index bc8ba3da42..27ef92121d 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT023_no_parentheses.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT023.py:46:2: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` +PT023.py:46:2: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` | 46 | @pytest.mark.foo() | ^^^^^^^^^^^^^^^^^ PT023 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 48 48 | pass 49 49 | -./resources/test/fixtures/flake8_pytest_style/PT023.py:51:2: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` +PT023.py:51:2: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` | 51 | @pytest.mark.foo() | ^^^^^^^^^^^^^^^^^ PT023 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 53 53 | def test_something(): 54 54 | pass -./resources/test/fixtures/flake8_pytest_style/PT023.py:58:6: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` +PT023.py:58:6: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` | 58 | class TestClass: 59 | @pytest.mark.foo() @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 60 60 | pass 61 61 | -./resources/test/fixtures/flake8_pytest_style/PT023.py:64:6: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` +PT023.py:64:6: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` | 64 | class TestClass: 65 | @pytest.mark.foo() @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 66 66 | def test_something(): 67 67 | pass -./resources/test/fixtures/flake8_pytest_style/PT023.py:72:10: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` +PT023.py:72:10: PT023 [*] Use `@pytest.mark.foo` over `@pytest.mark.foo()` | 72 | class TestClass: 73 | class TestNestedClass: diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap index eea3ac6493..3809d5928e 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT024.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT024.py:14:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures +PT024.py:14:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures | 14 | @pytest.mark.asyncio() | ^^^^^^^^^^^^^^^^^^^^^ PT024 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 16 15 | async def my_fixture(): # Error before 17 16 | return 0 -./resources/test/fixtures/flake8_pytest_style/PT024.py:20:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures +PT024.py:20:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures | 20 | @pytest.mark.asyncio | ^^^^^^^^^^^^^^^^^^^ PT024 @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 22 21 | async def my_fixture(): # Error before no parens 23 22 | return 0 -./resources/test/fixtures/flake8_pytest_style/PT024.py:27:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures +PT024.py:27:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures | 27 | @pytest.fixture() 28 | @pytest.mark.asyncio() @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 29 28 | return 0 30 29 | -./resources/test/fixtures/flake8_pytest_style/PT024.py:33:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures +PT024.py:33:2: PT024 [*] `pytest.mark.asyncio` is unnecessary for fixtures | 33 | @pytest.fixture() 34 | @pytest.mark.asyncio diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap index c81607f360..23296b9440 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT025.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT025.py:9:2: PT025 [*] `pytest.mark.usefixtures` has no effect on fixtures +PT025.py:9:2: PT025 [*] `pytest.mark.usefixtures` has no effect on fixtures | 9 | @pytest.mark.usefixtures("a") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PT025 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 11 10 | def my_fixture(): # Error before 12 11 | return 0 -./resources/test/fixtures/flake8_pytest_style/PT025.py:16:2: PT025 [*] `pytest.mark.usefixtures` has no effect on fixtures +PT025.py:16:2: PT025 [*] `pytest.mark.usefixtures` has no effect on fixtures | 16 | @pytest.fixture() 17 | @pytest.mark.usefixtures("a") diff --git a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap index 5f117aff48..f08e80be28 100644 --- a/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap +++ b/crates/ruff/src/rules/flake8_pytest_style/snapshots/ruff__rules__flake8_pytest_style__tests__PT026.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_pytest_style/mod.rs --- -./resources/test/fixtures/flake8_pytest_style/PT026.py:19:2: PT026 [*] Useless `pytest.mark.usefixtures` without parameters +PT026.py:19:2: PT026 [*] Useless `pytest.mark.usefixtures` without parameters | 19 | @pytest.mark.usefixtures() | ^^^^^^^^^^^^^^^^^^^^^^^^^ PT026 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_pytest_style/mod.rs 21 21 | pass 22 22 | -./resources/test/fixtures/flake8_pytest_style/PT026.py:24:2: PT026 [*] Useless `pytest.mark.usefixtures` without parameters +PT026.py:24:2: PT026 [*] Useless `pytest.mark.usefixtures` without parameters | 24 | @pytest.mark.usefixtures | ^^^^^^^^^^^^^^^^^^^^^^^ PT026 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap index 80c6f0b66a..ab66f2df0f 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:5:1: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles.py:5:1: Q001 [*] Double quote multiline found but single quotes preferred | 5 | """ 6 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 9 9 | l = [] 10 10 | -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:16:5: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles.py:16:5: Q001 [*] Double quote multiline found but single quotes preferred | 16 | """ 17 | @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 20 20 | # The colon in the list indexing below is an edge case for the docstring scanner 21 21 | def f(self, bar=""" -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:21:21: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles.py:21:21: Q001 [*] Double quote multiline found but single quotes preferred | 21 | # The colon in the list indexing below is an edge case for the docstring scanner 22 | def f(self, bar=""" @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 24 24 | """ 25 25 | Double quotes multiline function docstring -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:30:9: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles.py:30:9: Q001 [*] Double quote multiline found but single quotes preferred | 30 | some_expression = 'hello world' 31 | @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 34 34 | if l: 35 35 | """ -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:35:13: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles.py:35:13: Q001 [*] Double quote multiline found but single quotes preferred | 35 | if l: 36 | """ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap index 52ebbac529..79c924a614 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_class.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_class.py:3:5: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_class.py:3:5: Q001 [*] Double quote multiline found but single quotes preferred | 3 | class SingleLineDocstrings(): 4 | """ Double quotes single line class docstring """ @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | def foo(self, bar="""not a docstring"""): 6 6 | """ Double quotes single line method docstring""" -./resources/test/fixtures/flake8_quotes/docstring_doubles_class.py:5:23: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_class.py:5:23: Q001 [*] Double quote multiline found but single quotes preferred | 5 | """ Not a docstring """ 6 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap index 491d1e6196..25e49236f9 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_function.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:3:5: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_function.py:3:5: Q001 [*] Double quote multiline found but single quotes preferred | 3 | def foo(): 4 | """function without params, single line docstring""" @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | 6 6 | -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:11:5: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_function.py:11:5: Q001 [*] Double quote multiline found but single quotes preferred | 11 | function without params, multiline docstring 12 | """ @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 13 13 | 14 14 | -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:15:39: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_function.py:15:39: Q001 [*] Double quote multiline found but single quotes preferred | 15 | def fun_with_params_no_docstring(a, b=""" | _______________________________________^ @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 19 19 | 20 20 | -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:17:5: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_function.py:17:5: Q001 [*] Double quote multiline found but single quotes preferred | 17 | def fun_with_params_no_docstring(a, b=""" 18 | not a @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 19 19 | 20 20 | -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:22:5: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_function.py:22:5: Q001 [*] Double quote multiline found but single quotes preferred | 22 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\ 23 | """ not a docstring """): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap index 06f0fe26dd..a5f756d180 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_multiline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_module_multiline.py:4:1: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_module_multiline.py:4:1: Q001 [*] Double quote multiline found but single quotes preferred | 4 | Double quotes multiline module docstring 5 | """ @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 8 8 | pass 9 9 | """ -./resources/test/fixtures/flake8_quotes/docstring_doubles_module_multiline.py:9:1: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_module_multiline.py:9:1: Q001 [*] Double quote multiline found but single quotes preferred | 9 | def foo(): 10 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap index 0eda675470..9a1a0da67b 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_doubles_module_singleline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_module_singleline.py:2:1: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_module_singleline.py:2:1: Q001 [*] Double quote multiline found but single quotes preferred | 2 | """ Double quotes singleline module docstring """ 3 | """ this is not a docstring """ @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | def foo(): 5 5 | pass -./resources/test/fixtures/flake8_quotes/docstring_doubles_module_singleline.py:6:1: Q001 [*] Double quote multiline found but single quotes preferred +docstring_doubles_module_singleline.py:6:1: Q001 [*] Double quote multiline found but single quotes preferred | 6 | def foo(): 7 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap index 926f3a23c5..4efbedbc86 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred | 1 | / ''' 2 | | Single quotes multiline module docstring @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | ''' 6 6 | this is not a docstring -./resources/test/fixtures/flake8_quotes/docstring_singles.py:14:5: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles.py:14:5: Q002 [*] Single quote docstring found but double quotes preferred | 14 | class params \t not a docstring 15 | ''')): @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 18 18 | ''' 19 19 | this is not a docstring -./resources/test/fixtures/flake8_quotes/docstring_singles.py:26:9: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles.py:26:9: Q002 [*] Single quote docstring found but double quotes preferred | 26 | definitely not a docstring''', 27 | val=l[Cls():3]): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap index 42e02af436..e19ebf847e 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_class.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_class.py:2:5: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_class.py:2:5: Q002 [*] Single quote docstring found but double quotes preferred | 2 | class SingleLineDocstrings(): 3 | ''' Double quotes single line class docstring ''' @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | 5 5 | def foo(self, bar='''not a docstring'''): -./resources/test/fixtures/flake8_quotes/docstring_singles_class.py:6:9: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_class.py:6:9: Q002 [*] Single quote docstring found but double quotes preferred | 6 | def foo(self, bar='''not a docstring'''): 7 | ''' Double quotes single line method docstring''' @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 8 8 | 9 9 | class Nested(foo()[:]): ''' inline docstring '''; pass -./resources/test/fixtures/flake8_quotes/docstring_singles_class.py:9:29: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_class.py:9:29: Q002 [*] Single quote docstring found but double quotes preferred | 9 | pass 10 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap index ee95abb2c6..bee8c44d2c 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_function.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:2:5: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_function.py:2:5: Q002 [*] Single quote docstring found but double quotes preferred | 2 | def foo(): 3 | '''function without params, single line docstring''' @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | return 5 5 | -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:8:5: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_function.py:8:5: Q002 [*] Single quote docstring found but double quotes preferred | 8 | def foo2(): 9 | ''' @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 12 12 | return 13 13 | -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:27:5: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_function.py:27:5: Q002 [*] Single quote docstring found but double quotes preferred | 27 | def function_with_single_docstring(a): 28 | 'Single line docstring' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap index 6045474d6c..a4858db55d 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_multiline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_module_multiline.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_module_multiline.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred | 1 | / ''' 2 | | Double quotes multiline module docstring diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap index eff28bcd94..b6f815e5e1 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_doubles_over_docstring_singles_module_singleline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_module_singleline.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred +docstring_singles_module_singleline.py:1:1: Q002 [*] Single quote docstring found but double quotes preferred | 1 | ''' Double quotes singleline module docstring ''' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Q002 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap index 1c69d39f2f..6e94e76e45 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:1:1: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles.py:1:1: Q002 [*] Double quote docstring found but single quotes preferred | 1 | / """ 2 | | Double quotes multiline module docstring @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | """ 6 6 | this is not a docstring -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:12:5: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles.py:12:5: Q002 [*] Double quote docstring found but single quotes preferred | 12 | class Cls: 13 | """ @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 16 16 | """ 17 17 | this is not a docstring -./resources/test/fixtures/flake8_quotes/docstring_doubles.py:24:9: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles.py:24:9: Q002 [*] Double quote docstring found but single quotes preferred | 24 | definitely not a docstring""", 25 | val=l[Cls():3]): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap index 66af181dda..086d8aaf0f 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_class.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_class.py:2:5: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_class.py:2:5: Q002 [*] Double quote docstring found but single quotes preferred | 2 | class SingleLineDocstrings(): 3 | """ Double quotes single line class docstring """ @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | 5 5 | def foo(self, bar="""not a docstring"""): -./resources/test/fixtures/flake8_quotes/docstring_doubles_class.py:6:9: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_class.py:6:9: Q002 [*] Double quote docstring found but single quotes preferred | 6 | def foo(self, bar="""not a docstring"""): 7 | """ Double quotes single line method docstring""" @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 8 8 | 9 9 | class Nested(foo()[:]): """ inline docstring """; pass -./resources/test/fixtures/flake8_quotes/docstring_doubles_class.py:9:29: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_class.py:9:29: Q002 [*] Double quote docstring found but single quotes preferred | 9 | pass 10 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap index 11d46ada8d..ec5cd21ffc 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_function.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:2:5: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_function.py:2:5: Q002 [*] Double quote docstring found but single quotes preferred | 2 | def foo(): 3 | """function without params, single line docstring""" @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | return 5 5 | -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:8:5: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_function.py:8:5: Q002 [*] Double quote docstring found but single quotes preferred | 8 | def foo2(): 9 | """ @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 12 12 | return 13 13 | -./resources/test/fixtures/flake8_quotes/docstring_doubles_function.py:27:5: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_function.py:27:5: Q002 [*] Double quote docstring found but single quotes preferred | 27 | def function_with_single_docstring(a): 28 | "Single line docstring" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap index 143a39074d..4a4a7d27dc 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_multiline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_module_multiline.py:1:1: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_module_multiline.py:1:1: Q002 [*] Double quote docstring found but single quotes preferred | 1 | / """ 2 | | Double quotes multiline module docstring diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap index cfe8b5d5e0..ba51829241 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_doubles_module_singleline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_doubles_module_singleline.py:1:1: Q002 [*] Double quote docstring found but single quotes preferred +docstring_doubles_module_singleline.py:1:1: Q002 [*] Double quote docstring found but single quotes preferred | 1 | """ Double quotes singleline module docstring """ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Q002 diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap index 1dc7ed8d46..1a8333a082 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles.py:5:1: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles.py:5:1: Q001 [*] Single quote multiline found but double quotes preferred | 5 | ''' 6 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 9 9 | l = [] 10 10 | -./resources/test/fixtures/flake8_quotes/docstring_singles.py:11:21: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles.py:11:21: Q001 [*] Single quote multiline found but double quotes preferred | 11 | l = [] 12 | @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 15 15 | Single quotes multiline class docstring 16 16 | ''' -./resources/test/fixtures/flake8_quotes/docstring_singles.py:18:5: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles.py:18:5: Q001 [*] Single quote multiline found but double quotes preferred | 18 | ''' 19 | @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 22 22 | # The colon in the list indexing below is an edge case for the docstring scanner 23 23 | def f(self, bar=''' -./resources/test/fixtures/flake8_quotes/docstring_singles.py:23:21: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles.py:23:21: Q001 [*] Single quote multiline found but double quotes preferred | 23 | # The colon in the list indexing below is an edge case for the docstring scanner 24 | def f(self, bar=''' @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 26 26 | ''' 27 27 | Single quotes multiline function docstring -./resources/test/fixtures/flake8_quotes/docstring_singles.py:32:9: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles.py:32:9: Q001 [*] Single quote multiline found but double quotes preferred | 32 | some_expression = 'hello world' 33 | @@ -132,7 +132,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 36 36 | if l: 37 37 | ''' -./resources/test/fixtures/flake8_quotes/docstring_singles.py:37:13: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles.py:37:13: Q001 [*] Single quote multiline found but double quotes preferred | 37 | if l: 38 | ''' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap index 3d82eead7c..3d76942e11 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_class.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_class.py:3:5: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_class.py:3:5: Q001 [*] Single quote multiline found but double quotes preferred | 3 | class SingleLineDocstrings(): 4 | ''' Double quotes single line class docstring ''' @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | def foo(self, bar='''not a docstring'''): 6 6 | ''' Double quotes single line method docstring''' -./resources/test/fixtures/flake8_quotes/docstring_singles_class.py:5:23: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_class.py:5:23: Q001 [*] Single quote multiline found but double quotes preferred | 5 | ''' Not a docstring ''' 6 | diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap index dd0f3c8528..efd76fda1d 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_function.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:3:5: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_function.py:3:5: Q001 [*] Single quote multiline found but double quotes preferred | 3 | def foo(): 4 | '''function without params, single line docstring''' @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | 6 6 | -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:11:5: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_function.py:11:5: Q001 [*] Single quote multiline found but double quotes preferred | 11 | function without params, multiline docstring 12 | ''' @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 13 13 | 14 14 | -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:15:39: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_function.py:15:39: Q001 [*] Single quote multiline found but double quotes preferred | 15 | def fun_with_params_no_docstring(a, b=''' | _______________________________________^ @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 19 19 | 20 20 | -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:17:5: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_function.py:17:5: Q001 [*] Single quote multiline found but double quotes preferred | 17 | def fun_with_params_no_docstring(a, b=''' 18 | not a @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 19 19 | 20 20 | -./resources/test/fixtures/flake8_quotes/docstring_singles_function.py:22:5: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_function.py:22:5: Q001 [*] Single quote multiline found but double quotes preferred | 22 | def fun_with_params_no_docstring2(a, b=c[foo():], c=\ 23 | ''' not a docstring '''): diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap index a8a8e33e1f..078d1732cf 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_multiline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_module_multiline.py:4:1: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_module_multiline.py:4:1: Q001 [*] Single quote multiline found but double quotes preferred | 4 | Double quotes multiline module docstring 5 | ''' @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 8 8 | pass 9 9 | ''' -./resources/test/fixtures/flake8_quotes/docstring_singles_module_multiline.py:9:1: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_module_multiline.py:9:1: Q001 [*] Single quote multiline found but double quotes preferred | 9 | def foo(): 10 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap index d7985d7141..046cf8c662 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_docstring_singles_over_docstring_singles_module_singleline.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/docstring_singles_module_singleline.py:2:1: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_module_singleline.py:2:1: Q001 [*] Single quote multiline found but double quotes preferred | 2 | ''' Double quotes singleline module docstring ''' 3 | ''' this is not a docstring ''' @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | def foo(): 5 5 | pass -./resources/test/fixtures/flake8_quotes/docstring_singles_module_singleline.py:6:1: Q001 [*] Single quote multiline found but double quotes preferred +docstring_singles_module_singleline.py:6:1: Q001 [*] Single quote multiline found but double quotes preferred | 6 | def foo(): 7 | pass diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap index b054951a4a..4df706d16a 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/singles.py:1:25: Q000 [*] Single quotes found but double quotes preferred +singles.py:1:25: Q000 [*] Single quotes found but double quotes preferred | 1 | this_should_be_linted = 'single quote string' | ^^^^^^^^^^^^^^^^^^^^^ Q000 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 3 3 | this_should_be_linted = f'double quote string' 4 4 | this_should_be_linted = f'double {"quote"} string' -./resources/test/fixtures/flake8_quotes/singles.py:2:25: Q000 [*] Single quotes found but double quotes preferred +singles.py:2:25: Q000 [*] Single quotes found but double quotes preferred | 2 | this_should_be_linted = 'single quote string' 3 | this_should_be_linted = u'double quote string' @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 3 3 | this_should_be_linted = f'double quote string' 4 4 | this_should_be_linted = f'double {"quote"} string' -./resources/test/fixtures/flake8_quotes/singles.py:3:25: Q000 [*] Single quotes found but double quotes preferred +singles.py:3:25: Q000 [*] Single quotes found but double quotes preferred | 3 | this_should_be_linted = 'single quote string' 4 | this_should_be_linted = u'double quote string' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap index 80945805fa..23790b700b 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_escaped.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/singles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner quotes +singles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner quotes | 1 | this_should_raise_Q003 = "This is a \"string\"" | ^^^^^^^^^^^^^^^^^^^^^^ Q003 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 3 3 | this_is_fine = 'This is a "string"' 4 4 | this_is_fine = '\'This\' is a "string"' -./resources/test/fixtures/flake8_quotes/singles_escaped.py:9:5: Q003 [*] Change outer quotes to avoid escaping inner quotes +singles_escaped.py:9:5: Q003 [*] Change outer quotes to avoid escaping inner quotes | 9 | this_should_raise = ( 10 | "This is a" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap index 246aa56d14..d89cbbd7fb 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_implicit.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/singles_implicit.py:2:5: Q000 [*] Single quotes found but double quotes preferred +singles_implicit.py:2:5: Q000 [*] Single quotes found but double quotes preferred | 2 | x = ( 3 | 'This' @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | 'not' 5 5 | ) -./resources/test/fixtures/flake8_quotes/singles_implicit.py:3:5: Q000 [*] Single quotes found but double quotes preferred +singles_implicit.py:3:5: Q000 [*] Single quotes found but double quotes preferred | 3 | x = ( 4 | 'This' @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | ) 6 6 | -./resources/test/fixtures/flake8_quotes/singles_implicit.py:4:5: Q000 [*] Single quotes found but double quotes preferred +singles_implicit.py:4:5: Q000 [*] Single quotes found but double quotes preferred | 4 | 'This' 5 | 'is' @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 6 6 | 7 7 | x = ( -./resources/test/fixtures/flake8_quotes/singles_implicit.py:8:5: Q000 [*] Single quotes found but double quotes preferred +singles_implicit.py:8:5: Q000 [*] Single quotes found but double quotes preferred | 8 | x = ( 9 | 'This' \ @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 10 10 | 'not' 11 11 | ) -./resources/test/fixtures/flake8_quotes/singles_implicit.py:9:5: Q000 [*] Single quotes found but double quotes preferred +singles_implicit.py:9:5: Q000 [*] Single quotes found but double quotes preferred | 9 | x = ( 10 | 'This' \ @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 11 11 | ) 12 12 | -./resources/test/fixtures/flake8_quotes/singles_implicit.py:10:5: Q000 [*] Single quotes found but double quotes preferred +singles_implicit.py:10:5: Q000 [*] Single quotes found but double quotes preferred | 10 | 'This' \ 11 | 'is' \ @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 12 12 | 13 13 | x = ( -./resources/test/fixtures/flake8_quotes/singles_implicit.py:27:1: Q000 [*] Single quotes found but double quotes preferred +singles_implicit.py:27:1: Q000 [*] Single quotes found but double quotes preferred | 27 | if True: 28 | 'This can use "single" quotes' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap index 26dc57ca1e..8477c544b3 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_doubles_over_singles_multiline_string.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/singles_multiline_string.py:1:5: Q001 [*] Single quote multiline found but double quotes preferred +singles_multiline_string.py:1:5: Q001 [*] Single quote multiline found but double quotes preferred | 1 | s = ''' This 'should' | _____^ diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap index c81493f9fd..9b8f3d6813 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/doubles.py:1:25: Q000 [*] Double quotes found but single quotes preferred +doubles.py:1:25: Q000 [*] Double quotes found but single quotes preferred | 1 | this_should_be_linted = "double quote string" | ^^^^^^^^^^^^^^^^^^^^^ Q000 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 3 3 | this_should_be_linted = f"double quote string" 4 4 | this_should_be_linted = f"double {'quote'} string" -./resources/test/fixtures/flake8_quotes/doubles.py:2:25: Q000 [*] Double quotes found but single quotes preferred +doubles.py:2:25: Q000 [*] Double quotes found but single quotes preferred | 2 | this_should_be_linted = "double quote string" 3 | this_should_be_linted = u"double quote string" @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 3 3 | this_should_be_linted = f"double quote string" 4 4 | this_should_be_linted = f"double {'quote'} string" -./resources/test/fixtures/flake8_quotes/doubles.py:3:25: Q000 [*] Double quotes found but single quotes preferred +doubles.py:3:25: Q000 [*] Double quotes found but single quotes preferred | 3 | this_should_be_linted = "double quote string" 4 | this_should_be_linted = u"double quote string" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap index aa4a511ad5..78eefc9ea8 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_escaped.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/doubles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner quotes +doubles_escaped.py:1:26: Q003 [*] Change outer quotes to avoid escaping inner quotes | 1 | this_should_raise_Q003 = 'This is a \'string\'' | ^^^^^^^^^^^^^^^^^^^^^^ Q003 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 3 3 | this_is_fine = '"This" is a \'string\'' 4 4 | this_is_fine = "This is a 'string'" -./resources/test/fixtures/flake8_quotes/doubles_escaped.py:2:26: Q003 [*] Change outer quotes to avoid escaping inner quotes +doubles_escaped.py:2:26: Q003 [*] Change outer quotes to avoid escaping inner quotes | 2 | this_should_raise_Q003 = 'This is a \'string\'' 3 | this_should_raise_Q003 = 'This is \\ a \\\'string\'' @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | this_is_fine = "This is a 'string'" 5 5 | this_is_fine = "\"This\" is a 'string'" -./resources/test/fixtures/flake8_quotes/doubles_escaped.py:10:5: Q003 [*] Change outer quotes to avoid escaping inner quotes +doubles_escaped.py:10:5: Q003 [*] Change outer quotes to avoid escaping inner quotes | 10 | this_should_raise = ( 11 | 'This is a' diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap index 831cb2153f..752b3b6c6c 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_implicit.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/doubles_implicit.py:2:5: Q000 [*] Double quotes found but single quotes preferred +doubles_implicit.py:2:5: Q000 [*] Double quotes found but single quotes preferred | 2 | x = ( 3 | "This" @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 4 4 | "not" 5 5 | ) -./resources/test/fixtures/flake8_quotes/doubles_implicit.py:3:5: Q000 [*] Double quotes found but single quotes preferred +doubles_implicit.py:3:5: Q000 [*] Double quotes found but single quotes preferred | 3 | x = ( 4 | "This" @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 5 5 | ) 6 6 | -./resources/test/fixtures/flake8_quotes/doubles_implicit.py:4:5: Q000 [*] Double quotes found but single quotes preferred +doubles_implicit.py:4:5: Q000 [*] Double quotes found but single quotes preferred | 4 | "This" 5 | "is" @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 6 6 | 7 7 | x = ( -./resources/test/fixtures/flake8_quotes/doubles_implicit.py:8:5: Q000 [*] Double quotes found but single quotes preferred +doubles_implicit.py:8:5: Q000 [*] Double quotes found but single quotes preferred | 8 | x = ( 9 | "This" \ @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 10 10 | "not" 11 11 | ) -./resources/test/fixtures/flake8_quotes/doubles_implicit.py:9:5: Q000 [*] Double quotes found but single quotes preferred +doubles_implicit.py:9:5: Q000 [*] Double quotes found but single quotes preferred | 9 | x = ( 10 | "This" \ @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 11 11 | ) 12 12 | -./resources/test/fixtures/flake8_quotes/doubles_implicit.py:10:5: Q000 [*] Double quotes found but single quotes preferred +doubles_implicit.py:10:5: Q000 [*] Double quotes found but single quotes preferred | 10 | "This" \ 11 | "is" \ @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_quotes/mod.rs 12 12 | 13 13 | x = ( -./resources/test/fixtures/flake8_quotes/doubles_implicit.py:27:1: Q000 [*] Double quotes found but single quotes preferred +doubles_implicit.py:27:1: Q000 [*] Double quotes found but single quotes preferred | 27 | if True: 28 | "This can use 'double' quotes" diff --git a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap index 31f97179e7..67502e94f2 100644 --- a/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap +++ b/crates/ruff/src/rules/flake8_quotes/snapshots/ruff__rules__flake8_quotes__tests__require_singles_over_doubles_multiline_string.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_quotes/mod.rs --- -./resources/test/fixtures/flake8_quotes/doubles_multiline_string.py:1:5: Q001 [*] Double quote multiline found but single quotes preferred +doubles_multiline_string.py:1:5: Q001 [*] Double quote multiline found but single quotes preferred | 1 | s = """ This "should" | _____^ diff --git a/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap b/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap index b58e39900a..9929242037 100644 --- a/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap +++ b/crates/ruff/src/rules/flake8_raise/snapshots/ruff__rules__flake8_raise__tests__unnecessary-paren-on-raise-exception_RSE102.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_raise/mod.rs --- -./resources/test/fixtures/flake8_raise/RSE102.py:5:21: RSE102 [*] Unnecessary parentheses on raised exception +RSE102.py:5:21: RSE102 [*] Unnecessary parentheses on raised exception | 5 | except TypeError: 6 | # RSE102 @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_raise/mod.rs 7 7 | try: 8 8 | x = 1 / 0 -./resources/test/fixtures/flake8_raise/RSE102.py:13:16: RSE102 [*] Unnecessary parentheses on raised exception +RSE102.py:13:16: RSE102 [*] Unnecessary parentheses on raised exception | 13 | # RSE102 14 | raise TypeError() @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_raise/mod.rs 15 15 | # RSE102 16 16 | raise TypeError () -./resources/test/fixtures/flake8_raise/RSE102.py:16:17: RSE102 [*] Unnecessary parentheses on raised exception +RSE102.py:16:17: RSE102 [*] Unnecessary parentheses on raised exception | 16 | # RSE102 17 | raise TypeError () @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/flake8_raise/mod.rs 18 18 | # RSE102 19 19 | raise TypeError \ -./resources/test/fixtures/flake8_raise/RSE102.py:20:5: RSE102 [*] Unnecessary parentheses on raised exception +RSE102.py:20:5: RSE102 [*] Unnecessary parentheses on raised exception | 20 | # RSE102 21 | raise TypeError \ @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_raise/mod.rs 22 21 | # RSE102 23 22 | raise TypeError( -./resources/test/fixtures/flake8_raise/RSE102.py:23:16: RSE102 [*] Unnecessary parentheses on raised exception +RSE102.py:23:16: RSE102 [*] Unnecessary parentheses on raised exception | 23 | # RSE102 24 | raise TypeError( @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/flake8_raise/mod.rs 27 25 | # RSE102 28 26 | raise TypeError( -./resources/test/fixtures/flake8_raise/RSE102.py:28:16: RSE102 [*] Unnecessary parentheses on raised exception +RSE102.py:28:16: RSE102 [*] Unnecessary parentheses on raised exception | 28 | # RSE102 29 | raise TypeError( diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap index c9ea0f1076..aa9ea5c4ad 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET501_RET501.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET501.py:4:5: RET501 [*] Do not explicitly `return None` in function if it is the only possible return value +RET501.py:4:5: RET501 [*] Do not explicitly `return None` in function if it is the only possible return value | 4 | if not y: 5 | return @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 6 6 | 7 7 | class BaseCache: -./resources/test/fixtures/flake8_return/RET501.py:14:9: RET501 [*] Do not explicitly `return None` in function if it is the only possible return value +RET501.py:14:9: RET501 [*] Do not explicitly `return None` in function if it is the only possible return value | 14 | def get(self, key: str) -> None: 15 | print(f"{key} not found") diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap index 1b2ae0b0b7..60ef9f2436 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET502_RET502.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET502.py:3:9: RET502 [*] Do not implicitly `return None` in function able to return non-`None` value +RET502.py:3:9: RET502 [*] Do not implicitly `return None` in function able to return non-`None` value | 3 | def x(y): 4 | if not y: diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap index 6047758531..42be1339a1 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET503_RET503.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET503.py:20:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:20:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 20 | # if/elif/else 21 | def x(y): @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 23 24 | 24 25 | -./resources/test/fixtures/flake8_return/RET503.py:27:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:27:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 27 | def x(y): 28 | if not y: @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 29 30 | return 2 30 31 | -./resources/test/fixtures/flake8_return/RET503.py:36:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:36:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 36 | return 1 37 | @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 38 39 | 39 40 | # for -./resources/test/fixtures/flake8_return/RET503.py:41:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:41:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 41 | # for 42 | def x(y): @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 45 46 | 46 47 | -./resources/test/fixtures/flake8_return/RET503.py:52:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:52:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 52 | return i 53 | else: @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 54 55 | 55 56 | # A nonexistent function -./resources/test/fixtures/flake8_return/RET503.py:59:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:59:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 59 | if x > 0: 60 | return False @@ -118,7 +118,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 61 62 | 62 63 | # A function that does return the control -./resources/test/fixtures/flake8_return/RET503.py:66:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:66:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 66 | if x > 0: 67 | return False @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 68 69 | 69 70 | ### -./resources/test/fixtures/flake8_return/RET503.py:82:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:82:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 82 | # last line in while loop 83 | def x(y): @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 87 88 | 88 89 | # exclude empty functions -./resources/test/fixtures/flake8_return/RET503.py:113:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:113:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 113 | # return value within loop 114 | def bar1(x, y, z): @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 118 119 | 119 120 | def bar3(x, y, z): -./resources/test/fixtures/flake8_return/RET503.py:120:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:120:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 120 | def bar3(x, y, z): 121 | for i in x: @@ -204,7 +204,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 128 129 | 129 130 | def bar1(x, y, z): -./resources/test/fixtures/flake8_return/RET503.py:130:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:130:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 130 | def bar1(x, y, z): 131 | for i in x: @@ -225,7 +225,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 135 136 | 136 137 | def bar3(x, y, z): -./resources/test/fixtures/flake8_return/RET503.py:137:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:137:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 137 | def bar3(x, y, z): 138 | for i in x: @@ -249,7 +249,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 145 146 | 146 147 | def prompts(self, foo): -./resources/test/fixtures/flake8_return/RET503.py:274:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:274:5: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 274 | return False 275 | @@ -269,7 +269,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 277 278 | 278 279 | def while_true(): -./resources/test/fixtures/flake8_return/RET503.py:291:13: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:291:13: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 291 | return 1 292 | case 1: @@ -287,7 +287,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 293 294 | 294 295 | def foo(baz: str) -> str: -./resources/test/fixtures/flake8_return/RET503.py:300:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:300:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 300 | def end_of_statement(): 301 | def example(): @@ -307,7 +307,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 303 304 | 304 305 | def example(): -./resources/test/fixtures/flake8_return/RET503.py:305:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:305:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 305 | def example(): 306 | if True: @@ -326,7 +326,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 308 309 | 309 310 | def example(): -./resources/test/fixtures/flake8_return/RET503.py:310:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:310:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 310 | def example(): 311 | if True: @@ -345,7 +345,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 313 314 | 314 315 | def example(): -./resources/test/fixtures/flake8_return/RET503.py:315:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:315:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 315 | def example(): 316 | if True: @@ -364,7 +364,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 318 319 | 319 320 | def example(): -./resources/test/fixtures/flake8_return/RET503.py:320:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value +RET503.py:320:9: RET503 [*] Missing explicit `return` at the end of function able to return non-`None` value | 320 | def example(): 321 | if True: diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap index e07d691b8a..f1968d62c6 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET504_RET504.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET504.py:6:12: RET504 Unnecessary variable assignment before `return` statement +RET504.py:6:12: RET504 Unnecessary variable assignment before `return` statement | 6 | def x(): 7 | a = 1 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs | ^ RET504 | -./resources/test/fixtures/flake8_return/RET504.py:249:12: RET504 Unnecessary variable assignment before `return` statement +RET504.py:249:12: RET504 Unnecessary variable assignment before `return` statement | 249 | def get_queryset(): 250 | queryset = Model.filter(a=1) diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap index 7b0d5998dd..6dabba0813 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET505_RET505.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET505.py:8:5: RET505 Unnecessary `elif` after `return` statement +RET505.py:8:5: RET505 Unnecessary `elif` after `return` statement | 8 | a = 1 9 | return y @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 12 | return w | -./resources/test/fixtures/flake8_return/RET505.py:23:5: RET505 Unnecessary `elif` after `return` statement +RET505.py:23:5: RET505 Unnecessary `elif` after `return` statement | 23 | b = 2 24 | return @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 27 | else: | -./resources/test/fixtures/flake8_return/RET505.py:41:5: RET505 Unnecessary `elif` after `return` statement +RET505.py:41:5: RET505 Unnecessary `elif` after `return` statement | 41 | a = 1 42 | return y @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 45 | return w | -./resources/test/fixtures/flake8_return/RET505.py:53:5: RET505 Unnecessary `else` after `return` statement +RET505.py:53:5: RET505 Unnecessary `else` after `return` statement | 53 | a = 1 54 | return y @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 57 | return z | -./resources/test/fixtures/flake8_return/RET505.py:64:9: RET505 Unnecessary `else` after `return` statement +RET505.py:64:9: RET505 Unnecessary `else` after `return` statement | 64 | b = 2 65 | return y @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 68 | return x | -./resources/test/fixtures/flake8_return/RET505.py:79:5: RET505 Unnecessary `else` after `return` statement +RET505.py:79:5: RET505 Unnecessary `else` after `return` statement | 79 | b = 2 80 | return @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 83 | return | -./resources/test/fixtures/flake8_return/RET505.py:89:9: RET505 Unnecessary `else` after `return` statement +RET505.py:89:9: RET505 Unnecessary `else` after `return` statement | 89 | a = 4 90 | return @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 93 | else: | -./resources/test/fixtures/flake8_return/RET505.py:99:5: RET505 Unnecessary `else` after `return` statement +RET505.py:99:5: RET505 Unnecessary `else` after `return` statement | 99 | if x: # [no-else-return] 100 | return True diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap index 30f97cd266..9d7beb9221 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET506_RET506.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET506.py:8:5: RET506 Unnecessary `elif` after `raise` statement +RET506.py:8:5: RET506 Unnecessary `elif` after `raise` statement | 8 | a = 1 9 | raise Exception(y) @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 12 | raise Exception(w) | -./resources/test/fixtures/flake8_return/RET506.py:23:5: RET506 Unnecessary `elif` after `raise` statement +RET506.py:23:5: RET506 Unnecessary `elif` after `raise` statement | 23 | b = 2 24 | raise Exception(x) @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 27 | else: | -./resources/test/fixtures/flake8_return/RET506.py:34:5: RET506 Unnecessary `else` after `raise` statement +RET506.py:34:5: RET506 Unnecessary `else` after `raise` statement | 34 | a = 1 35 | raise Exception(y) @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 38 | raise Exception(z) | -./resources/test/fixtures/flake8_return/RET506.py:45:9: RET506 Unnecessary `else` after `raise` statement +RET506.py:45:9: RET506 Unnecessary `else` after `raise` statement | 45 | b = 2 46 | raise Exception(y) @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 49 | raise Exception(x) | -./resources/test/fixtures/flake8_return/RET506.py:60:5: RET506 Unnecessary `else` after `raise` statement +RET506.py:60:5: RET506 Unnecessary `else` after `raise` statement | 60 | b = 2 61 | raise Exception(x) @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 64 | raise Exception(y) | -./resources/test/fixtures/flake8_return/RET506.py:70:9: RET506 Unnecessary `else` after `raise` statement +RET506.py:70:9: RET506 Unnecessary `else` after `raise` statement | 70 | a = 4 71 | raise Exception(x) @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 74 | else: | -./resources/test/fixtures/flake8_return/RET506.py:80:5: RET506 Unnecessary `else` after `raise` statement +RET506.py:80:5: RET506 Unnecessary `else` after `raise` statement | 80 | if x: # [no-else-raise] 81 | raise Exception(True) diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap index 7a52c07b75..57d9883f24 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET507_RET507.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET507.py:8:9: RET507 Unnecessary `elif` after `continue` statement +RET507.py:8:9: RET507 Unnecessary `elif` after `continue` statement | 8 | if i < y: # [no-else-continue] 9 | continue @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 12 | else: | -./resources/test/fixtures/flake8_return/RET507.py:22:9: RET507 Unnecessary `elif` after `continue` statement +RET507.py:22:9: RET507 Unnecessary `elif` after `continue` statement | 22 | b = 2 23 | continue @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 26 | else: | -./resources/test/fixtures/flake8_return/RET507.py:36:9: RET507 Unnecessary `else` after `continue` statement +RET507.py:36:9: RET507 Unnecessary `else` after `continue` statement | 36 | if i < y: # [no-else-continue] 37 | continue @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 39 | a = z | -./resources/test/fixtures/flake8_return/RET507.py:47:13: RET507 Unnecessary `else` after `continue` statement +RET507.py:47:13: RET507 Unnecessary `else` after `continue` statement | 47 | b = 2 48 | continue @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 51 | continue | -./resources/test/fixtures/flake8_return/RET507.py:63:9: RET507 Unnecessary `else` after `continue` statement +RET507.py:63:9: RET507 Unnecessary `else` after `continue` statement | 63 | b = 2 64 | continue @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 67 | continue | -./resources/test/fixtures/flake8_return/RET507.py:74:13: RET507 Unnecessary `else` after `continue` statement +RET507.py:74:13: RET507 Unnecessary `else` after `continue` statement | 74 | a = 4 75 | continue @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 78 | else: | -./resources/test/fixtures/flake8_return/RET507.py:85:9: RET507 Unnecessary `else` after `continue` statement +RET507.py:85:9: RET507 Unnecessary `else` after `continue` statement | 85 | if x: # [no-else-continue] 86 | continue diff --git a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap index 1176015bb5..7121e6e90e 100644 --- a/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap +++ b/crates/ruff/src/rules/flake8_return/snapshots/ruff__rules__flake8_return__tests__RET508_RET508.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_return/mod.rs --- -./resources/test/fixtures/flake8_return/RET508.py:8:9: RET508 Unnecessary `elif` after `break` statement +RET508.py:8:9: RET508 Unnecessary `elif` after `break` statement | 8 | if i > y: # [no-else-break] 9 | break @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 12 | else: | -./resources/test/fixtures/flake8_return/RET508.py:22:9: RET508 Unnecessary `elif` after `break` statement +RET508.py:22:9: RET508 Unnecessary `elif` after `break` statement | 22 | b = 2 23 | break @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 26 | else: | -./resources/test/fixtures/flake8_return/RET508.py:33:9: RET508 Unnecessary `else` after `break` statement +RET508.py:33:9: RET508 Unnecessary `else` after `break` statement | 33 | if i > y: # [no-else-break] 34 | break @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 36 | a = z | -./resources/test/fixtures/flake8_return/RET508.py:44:13: RET508 Unnecessary `else` after `break` statement +RET508.py:44:13: RET508 Unnecessary `else` after `break` statement | 44 | b = 2 45 | break @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 48 | break | -./resources/test/fixtures/flake8_return/RET508.py:60:9: RET508 Unnecessary `else` after `break` statement +RET508.py:60:9: RET508 Unnecessary `else` after `break` statement | 60 | b = 2 61 | break @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 64 | break | -./resources/test/fixtures/flake8_return/RET508.py:71:13: RET508 Unnecessary `else` after `break` statement +RET508.py:71:13: RET508 Unnecessary `else` after `break` statement | 71 | a = 4 72 | break @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_return/mod.rs 75 | else: | -./resources/test/fixtures/flake8_return/RET508.py:82:9: RET508 Unnecessary `else` after `break` statement +RET508.py:82:9: RET508 Unnecessary `else` after `break` statement | 82 | if x: # [no-else-break] 83 | break diff --git a/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap b/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap index 98fb36cea0..3cac4a877a 100644 --- a/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap +++ b/crates/ruff/src/rules/flake8_self/snapshots/ruff__rules__flake8_self__tests__private-member-access_SLF001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_self/mod.rs --- -./resources/test/fixtures/flake8_self/SLF001.py:34:12: SLF001 Private member accessed: `_private` +SLF001.py:34:12: SLF001 Private member accessed: `_private` | 34 | def get_bar(): 35 | if self.bar._private: # SLF001 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 37 | if self.bar()._private: # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:36:12: SLF001 Private member accessed: `_private` +SLF001.py:36:12: SLF001 Private member accessed: `_private` | 36 | if self.bar._private: # SLF001 37 | return None @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 40 | if Bar._private_thing: # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:38:12: SLF001 Private member accessed: `_private_thing` +SLF001.py:38:12: SLF001 Private member accessed: `_private_thing` | 38 | if self.bar()._private: # SLF001 39 | return None @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 42 | if Foo._private_thing: | -./resources/test/fixtures/flake8_self/SLF001.py:43:12: SLF001 Private member accessed: `_private_thing` +SLF001.py:43:12: SLF001 Private member accessed: `_private_thing` | 43 | return None 44 | Foo = Bar() @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 47 | return self.bar | -./resources/test/fixtures/flake8_self/SLF001.py:59:7: SLF001 Private member accessed: `_private_thing` +SLF001.py:59:7: SLF001 Private member accessed: `_private_thing` | 59 | foo = Foo() 60 | @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 63 | print(foo._private_func()) # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:60:7: SLF001 Private member accessed: `__really_private_thing` +SLF001.py:60:7: SLF001 Private member accessed: `__really_private_thing` | 60 | print(foo._private_thing) # SLF001 61 | print(foo.__really_private_thing) # SLF001 @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 63 | print(foo.__really_private_func(1)) # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:61:7: SLF001 Private member accessed: `_private_func` +SLF001.py:61:7: SLF001 Private member accessed: `_private_func` | 61 | print(foo._private_thing) # SLF001 62 | print(foo.__really_private_thing) # SLF001 @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 65 | print(foo.bar._private) # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:62:7: SLF001 Private member accessed: `__really_private_func` +SLF001.py:62:7: SLF001 Private member accessed: `__really_private_func` | 62 | print(foo.__really_private_thing) # SLF001 63 | print(foo._private_func()) # SLF001 @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 66 | print(foo()._private_thing) # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:63:7: SLF001 Private member accessed: `_private` +SLF001.py:63:7: SLF001 Private member accessed: `_private` | 63 | print(foo._private_func()) # SLF001 64 | print(foo.__really_private_func(1)) # SLF001 @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 67 | print(foo()._private_thing__) # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:64:7: SLF001 Private member accessed: `_private_thing` +SLF001.py:64:7: SLF001 Private member accessed: `_private_thing` | 64 | print(foo.__really_private_func(1)) # SLF001 65 | print(foo.bar._private) # SLF001 @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/flake8_self/mod.rs 67 | print(foo()._private_thing__) # SLF001 | -./resources/test/fixtures/flake8_self/SLF001.py:65:7: SLF001 Private member accessed: `_private_thing__` +SLF001.py:65:7: SLF001 Private member accessed: `_private_thing__` | 65 | print(foo.bar._private) # SLF001 66 | print(foo()._private_thing) # SLF001 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap index be1ceeb152..64414aa6ff 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM101_SIM101.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM101.py:1:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:1:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call | 1 | if isinstance(a, int) or isinstance(a, float): # SIM101 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SIM101 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | 4 4 | if isinstance(a, (int, float)) or isinstance(a, bool): # SIM101 -./resources/test/fixtures/flake8_simplify/SIM101.py:4:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:4:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call | 4 | pass 5 | @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 6 | 7 7 | if isinstance(a, int) or isinstance(a, float) or isinstance(b, bool): # SIM101 -./resources/test/fixtures/flake8_simplify/SIM101.py:7:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:7:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call | 7 | pass 8 | @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 9 9 | 10 10 | if isinstance(b, bool) or isinstance(a, int) or isinstance(a, float): # SIM101 -./resources/test/fixtures/flake8_simplify/SIM101.py:10:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:10:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call | 10 | pass 11 | @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 12 12 | 13 13 | if isinstance(a, int) or isinstance(b, bool) or isinstance(a, float): # SIM101 -./resources/test/fixtures/flake8_simplify/SIM101.py:13:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:13:4: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call | 13 | pass 14 | @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 15 15 | 16 16 | if (isinstance(a, int) or isinstance(a, float)) and isinstance(b, bool): # SIM101 -./resources/test/fixtures/flake8_simplify/SIM101.py:16:5: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call +SIM101.py:16:5: SIM101 [*] Multiple `isinstance` calls for `a`, merge into a single call | 16 | pass 17 | @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 18 18 | 19 19 | if isinstance(a.b, int) or isinstance(a.b, float): # SIM101 -./resources/test/fixtures/flake8_simplify/SIM101.py:19:4: SIM101 [*] Multiple `isinstance` calls for expression, merge into a single call +SIM101.py:19:4: SIM101 [*] Multiple `isinstance` calls for expression, merge into a single call | 19 | pass 20 | @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 21 21 | 22 22 | if isinstance(a(), int) or isinstance(a(), float): # SIM101 -./resources/test/fixtures/flake8_simplify/SIM101.py:22:4: SIM101 Multiple `isinstance` calls for expression, merge into a single call +SIM101.py:22:4: SIM101 Multiple `isinstance` calls for expression, merge into a single call | 22 | pass 23 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap index a9c6a98f80..4842f290f6 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM102_SIM102.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM102.py:2:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:2:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 2 | # SIM102 3 | / if a: @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 5 | # SIM102 7 6 | if a: -./resources/test/fixtures/flake8_simplify/SIM102.py:7:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:7:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 7 | # SIM102 8 | / if a: @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 12 11 | # SIM102 13 12 | if a: -./resources/test/fixtures/flake8_simplify/SIM102.py:15:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:15:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 15 | if a: 16 | pass @@ -72,7 +72,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 19 18 | # SIM102 20 19 | if a: -./resources/test/fixtures/flake8_simplify/SIM102.py:20:1: SIM102 Use a single `if` statement instead of nested `if` statements +SIM102.py:20:1: SIM102 Use a single `if` statement instead of nested `if` statements | 20 | # SIM102 21 | / if a: @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 24 | c | -./resources/test/fixtures/flake8_simplify/SIM102.py:26:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:26:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 26 | # SIM102 27 | / if a: @@ -108,7 +108,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 31 30 | # OK 32 31 | if a: -./resources/test/fixtures/flake8_simplify/SIM102.py:51:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:51:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 51 | while x > 0: 52 | # SIM102 @@ -146,7 +146,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 64 63 | 65 64 | -./resources/test/fixtures/flake8_simplify/SIM102.py:67:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:67:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 67 | # SIM102 68 | / if x > 0: @@ -182,7 +182,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 80 79 | 81 80 | while x > 0: -./resources/test/fixtures/flake8_simplify/SIM102.py:83:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:83:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 83 | while x > 0: 84 | # SIM102 @@ -213,7 +213,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 89 88 | # SIM102 90 89 | if node.module: -./resources/test/fixtures/flake8_simplify/SIM102.py:90:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:90:1: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 90 | # SIM102 91 | / if node.module: @@ -242,7 +242,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 96 95 | 97 96 | # OK -./resources/test/fixtures/flake8_simplify/SIM102.py:117:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements +SIM102.py:117:5: SIM102 [*] Use a single `if` statement instead of nested `if` statements | 117 | if a: 118 | # SIM 102 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap index f64f9ae41c..b05d2fb6f7 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM103_SIM103.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM103.py:3:5: SIM103 [*] Return the condition `a` directly +SIM103.py:3:5: SIM103 [*] Return the condition `a` directly | 3 | def f(): 4 | # SIM103 @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 5 | 9 6 | def f(): -./resources/test/fixtures/flake8_simplify/SIM103.py:11:5: SIM103 [*] Return the condition `a == b` directly +SIM103.py:11:5: SIM103 [*] Return the condition `a == b` directly | 11 | def f(): 12 | # SIM103 @@ -52,7 +52,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 16 13 | 17 14 | def f(): -./resources/test/fixtures/flake8_simplify/SIM103.py:21:5: SIM103 [*] Return the condition `b` directly +SIM103.py:21:5: SIM103 [*] Return the condition `b` directly | 21 | if a: 22 | return 1 @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 26 23 | 27 24 | def f(): -./resources/test/fixtures/flake8_simplify/SIM103.py:32:9: SIM103 [*] Return the condition `b` directly +SIM103.py:32:9: SIM103 [*] Return the condition `b` directly | 32 | return 1 33 | else: @@ -104,7 +104,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 37 34 | 38 35 | def f(): -./resources/test/fixtures/flake8_simplify/SIM103.py:57:5: SIM103 Return the condition `a` directly +SIM103.py:57:5: SIM103 Return the condition `a` directly | 57 | def f(): 58 | # SIM103 (but not fixable) @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | |___________________^ SIM103 | -./resources/test/fixtures/flake8_simplify/SIM103.py:83:5: SIM103 Return the condition `a` directly +SIM103.py:83:5: SIM103 Return the condition `a` directly | 83 | def bool(): 84 | return False diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap index faa0e60c0a..a04e2176a6 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM105_SIM105.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM105.py:4:1: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` +SIM105.py:4:1: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` | 4 | pass 5 | @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 10 10 | foo() 11 11 | except (ValueError, OSError): # SIM105 -./resources/test/fixtures/flake8_simplify/SIM105.py:9:1: SIM105 [*] Use `contextlib.suppress(ValueError, OSError)` instead of `try`-`except`-`pass` +SIM105.py:9:1: SIM105 [*] Use `contextlib.suppress(ValueError, OSError)` instead of `try`-`except`-`pass` | 9 | pass 10 | @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 15 15 | foo() 16 16 | except: # SIM105 -./resources/test/fixtures/flake8_simplify/SIM105.py:14:1: SIM105 [*] Use `contextlib.suppress(Exception)` instead of `try`-`except`-`pass` +SIM105.py:14:1: SIM105 [*] Use `contextlib.suppress(Exception)` instead of `try`-`except`-`pass` | 14 | pass 15 | @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 20 20 | foo() 21 21 | except (a.Error, b.Error): # SIM105 -./resources/test/fixtures/flake8_simplify/SIM105.py:19:1: SIM105 [*] Use `contextlib.suppress(a.Error, b.Error)` instead of `try`-`except`-`pass` +SIM105.py:19:1: SIM105 [*] Use `contextlib.suppress(a.Error, b.Error)` instead of `try`-`except`-`pass` | 19 | pass 20 | @@ -133,7 +133,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 25 25 | foo() 26 26 | except ValueError: -./resources/test/fixtures/flake8_simplify/SIM105.py:64:5: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` +SIM105.py:64:5: SIM105 [*] Use `contextlib.suppress(ValueError)` instead of `try`-`except`-`pass` | 64 | def with_ellipsis(): 65 | try: diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap index 855cc0dc8d..8b56f2eda8 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM107_SIM107.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM107.py:9:9: SIM107 Don't use `return` in `try`/`except` and `finally` +SIM107.py:9:9: SIM107 Don't use `return` in `try`/`except` and `finally` | 9 | return "2" 10 | finally: diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap index 0b5721568e..f5880f24ad 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM108_SIM108.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM108.py:2:1: SIM108 [*] Use ternary operator `b = c if a else d` instead of `if`-`else`-block +SIM108.py:2:1: SIM108 [*] Use ternary operator `b = c if a else d` instead of `if`-`else`-block | 2 | # SIM108 3 | / if a: @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 7 4 | # OK 8 5 | b = c if a else d -./resources/test/fixtures/flake8_simplify/SIM108.py:58:1: SIM108 Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-block +SIM108.py:58:1: SIM108 Use ternary operator `abc = x if x > 0 else -x` instead of `if`-`else`-block | 58 | # SIM108 (without fix due to comments) 59 | / if x > 0: @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | |____________^ SIM108 | -./resources/test/fixtures/flake8_simplify/SIM108.py:82:1: SIM108 [*] Use ternary operator `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd` instead of `if`-`else`-block +SIM108.py:82:1: SIM108 [*] Use ternary operator `b = cccccccccccccccccccccccccccccccccccc if a else ddddddddddddddddddddddddddddddddddddd` instead of `if`-`else`-block | 82 | # SIM108 83 | / if a: @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 87 84 | 88 85 | # OK (too long) -./resources/test/fixtures/flake8_simplify/SIM108.py:97:1: SIM108 Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else`-block +SIM108.py:97:1: SIM108 Use ternary operator `exitcode = 0 if True else 1` instead of `if`-`else`-block | 97 | # SIM108 (without fix due to trailing comment) 98 | / if True: @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | |________________^ SIM108 | -./resources/test/fixtures/flake8_simplify/SIM108.py:104:1: SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block +SIM108.py:104:1: SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block | 104 | # SIM108 105 | / if True: x = 3 # Foo @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | |___________^ SIM108 | -./resources/test/fixtures/flake8_simplify/SIM108.py:109:1: SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block +SIM108.py:109:1: SIM108 Use ternary operator `x = 3 if True else 5` instead of `if`-`else`-block | 109 | # SIM108 110 | / if True: # Foo diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap index 8374911252..29a1fd24cf 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM109_SIM109.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM109.py:2:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:2:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons | 2 | # SIM109 3 | if a == b or a == c: @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 4 4 | 5 5 | # SIM109 -./resources/test/fixtures/flake8_simplify/SIM109.py:6:5: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:6:5: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons | 6 | # SIM109 7 | if (a == b or a == c) and None: @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 8 | 9 9 | # SIM109 -./resources/test/fixtures/flake8_simplify/SIM109.py:10:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:10:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons | 10 | # SIM109 11 | if a == b or a == c or None: @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 12 12 | 13 13 | # SIM109 -./resources/test/fixtures/flake8_simplify/SIM109.py:14:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons +SIM109.py:14:4: SIM109 [*] Use `a in (b, c)` instead of multiple equality comparisons | 14 | # SIM109 15 | if a == b or None or a == c: diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap index 64a931ecd8..08c0ee517a 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM110.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM110.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 3 | def f(): 4 | # SIM110 @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 5 | 9 6 | def f(): -./resources/test/fixtures/flake8_simplify/SIM110.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 25 | def f(): 26 | # SIM111 @@ -52,7 +52,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 30 27 | 31 28 | def f(): -./resources/test/fixtures/flake8_simplify/SIM110.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop +SIM110.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop | 33 | def f(): 34 | # SIM111 @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 38 35 | 39 36 | def f(): -./resources/test/fixtures/flake8_simplify/SIM110.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 55 | def f(): 56 | # SIM110 @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 61 57 | 62 58 | def f(): -./resources/test/fixtures/flake8_simplify/SIM110.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 64 | def f(): 65 | # SIM111 @@ -134,7 +134,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 70 66 | 71 67 | def f(): -./resources/test/fixtures/flake8_simplify/SIM110.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 73 | def f(): 74 | # SIM110 @@ -163,7 +163,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 79 75 | 80 76 | -./resources/test/fixtures/flake8_simplify/SIM110.py:83:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:83:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 83 | def f(): 84 | # SIM111 @@ -192,7 +192,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 89 85 | 90 86 | -./resources/test/fixtures/flake8_simplify/SIM110.py:124:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:124:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 124 | pass 125 | @@ -205,7 +205,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | = help: Replace with `return any(check(x) for x in iterable)` -./resources/test/fixtures/flake8_simplify/SIM110.py:134:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:134:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 134 | pass 135 | @@ -218,7 +218,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | = help: Replace with `return all(not check(x) for x in iterable)` -./resources/test/fixtures/flake8_simplify/SIM110.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM110.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 144 | # SIM110 145 | for x in iterable: @@ -243,7 +243,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 149 146 | 150 147 | def f(): -./resources/test/fixtures/flake8_simplify/SIM110.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM110.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 154 | # SIM111 155 | for x in iterable: diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap index 0bf233a47e..82ce8fd6b3 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM110_SIM111.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM111.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:3:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 3 | def f(): 4 | # SIM110 @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 5 | 9 6 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:25:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 25 | def f(): 26 | # SIM111 @@ -52,7 +52,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 30 27 | 31 28 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop +SIM111.py:33:5: SIM110 [*] Use `return all(x.is_empty() for x in iterable)` instead of `for` loop | 33 | def f(): 34 | # SIM111 @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 38 35 | 39 36 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:55:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 55 | def f(): 56 | # SIM110 @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 61 57 | 62 58 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:64:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 64 | def f(): 65 | # SIM111 @@ -134,7 +134,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 70 66 | 71 67 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:73:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 73 | def f(): 74 | # SIM110 @@ -163,7 +163,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 79 75 | 80 76 | -./resources/test/fixtures/flake8_simplify/SIM111.py:83:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:83:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 83 | def f(): 84 | # SIM111 @@ -192,7 +192,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 89 85 | 90 86 | -./resources/test/fixtures/flake8_simplify/SIM111.py:124:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:124:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 124 | pass 125 | @@ -205,7 +205,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | = help: Replace with `return any(check(x) for x in iterable)` -./resources/test/fixtures/flake8_simplify/SIM111.py:134:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:134:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 134 | pass 135 | @@ -218,7 +218,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs | = help: Replace with `return all(not check(x) for x in iterable)` -./resources/test/fixtures/flake8_simplify/SIM111.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop +SIM111.py:144:5: SIM110 [*] Use `return any(check(x) for x in iterable)` instead of `for` loop | 144 | # SIM110 145 | for x in iterable: @@ -243,7 +243,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 149 146 | 150 147 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop +SIM111.py:154:5: SIM110 [*] Use `return all(not check(x) for x in iterable)` instead of `for` loop | 154 | # SIM111 155 | for x in iterable: @@ -268,7 +268,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 159 156 | 160 157 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:162:5: SIM110 [*] Use `return all(x in y for x in iterable)` instead of `for` loop +SIM111.py:162:5: SIM110 [*] Use `return all(x in y for x in iterable)` instead of `for` loop | 162 | def f(): 163 | # SIM111 @@ -294,7 +294,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 167 164 | 168 165 | def f(): -./resources/test/fixtures/flake8_simplify/SIM111.py:170:5: SIM110 [*] Use `return all(x <= y for x in iterable)` instead of `for` loop +SIM111.py:170:5: SIM110 [*] Use `return all(x <= y for x in iterable)` instead of `for` loop | 170 | def f(): 171 | # SIM111 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap index df2c7c4efb..f2dc2b0570 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM112_SIM112.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM112.py:4:12: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:4:12: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 4 | # Bad 5 | os.environ['foo'] @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 6 | os.environ.get('foo') 7 7 | -./resources/test/fixtures/flake8_simplify/SIM112.py:6:16: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:6:16: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 6 | os.environ['foo'] 7 | @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 8 | os.environ.get('foo', 'bar') 9 9 | -./resources/test/fixtures/flake8_simplify/SIM112.py:8:16: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:8:16: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 8 | os.environ.get('foo') 9 | @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 10 10 | os.getenv('foo') 11 11 | -./resources/test/fixtures/flake8_simplify/SIM112.py:10:11: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:10:11: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 10 | os.environ.get('foo', 'bar') 11 | @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 12 12 | env = os.environ.get('foo') 13 13 | -./resources/test/fixtures/flake8_simplify/SIM112.py:12:22: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:12:22: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 12 | os.getenv('foo') 13 | @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 14 14 | env = os.environ['foo'] 15 15 | -./resources/test/fixtures/flake8_simplify/SIM112.py:14:18: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:14:18: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 14 | env = os.environ.get('foo') 15 | @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 16 16 | if env := os.environ.get('foo'): 17 17 | pass -./resources/test/fixtures/flake8_simplify/SIM112.py:16:26: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:16:26: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 16 | env = os.environ['foo'] 17 | @@ -146,7 +146,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 18 18 | 19 19 | if env := os.environ['foo']: -./resources/test/fixtures/flake8_simplify/SIM112.py:19:22: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` +SIM112.py:19:22: SIM112 [*] Use capitalized environment variable `FOO` instead of `foo` | 19 | pass 20 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap index 01d8df085a..8e8fc8eca3 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM114_SIM114.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM114.py:2:1: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:2:1: SIM114 Combine `if` branches using logical `or` operator | 2 | # Errors 3 | / if a: @@ -13,7 +13,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 | if x == 1: | -./resources/test/fixtures/flake8_simplify/SIM114.py:7:1: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:7:1: SIM114 Combine `if` branches using logical `or` operator | 7 | b 8 | @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 16 | if x == 1: | -./resources/test/fixtures/flake8_simplify/SIM114.py:14:1: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:14:1: SIM114 Combine `if` branches using logical `or` operator | 14 | print("hello") 15 | @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 25 | if x == 1: | -./resources/test/fixtures/flake8_simplify/SIM114.py:23:1: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:23:1: SIM114 Combine `if` branches using logical `or` operator | 23 | print("hello") 24 | @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 40 | if ( | -./resources/test/fixtures/flake8_simplify/SIM114.py:24:5: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:24:5: SIM114 Combine `if` branches using logical `or` operator | 24 | if x == 1: 25 | if True: @@ -83,7 +83,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 32 | if True: | -./resources/test/fixtures/flake8_simplify/SIM114.py:31:5: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:31:5: SIM114 Combine `if` branches using logical `or` operator | 31 | print("hello") 32 | elif x == 2: @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 40 | if ( | -./resources/test/fixtures/flake8_simplify/SIM114.py:38:1: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:38:1: SIM114 Combine `if` branches using logical `or` operator | 38 | print("hello") 39 | @@ -127,7 +127,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 60 | if result.eofs == "O": | -./resources/test/fixtures/flake8_simplify/SIM114.py:62:6: SIM114 Combine `if` branches using logical `or` operator +SIM114.py:62:6: SIM114 Combine `if` branches using logical `or` operator | 62 | elif result.eofs == "S": 63 | skipped = 1 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap index cd03d59aaf..76fc548a62 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM115_SIM115.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM115.py:4:5: SIM115 Use context handler for opening files +SIM115.py:4:5: SIM115 Use context handler for opening files | 4 | # SIM115 5 | f = open("foo.txt") @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 7 | f.close() | -./resources/test/fixtures/flake8_simplify/SIM115.py:31:9: SIM115 Use context handler for opening files +SIM115.py:31:9: SIM115 Use context handler for opening files | 31 | # SIM115 32 | with contextlib.ExitStack(): diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap index 2825b647e5..cfda715867 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM116_SIM116.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM116.py:5:1: SIM116 Use a dictionary instead of consecutive `if` statements +SIM116.py:5:1: SIM116 Use a dictionary instead of consecutive `if` statements | 5 | # SIM116 6 | / if a == "foo": @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 15 | # SIM116 | -./resources/test/fixtures/flake8_simplify/SIM116.py:15:1: SIM116 Use a dictionary instead of consecutive `if` statements +SIM116.py:15:1: SIM116 Use a dictionary instead of consecutive `if` statements | 15 | # SIM116 16 | / if a == 1: @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 25 | # SIM116 | -./resources/test/fixtures/flake8_simplify/SIM116.py:25:1: SIM116 Use a dictionary instead of consecutive `if` statements +SIM116.py:25:1: SIM116 Use a dictionary instead of consecutive `if` statements | 25 | # SIM116 26 | / if a == 1: @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 33 | # SIM116 | -./resources/test/fixtures/flake8_simplify/SIM116.py:33:1: SIM116 Use a dictionary instead of consecutive `if` statements +SIM116.py:33:1: SIM116 Use a dictionary instead of consecutive `if` statements | 33 | # SIM116 34 | / if a == "hello 'sir'": @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 43 | # SIM116 | -./resources/test/fixtures/flake8_simplify/SIM116.py:43:1: SIM116 Use a dictionary instead of consecutive `if` statements +SIM116.py:43:1: SIM116 Use a dictionary instead of consecutive `if` statements | 43 | # SIM116 44 | / if a == b"one": @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 51 | # SIM116 | -./resources/test/fixtures/flake8_simplify/SIM116.py:51:1: SIM116 Use a dictionary instead of consecutive `if` statements +SIM116.py:51:1: SIM116 Use a dictionary instead of consecutive `if` statements | 51 | # SIM116 52 | / if a == "hello 'sir'": @@ -93,7 +93,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 61 | # OK | -./resources/test/fixtures/flake8_simplify/SIM116.py:79:1: SIM116 Use a dictionary instead of consecutive `if` statements +SIM116.py:79:1: SIM116 Use a dictionary instead of consecutive `if` statements | 79 | # SIM116 80 | / if func_name == "create": diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap index 475d9d034c..452b0c5b7a 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM117_SIM117.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM117.py:2:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:2:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements | 2 | # SIM117 3 | / with A() as a: @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 5 | # SIM117 7 6 | with A(): -./resources/test/fixtures/flake8_simplify/SIM117.py:7:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:7:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements | 7 | # SIM117 8 | / with A(): @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 12 11 | # SIM117 13 12 | with A() as a: -./resources/test/fixtures/flake8_simplify/SIM117.py:13:1: SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:13:1: SIM117 Use a single `with` statement with multiple contexts instead of nested `with` statements | 13 | # SIM117 14 | / with A() as a: @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 17 | print("hello") | -./resources/test/fixtures/flake8_simplify/SIM117.py:19:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:19:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements | 19 | # SIM117 20 | / with A() as a: @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 24 23 | # OK 25 24 | with A() as a: -./resources/test/fixtures/flake8_simplify/SIM117.py:53:5: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:53:5: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements | 53 | while True: 54 | # SIM117 @@ -122,7 +122,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 66 65 | 67 66 | # SIM117 -./resources/test/fixtures/flake8_simplify/SIM117.py:68:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:68:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements | 68 | # SIM117 69 | / with ( @@ -149,7 +149,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 75 74 | # SIM117 76 75 | with A() as a: -./resources/test/fixtures/flake8_simplify/SIM117.py:76:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:76:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements | 76 | # SIM117 77 | / with A() as a: @@ -181,7 +181,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 83 82 | # SIM117 84 83 | with ( -./resources/test/fixtures/flake8_simplify/SIM117.py:84:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements +SIM117.py:84:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements | 84 | # SIM117 85 | / with ( diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap index 888da7ce7e..e117a62d53 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM118_SIM118.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM118.py:1:1: SIM118 [*] Use `key in obj` instead of `key in obj.keys()` +SIM118.py:1:1: SIM118 [*] Use `key in obj` instead of `key in obj.keys()` | 1 | key in obj.keys() # SIM118 | ^^^^^^^^^^^^^^^^^ SIM118 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | foo["bar"] in obj.keys() # SIM118 4 4 | -./resources/test/fixtures/flake8_simplify/SIM118.py:3:1: SIM118 [*] Use `foo["bar"] in obj` instead of `foo["bar"] in obj.keys()` +SIM118.py:3:1: SIM118 [*] Use `foo["bar"] in obj` instead of `foo["bar"] in obj.keys()` | 3 | key in obj.keys() # SIM118 4 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 5 5 | foo['bar'] in obj.keys() # SIM118 6 6 | -./resources/test/fixtures/flake8_simplify/SIM118.py:5:1: SIM118 [*] Use `foo['bar'] in obj` instead of `foo['bar'] in obj.keys()` +SIM118.py:5:1: SIM118 [*] Use `foo['bar'] in obj` instead of `foo['bar'] in obj.keys()` | 5 | foo["bar"] in obj.keys() # SIM118 6 | @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 7 7 | foo() in obj.keys() # SIM118 8 8 | -./resources/test/fixtures/flake8_simplify/SIM118.py:7:1: SIM118 [*] Use `foo() in obj` instead of `foo() in obj.keys()` +SIM118.py:7:1: SIM118 [*] Use `foo() in obj` instead of `foo() in obj.keys()` | 7 | foo['bar'] in obj.keys() # SIM118 8 | @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 9 9 | for key in obj.keys(): # SIM118 10 10 | pass -./resources/test/fixtures/flake8_simplify/SIM118.py:9:5: SIM118 [*] Use `key in obj` instead of `key in obj.keys()` +SIM118.py:9:5: SIM118 [*] Use `key in obj` instead of `key in obj.keys()` | 9 | foo() in obj.keys() # SIM118 10 | @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 11 11 | 12 12 | for key in list(obj.keys()): -./resources/test/fixtures/flake8_simplify/SIM118.py:16:8: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` +SIM118.py:16:8: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` | 16 | del obj[key] 17 | @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 18 18 | {k for k in obj.keys()} # SIM118 19 19 | -./resources/test/fixtures/flake8_simplify/SIM118.py:18:8: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` +SIM118.py:18:8: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` | 18 | [k for k in obj.keys()] # SIM118 19 | @@ -141,7 +141,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 20 20 | {k: k for k in obj.keys()} # SIM118 21 21 | -./resources/test/fixtures/flake8_simplify/SIM118.py:20:11: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` +SIM118.py:20:11: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` | 20 | {k for k in obj.keys()} # SIM118 21 | @@ -162,7 +162,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 22 22 | (k for k in obj.keys()) # SIM118 23 23 | -./resources/test/fixtures/flake8_simplify/SIM118.py:22:8: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` +SIM118.py:22:8: SIM118 [*] Use `k in obj` instead of `k in obj.keys()` | 22 | {k: k for k in obj.keys()} # SIM118 23 | @@ -182,7 +182,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 23 23 | 24 24 | key in (obj or {}).keys() # SIM118 -./resources/test/fixtures/flake8_simplify/SIM118.py:24:1: SIM118 [*] Use `key in (obj or {})` instead of `key in (obj or {}).keys()` +SIM118.py:24:1: SIM118 [*] Use `key in (obj or {})` instead of `key in (obj or {}).keys()` | 24 | (k for k in obj.keys()) # SIM118 25 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap index e80a7505af..0f8bd66f9e 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM201_SIM201.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM201.py:2:4: SIM201 [*] Use `a != b` instead of `not a == b` +SIM201.py:2:4: SIM201 [*] Use `a != b` instead of `not a == b` | 2 | # SIM201 3 | if not a == b: @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 4 4 | 5 5 | # SIM201 -./resources/test/fixtures/flake8_simplify/SIM201.py:6:4: SIM201 [*] Use `a != b + c` instead of `not a == b + c` +SIM201.py:6:4: SIM201 [*] Use `a != b + c` instead of `not a == b + c` | 6 | # SIM201 7 | if not a == (b + c): @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 8 | 9 9 | # SIM201 -./resources/test/fixtures/flake8_simplify/SIM201.py:10:4: SIM201 [*] Use `a + b != c` instead of `not a + b == c` +SIM201.py:10:4: SIM201 [*] Use `a + b != c` instead of `not a + b == c` | 10 | # SIM201 11 | if not (a + b) == c: diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap index b617d77c76..629d3db1c0 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM202_SIM202.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM202.py:2:4: SIM202 [*] Use `a == b` instead of `not a != b` +SIM202.py:2:4: SIM202 [*] Use `a == b` instead of `not a != b` | 2 | # SIM202 3 | if not a != b: @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 4 4 | 5 5 | # SIM202 -./resources/test/fixtures/flake8_simplify/SIM202.py:6:4: SIM202 [*] Use `a == b + c` instead of `not a != b + c` +SIM202.py:6:4: SIM202 [*] Use `a == b + c` instead of `not a != b + c` | 6 | # SIM202 7 | if not a != (b + c): @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 8 | 9 9 | # SIM202 -./resources/test/fixtures/flake8_simplify/SIM202.py:10:4: SIM202 [*] Use `a + b == c` instead of `not a + b != c` +SIM202.py:10:4: SIM202 [*] Use `a + b == c` instead of `not a + b != c` | 10 | # SIM202 11 | if not (a + b) != c: diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap index eda61f1f6b..f728d12c3a 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM208_SIM208.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM208.py:1:4: SIM208 [*] Use `a` instead of `not (not a)` +SIM208.py:1:4: SIM208 [*] Use `a` instead of `not (not a)` | 1 | if not (not a): # SIM208 | ^^^^^^^^^^^ SIM208 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | 4 4 | if not (not (a == b)): # SIM208 -./resources/test/fixtures/flake8_simplify/SIM208.py:4:4: SIM208 [*] Use `a == b` instead of `not (not a == b)` +SIM208.py:4:4: SIM208 [*] Use `a == b` instead of `not (not a == b)` | 4 | pass 5 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap index 9ad6597f22..f8c226d035 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM210_SIM210.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM210.py:1:5: SIM210 [*] Use `bool(b)` instead of `True if b else False` +SIM210.py:1:5: SIM210 [*] Use `bool(b)` instead of `True if b else False` | 1 | a = True if b else False # SIM210 | ^^^^^^^^^^^^^^^^^^^^ SIM210 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | a = True if b != c else False # SIM210 4 4 | -./resources/test/fixtures/flake8_simplify/SIM210.py:3:5: SIM210 [*] Use `bool(b != c)` instead of `True if b != c else False` +SIM210.py:3:5: SIM210 [*] Use `bool(b != c)` instead of `True if b != c else False` | 3 | a = True if b else False # SIM210 4 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 5 5 | a = True if b + c else False # SIM210 6 6 | -./resources/test/fixtures/flake8_simplify/SIM210.py:5:5: SIM210 [*] Use `bool(b + c)` instead of `True if b + c else False` +SIM210.py:5:5: SIM210 [*] Use `bool(b + c)` instead of `True if b + c else False` | 5 | a = True if b != c else False # SIM210 6 | @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 7 7 | a = False if b else True # OK 8 8 | -./resources/test/fixtures/flake8_simplify/SIM210.py:14:9: SIM210 [*] Use `bool(b)` instead of `True if b else False` +SIM210.py:14:9: SIM210 [*] Use `bool(b)` instead of `True if b else False` | 14 | return False 15 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap index 8d03ff9068..1fa6543249 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM211_SIM211.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM211.py:1:5: SIM211 [*] Use `not b` instead of `False if b else True` +SIM211.py:1:5: SIM211 [*] Use `not b` instead of `False if b else True` | 1 | a = False if b else True # SIM211 | ^^^^^^^^^^^^^^^^^^^^ SIM211 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | a = False if b != c else True # SIM211 4 4 | -./resources/test/fixtures/flake8_simplify/SIM211.py:3:5: SIM211 [*] Use `not b != c` instead of `False if b != c else True` +SIM211.py:3:5: SIM211 [*] Use `not b != c` instead of `False if b != c else True` | 3 | a = False if b else True # SIM211 4 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 5 5 | a = False if b + c else True # SIM211 6 6 | -./resources/test/fixtures/flake8_simplify/SIM211.py:5:5: SIM211 [*] Use `not b + c` instead of `False if b + c else True` +SIM211.py:5:5: SIM211 [*] Use `not b + c` instead of `False if b + c else True` | 5 | a = False if b != c else True # SIM211 6 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap index 455fa594ee..55c0c7b61d 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM212_SIM212.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM212.py:1:5: SIM212 [*] Use `a if a else b` instead of `b if not a else a` +SIM212.py:1:5: SIM212 [*] Use `a if a else b` instead of `b if not a else a` | 1 | c = b if not a else a # SIM212 | ^^^^^^^^^^^^^^^^^ SIM212 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | c = b + c if not a else a # SIM212 4 4 | -./resources/test/fixtures/flake8_simplify/SIM212.py:3:5: SIM212 [*] Use `a if a else b + c` instead of `b + c if not a else a` +SIM212.py:3:5: SIM212 [*] Use `a if a else b + c` instead of `b + c if not a else a` | 3 | c = b if not a else a # SIM212 4 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap index a880c41685..619935005c 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM220_SIM220.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM220.py:1:4: SIM220 [*] Use `False` instead of `a and not a` +SIM220.py:1:4: SIM220 [*] Use `False` instead of `a and not a` | 1 | if a and not a: | ^^^^^^^^^^^ SIM220 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | 4 4 | if (a and not a) and b: -./resources/test/fixtures/flake8_simplify/SIM220.py:4:5: SIM220 [*] Use `False` instead of `a and not a` +SIM220.py:4:5: SIM220 [*] Use `False` instead of `a and not a` | 4 | pass 5 | @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 6 | 7 7 | if (a and not a) or b: -./resources/test/fixtures/flake8_simplify/SIM220.py:7:5: SIM220 [*] Use `False` instead of `a and not a` +SIM220.py:7:5: SIM220 [*] Use `False` instead of `a and not a` | 7 | pass 8 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap index 5318b460fd..8d77d4a3b3 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM221_SIM221.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM221.py:1:4: SIM221 [*] Use `True` instead of `a or not a` +SIM221.py:1:4: SIM221 [*] Use `True` instead of `a or not a` | 1 | if a or not a: | ^^^^^^^^^^ SIM221 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | 4 4 | if (a or not a) or b: -./resources/test/fixtures/flake8_simplify/SIM221.py:4:5: SIM221 [*] Use `True` instead of `a or not a` +SIM221.py:4:5: SIM221 [*] Use `True` instead of `a or not a` | 4 | pass 5 | @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 6 | 7 7 | if (a or not a) and b: -./resources/test/fixtures/flake8_simplify/SIM221.py:7:5: SIM221 [*] Use `True` instead of `a or not a` +SIM221.py:7:5: SIM221 [*] Use `True` instead of `a or not a` | 7 | pass 8 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap index 239c42bee5..bc48aca9dc 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM222_SIM222.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM222.py:1:4: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:1:4: SIM222 [*] Use `True` instead of `... or True` | 1 | if a or True: # SIM222 | ^^^^^^^^^ SIM222 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | 4 4 | if (a or b) or True: # SIM222 -./resources/test/fixtures/flake8_simplify/SIM222.py:4:4: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:4:4: SIM222 [*] Use `True` instead of `... or True` | 4 | pass 5 | @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 6 | 7 7 | if a or (b or True): # SIM222 -./resources/test/fixtures/flake8_simplify/SIM222.py:7:10: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:7:10: SIM222 [*] Use `True` instead of `... or True` | 7 | pass 8 | @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 9 9 | 10 10 | if a and True: # OK -./resources/test/fixtures/flake8_simplify/SIM222.py:24:16: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:24:16: SIM222 [*] Use `True` instead of `... or True` | 24 | pass 25 | @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 26 26 | 27 27 | if True or f() or a or g() or b: # SIM222 -./resources/test/fixtures/flake8_simplify/SIM222.py:27:4: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:27:4: SIM222 [*] Use `True` instead of `... or True` | 27 | pass 28 | @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 29 29 | 30 30 | if a or True or f() or b or g(): # SIM222 -./resources/test/fixtures/flake8_simplify/SIM222.py:30:4: SIM222 [*] Use `True` instead of `... or True` +SIM222.py:30:4: SIM222 [*] Use `True` instead of `... or True` | 30 | pass 31 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap index dddde2eae5..719c69df04 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM223_SIM223.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM223.py:1:4: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:1:4: SIM223 [*] Use `False` instead of `... and False` | 1 | if a and False: # SIM223 | ^^^^^^^^^^^ SIM223 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 3 3 | 4 4 | if (a or b) and False: # SIM223 -./resources/test/fixtures/flake8_simplify/SIM223.py:4:4: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:4:4: SIM223 [*] Use `False` instead of `... and False` | 4 | pass 5 | @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 6 | 7 7 | if a or (b and False): # SIM223 -./resources/test/fixtures/flake8_simplify/SIM223.py:7:10: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:7:10: SIM223 [*] Use `False` instead of `... and False` | 7 | pass 8 | @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 9 9 | 10 10 | if a or False: -./resources/test/fixtures/flake8_simplify/SIM223.py:19:18: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:19:18: SIM223 [*] Use `False` instead of `... and False` | 19 | pass 20 | @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 21 21 | 22 22 | if False and f() and a and g() and b: # SIM223 -./resources/test/fixtures/flake8_simplify/SIM223.py:22:4: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:22:4: SIM223 [*] Use `False` instead of `... and False` | 22 | pass 23 | @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 24 24 | 25 25 | if a and False and f() and b and g(): # SIM223 -./resources/test/fixtures/flake8_simplify/SIM223.py:25:4: SIM223 [*] Use `False` instead of `... and False` +SIM223.py:25:4: SIM223 [*] Use `False` instead of `... and False` | 25 | pass 26 | diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap index 6161dbb5fb..df9c8ee361 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM300_SIM300.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM300.py:2:1: SIM300 [*] Yoda conditions are discouraged, use `compare == "yoda"` instead +SIM300.py:2:1: SIM300 [*] Yoda conditions are discouraged, use `compare == "yoda"` instead | 2 | # Errors 3 | "yoda" == compare # SIM300 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 4 4 | 42 == age # SIM300 5 5 | ("a", "b") == compare # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:3:1: SIM300 [*] Yoda conditions are discouraged, use `compare == "yoda"` instead +SIM300.py:3:1: SIM300 [*] Yoda conditions are discouraged, use `compare == "yoda"` instead | 3 | # Errors 4 | "yoda" == compare # SIM300 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 5 5 | ("a", "b") == compare # SIM300 6 6 | "yoda" <= compare # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:4:1: SIM300 [*] Yoda conditions are discouraged, use `age == 42` instead +SIM300.py:4:1: SIM300 [*] Yoda conditions are discouraged, use `age == 42` instead | 4 | "yoda" == compare # SIM300 5 | "yoda" == compare # SIM300 @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 6 6 | "yoda" <= compare # SIM300 7 7 | "yoda" < compare # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:5:1: SIM300 [*] Yoda conditions are discouraged, use `compare == ("a", "b")` instead +SIM300.py:5:1: SIM300 [*] Yoda conditions are discouraged, use `compare == ("a", "b")` instead | 5 | "yoda" == compare # SIM300 6 | 42 == age # SIM300 @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 7 7 | "yoda" < compare # SIM300 8 8 | 42 > age # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:6:1: SIM300 [*] Yoda conditions are discouraged, use `compare >= "yoda"` instead +SIM300.py:6:1: SIM300 [*] Yoda conditions are discouraged, use `compare >= "yoda"` instead | 6 | 42 == age # SIM300 7 | ("a", "b") == compare # SIM300 @@ -102,7 +102,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 8 8 | 42 > age # SIM300 9 9 | -42 > age # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:7:1: SIM300 [*] Yoda conditions are discouraged, use `compare > "yoda"` instead +SIM300.py:7:1: SIM300 [*] Yoda conditions are discouraged, use `compare > "yoda"` instead | 7 | ("a", "b") == compare # SIM300 8 | "yoda" <= compare # SIM300 @@ -123,7 +123,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 9 9 | -42 > age # SIM300 10 10 | +42 > age # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:8:1: SIM300 [*] Yoda conditions are discouraged, use `age < 42` instead +SIM300.py:8:1: SIM300 [*] Yoda conditions are discouraged, use `age < 42` instead | 8 | "yoda" <= compare # SIM300 9 | "yoda" < compare # SIM300 @@ -144,7 +144,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 10 10 | +42 > age # SIM300 11 11 | YODA == age # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:9:1: SIM300 [*] Yoda conditions are discouraged, use `age < -42` instead +SIM300.py:9:1: SIM300 [*] Yoda conditions are discouraged, use `age < -42` instead | 9 | "yoda" < compare # SIM300 10 | 42 > age # SIM300 @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 11 11 | YODA == age # SIM300 12 12 | YODA > age # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:10:1: SIM300 [*] Yoda conditions are discouraged, use `age < +42` instead +SIM300.py:10:1: SIM300 [*] Yoda conditions are discouraged, use `age < +42` instead | 10 | 42 > age # SIM300 11 | -42 > age # SIM300 @@ -186,7 +186,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 12 12 | YODA > age # SIM300 13 13 | YODA >= age # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:11:1: SIM300 [*] Yoda conditions are discouraged, use `age == YODA` instead +SIM300.py:11:1: SIM300 [*] Yoda conditions are discouraged, use `age == YODA` instead | 11 | -42 > age # SIM300 12 | +42 > age # SIM300 @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 13 13 | YODA >= age # SIM300 14 14 | JediOrder.YODA == age # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:12:1: SIM300 [*] Yoda conditions are discouraged, use `age < YODA` instead +SIM300.py:12:1: SIM300 [*] Yoda conditions are discouraged, use `age < YODA` instead | 12 | +42 > age # SIM300 13 | YODA == age # SIM300 @@ -228,7 +228,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 14 14 | JediOrder.YODA == age # SIM300 15 15 | 0 < (number - 100) # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:13:1: SIM300 [*] Yoda conditions are discouraged, use `age <= YODA` instead +SIM300.py:13:1: SIM300 [*] Yoda conditions are discouraged, use `age <= YODA` instead | 13 | YODA == age # SIM300 14 | YODA > age # SIM300 @@ -249,7 +249,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 15 15 | 0 < (number - 100) # SIM300 16 16 | SomeClass().settings.SOME_CONSTANT_VALUE > (60 * 60) # SIM300 -./resources/test/fixtures/flake8_simplify/SIM300.py:14:1: SIM300 [*] Yoda conditions are discouraged, use `age == JediOrder.YODA` instead +SIM300.py:14:1: SIM300 [*] Yoda conditions are discouraged, use `age == JediOrder.YODA` instead | 14 | YODA > age # SIM300 15 | YODA >= age # SIM300 @@ -270,7 +270,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 16 16 | SomeClass().settings.SOME_CONSTANT_VALUE > (60 * 60) # SIM300 17 17 | -./resources/test/fixtures/flake8_simplify/SIM300.py:15:1: SIM300 [*] Yoda conditions are discouraged, use `(number - 100) > 0` instead +SIM300.py:15:1: SIM300 [*] Yoda conditions are discouraged, use `(number - 100) > 0` instead | 15 | YODA >= age # SIM300 16 | JediOrder.YODA == age # SIM300 @@ -290,7 +290,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 17 17 | 18 18 | # OK -./resources/test/fixtures/flake8_simplify/SIM300.py:16:1: SIM300 [*] Yoda conditions are discouraged, use `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE` instead +SIM300.py:16:1: SIM300 [*] Yoda conditions are discouraged, use `(60 * 60) < SomeClass().settings.SOME_CONSTANT_VALUE` instead | 16 | JediOrder.YODA == age # SIM300 17 | 0 < (number - 100) # SIM300 diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap index b1dc67cf1e..2c0b10f03d 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM401_SIM401.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM401.py:6:1: SIM401 [*] Use `var = a_dict.get(key, "default1")` instead of an `if` block +SIM401.py:6:1: SIM401 [*] Use `var = a_dict.get(key, "default1")` instead of an `if` block | 6 | # SIM401 (pattern-1) 7 | / if key in a_dict: @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 11 8 | # SIM401 (pattern-2) 12 9 | if key not in a_dict: -./resources/test/fixtures/flake8_simplify/SIM401.py:12:1: SIM401 [*] Use `var = a_dict.get(key, "default2")` instead of an `if` block +SIM401.py:12:1: SIM401 [*] Use `var = a_dict.get(key, "default2")` instead of an `if` block | 12 | # SIM401 (pattern-2) 13 | / if key not in a_dict: @@ -53,7 +53,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 17 14 | # SIM401 (default with a complex expression) 18 15 | if key in a_dict: -./resources/test/fixtures/flake8_simplify/SIM401.py:24:1: SIM401 [*] Use `var = a_dict.get(keys[idx], "default")` instead of an `if` block +SIM401.py:24:1: SIM401 [*] Use `var = a_dict.get(keys[idx], "default")` instead of an `if` block | 24 | # SIM401 (complex expression in key) 25 | / if keys[idx] in a_dict: @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 29 26 | # SIM401 (complex expression in dict) 30 27 | if key in dicts[idx]: -./resources/test/fixtures/flake8_simplify/SIM401.py:30:1: SIM401 [*] Use `var = dicts[idx].get(key, "default")` instead of an `if` block +SIM401.py:30:1: SIM401 [*] Use `var = dicts[idx].get(key, "default")` instead of an `if` block | 30 | # SIM401 (complex expression in dict) 31 | / if key in dicts[idx]: @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 35 32 | # SIM401 (complex expression in var) 36 33 | if key in a_dict: -./resources/test/fixtures/flake8_simplify/SIM401.py:36:1: SIM401 [*] Use `vars[idx] = a_dict.get(key, "default")` instead of an `if` block +SIM401.py:36:1: SIM401 [*] Use `vars[idx] = a_dict.get(key, "default")` instead of an `if` block | 36 | # SIM401 (complex expression in var) 37 | / if key in a_dict: diff --git a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM910_SIM910.py.snap b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM910_SIM910.py.snap index 143e99f831..353c0a5470 100644 --- a/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM910_SIM910.py.snap +++ b/crates/ruff/src/rules/flake8_simplify/snapshots/ruff__rules__flake8_simplify__tests__SIM910_SIM910.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_simplify/mod.rs --- -./resources/test/fixtures/flake8_simplify/SIM910.py:2:1: SIM910 [*] Use `{}.get(key)` instead of `{}.get(key, None)` +SIM910.py:2:1: SIM910 [*] Use `{}.get(key)` instead of `{}.get(key, None)` | 2 | # SIM910 3 | {}.get(key, None) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 4 4 | # SIM910 5 5 | {}.get("key", None) -./resources/test/fixtures/flake8_simplify/SIM910.py:5:1: SIM910 [*] Use `{}.get("key")` instead of `{}.get("key", None)` +SIM910.py:5:1: SIM910 [*] Use `{}.get("key")` instead of `{}.get("key", None)` | 5 | # SIM910 6 | {}.get("key", None) @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 7 7 | # OK 8 8 | {}.get(key) -./resources/test/fixtures/flake8_simplify/SIM910.py:20:9: SIM910 [*] Use `{}.get(key)` instead of `{}.get(key, None)` +SIM910.py:20:9: SIM910 [*] Use `{}.get(key)` instead of `{}.get(key, None)` | 20 | # SIM910 21 | if a := {}.get(key, None): @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 22 22 | 23 23 | # SIM910 -./resources/test/fixtures/flake8_simplify/SIM910.py:24:5: SIM910 [*] Use `{}.get(key)` instead of `{}.get(key, None)` +SIM910.py:24:5: SIM910 [*] Use `{}.get(key)` instead of `{}.get(key, None)` | 24 | # SIM910 25 | a = {}.get(key, None) @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_simplify/mod.rs 26 26 | # SIM910 27 27 | ({}).get(key, None) -./resources/test/fixtures/flake8_simplify/SIM910.py:27:1: SIM910 [*] Use `({}).get(key)` instead of `({}).get(key, None)` +SIM910.py:27:1: SIM910 [*] Use `({}).get(key)` instead of `({}).get(key, None)` | 27 | # SIM910 28 | ({}).get(key, None) diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap index 1cbeaf98ec..eae0bd5078 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__banned_api__tests__banned_api_true_positives.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs --- -./resources/test/fixtures/flake8_tidy_imports/TID251.py:2:8: TID251 `cgi` is banned: The cgi module is deprecated. +TID251.py:2:8: TID251 `cgi` is banned: The cgi module is deprecated. | 2 | ## Banned modules ## 3 | import cgi @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 5 | from cgi import * | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:4:1: TID251 `cgi` is banned: The cgi module is deprecated. +TID251.py:4:1: TID251 `cgi` is banned: The cgi module is deprecated. | 4 | import cgi 5 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 8 | from cgi import a, b, c | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:6:1: TID251 `cgi` is banned: The cgi module is deprecated. +TID251.py:6:1: TID251 `cgi` is banned: The cgi module is deprecated. | 6 | from cgi import * 7 | @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 10 | # banning a module also bans any submodules | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:9:8: TID251 `cgi` is banned: The cgi module is deprecated. +TID251.py:9:8: TID251 `cgi` is banned: The cgi module is deprecated. | 9 | # banning a module also bans any submodules 10 | import cgi.foo.bar @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 12 | from cgi.foo import bar | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:11:1: TID251 `cgi` is banned: The cgi module is deprecated. +TID251.py:11:1: TID251 `cgi` is banned: The cgi module is deprecated. | 11 | import cgi.foo.bar 12 | @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 15 | from cgi.foo.bar import * | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:13:1: TID251 `cgi` is banned: The cgi module is deprecated. +TID251.py:13:1: TID251 `cgi` is banned: The cgi module is deprecated. | 13 | from cgi.foo import bar 14 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 17 | ## Banned module members ## | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:17:20: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. +TID251.py:17:20: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. | 17 | ## Banned module members ## 18 | @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 21 | import typing | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:22:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. +TID251.py:22:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. | 22 | # attribute access is checked 23 | typing.TypedDict @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 25 | typing.TypedDict.anything | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:24:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. +TID251.py:24:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. | 24 | typing.TypedDict 25 | @@ -88,7 +88,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 28 | # function calls are checked | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:27:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. +TID251.py:27:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. | 27 | # function calls are checked 28 | typing.TypedDict() @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 30 | typing.TypedDict.anything() | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:29:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. +TID251.py:29:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. | 29 | typing.TypedDict() 30 | @@ -107,7 +107,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/banned_api.rs 33 | # import aliases are resolved | -./resources/test/fixtures/flake8_tidy_imports/TID251.py:33:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. +TID251.py:33:1: TID251 `typing.TypedDict` is banned: Use typing_extensions.TypedDict instead. | 33 | # import aliases are resolved 34 | import typing as totally_not_typing diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap index 945c09fd67..7671d1cb6a 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_all_imports.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs --- -./resources/test/fixtures/flake8_tidy_imports/TID252.py:7:1: TID252 [*] Relative imports are banned +TID252.py:7:1: TID252 [*] Relative imports are banned | 7 | # TID252 8 | from . import sibling @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:8:1: TID252 [*] Relative imports are banned +TID252.py:8:1: TID252 [*] Relative imports are banned | 8 | # TID252 9 | from . import sibling @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:9:1: TID252 [*] Relative imports are banned +TID252.py:9:1: TID252 [*] Relative imports are banned | 9 | from . import sibling 10 | from .sibling import example @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:10:1: TID252 [*] Relative imports are banned +TID252.py:10:1: TID252 [*] Relative imports are banned | 10 | from .sibling import example 11 | from .. import parent @@ -44,7 +44,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:11:1: TID252 [*] Relative imports are banned +TID252.py:11:1: TID252 [*] Relative imports are banned | 11 | from .. import parent 12 | from ..parent import example @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:12:1: TID252 [*] Relative imports are banned +TID252.py:12:1: TID252 [*] Relative imports are banned | 12 | from ..parent import example 13 | from ... import grandparent @@ -66,7 +66,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:13:1: TID252 [*] Relative imports are banned +TID252.py:13:1: TID252 [*] Relative imports are banned | 13 | from ... import grandparent 14 | from ...grandparent import example @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:14:1: TID252 [*] Relative imports are banned +TID252.py:14:1: TID252 [*] Relative imports are banned | 14 | from ...grandparent import example 15 | from .parent import hello @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:17:1: TID252 [*] Relative imports are banned +TID252.py:17:1: TID252 [*] Relative imports are banned | 17 | parent import \ 18 | hello_world @@ -104,7 +104,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:21:1: TID252 [*] Relative imports are banned +TID252.py:21:1: TID252 [*] Relative imports are banned | 21 | import \ 22 | world_hello @@ -115,7 +115,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:22:1: TID252 [*] Relative imports are banned +TID252.py:22:1: TID252 [*] Relative imports are banned | 22 | world_hello 23 | from ..... import ultragrantparent @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:23:1: TID252 [*] Relative imports are banned +TID252.py:23:1: TID252 [*] Relative imports are banned | 23 | from ..... import ultragrantparent 24 | from ...... import ultragrantparent @@ -137,7 +137,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:24:1: TID252 [*] Relative imports are banned +TID252.py:24:1: TID252 [*] Relative imports are banned | 24 | from ...... import ultragrantparent 25 | from ....... import ultragrantparent @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:25:1: TID252 [*] Relative imports are banned +TID252.py:25:1: TID252 [*] Relative imports are banned | 25 | from ....... import ultragrantparent 26 | from ......... import ultragrantparent @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:26:1: TID252 [*] Relative imports are banned +TID252.py:26:1: TID252 [*] Relative imports are banned | 26 | from ......... import ultragrantparent 27 | from ........................... import ultragrantparent @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:27:1: TID252 [*] Relative imports are banned +TID252.py:27:1: TID252 [*] Relative imports are banned | 27 | from ........................... import ultragrantparent 28 | from .....parent import ultragrantparent @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:28:1: TID252 [*] Relative imports are banned +TID252.py:28:1: TID252 [*] Relative imports are banned | 28 | from .....parent import ultragrantparent 29 | from .........parent import ultragrantparent diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap index 490adee5be..0710e06140 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs --- -./resources/test/fixtures/flake8_tidy_imports/TID252.py:9:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:9:1: TID252 [*] Relative imports from parent modules are banned | 9 | from . import sibling 10 | from .sibling import example @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:10:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:10:1: TID252 [*] Relative imports from parent modules are banned | 10 | from .sibling import example 11 | from .. import parent @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:11:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:11:1: TID252 [*] Relative imports from parent modules are banned | 11 | from .. import parent 12 | from ..parent import example @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:12:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:12:1: TID252 [*] Relative imports from parent modules are banned | 12 | from ..parent import example 13 | from ... import grandparent @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:17:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:17:1: TID252 [*] Relative imports from parent modules are banned | 17 | parent import \ 18 | hello_world @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:21:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:21:1: TID252 [*] Relative imports from parent modules are banned | 21 | import \ 22 | world_hello @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:22:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:22:1: TID252 [*] Relative imports from parent modules are banned | 22 | world_hello 23 | from ..... import ultragrantparent @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:23:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:23:1: TID252 [*] Relative imports from parent modules are banned | 23 | from ..... import ultragrantparent 24 | from ...... import ultragrantparent @@ -92,7 +92,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:24:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:24:1: TID252 [*] Relative imports from parent modules are banned | 24 | from ...... import ultragrantparent 25 | from ....... import ultragrantparent @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:25:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:25:1: TID252 [*] Relative imports from parent modules are banned | 25 | from ....... import ultragrantparent 26 | from ......... import ultragrantparent @@ -114,7 +114,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:26:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:26:1: TID252 [*] Relative imports from parent modules are banned | 26 | from ......... import ultragrantparent 27 | from ........................... import ultragrantparent @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:27:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:27:1: TID252 [*] Relative imports from parent modules are banned | 27 | from ........................... import ultragrantparent 28 | from .....parent import ultragrantparent @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252.py:28:1: TID252 [*] Relative imports from parent modules are banned +TID252.py:28:1: TID252 [*] Relative imports from parent modules are banned | 28 | from .....parent import ultragrantparent 29 | from .........parent import ultragrantparent diff --git a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap index c46ab08eea..4540a39530 100644 --- a/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap +++ b/crates/ruff/src/rules/flake8_tidy_imports/snapshots/ruff__rules__flake8_tidy_imports__relative_imports__tests__ban_parent_imports_package.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs --- -./resources/test/fixtures/flake8_tidy_imports/TID252/my_package/sublib/api/application.py:5:1: TID252 [*] Relative imports from parent modules are banned +application.py:5:1: TID252 [*] Relative imports from parent modules are banned | 5 | import attrs 6 | @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs | = help: Replace relative imports from parent modules with absolute imports -./resources/test/fixtures/flake8_tidy_imports/TID252/my_package/sublib/api/application.py:6:1: TID252 [*] Relative imports from parent modules are banned +application.py:6:1: TID252 [*] Relative imports from parent modules are banned | 6 | from ....import unknown 7 | from ..protocol import commands, definitions, responses @@ -32,7 +32,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs 8 8 | from .. import server 9 9 | from . import logger, models -./resources/test/fixtures/flake8_tidy_imports/TID252/my_package/sublib/api/application.py:6:1: TID252 [*] Relative imports from parent modules are banned +application.py:6:1: TID252 [*] Relative imports from parent modules are banned | 6 | from ....import unknown 7 | from ..protocol import commands, definitions, responses @@ -52,7 +52,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs 8 8 | from .. import server 9 9 | from . import logger, models -./resources/test/fixtures/flake8_tidy_imports/TID252/my_package/sublib/api/application.py:6:1: TID252 [*] Relative imports from parent modules are banned +application.py:6:1: TID252 [*] Relative imports from parent modules are banned | 6 | from ....import unknown 7 | from ..protocol import commands, definitions, responses @@ -72,7 +72,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs 8 8 | from .. import server 9 9 | from . import logger, models -./resources/test/fixtures/flake8_tidy_imports/TID252/my_package/sublib/api/application.py:7:1: TID252 [*] Relative imports from parent modules are banned +application.py:7:1: TID252 [*] Relative imports from parent modules are banned | 7 | from ....import unknown 8 | from ..protocol import commands, definitions, responses @@ -93,7 +93,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs 9 9 | from . import logger, models 10 10 | from ..protocol.UpperCaseModule import some_function -./resources/test/fixtures/flake8_tidy_imports/TID252/my_package/sublib/api/application.py:8:1: TID252 [*] Relative imports from parent modules are banned +application.py:8:1: TID252 [*] Relative imports from parent modules are banned | 8 | from ..protocol import commands, definitions, responses 9 | from ..server import example @@ -113,7 +113,7 @@ source: crates/ruff/src/rules/flake8_tidy_imports/relative_imports.rs 9 9 | from . import logger, models 10 10 | from ..protocol.UpperCaseModule import some_function -./resources/test/fixtures/flake8_tidy_imports/TID252/my_package/sublib/api/application.py:10:1: TID252 [*] Relative imports from parent modules are banned +application.py:10:1: TID252 [*] Relative imports from parent modules are banned | 10 | from .. import server 11 | from . import logger, models diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap index ecf16b5b16..fb611710e2 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__empty-type-checking-block_TCH005.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH005.py:4:5: TCH005 [*] Found empty type-checking block +TCH005.py:4:5: TCH005 [*] Found empty type-checking block | 4 | if TYPE_CHECKING: 5 | pass # TCH005 @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 6 4 | 7 5 | if False: -./resources/test/fixtures/flake8_type_checking/TCH005.py:8:5: TCH005 [*] Found empty type-checking block +TCH005.py:8:5: TCH005 [*] Found empty type-checking block | 8 | if False: 9 | pass # TCH005 @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 10 8 | if 0: 11 9 | pass # TCH005 -./resources/test/fixtures/flake8_type_checking/TCH005.py:11:5: TCH005 [*] Found empty type-checking block +TCH005.py:11:5: TCH005 [*] Found empty type-checking block | 11 | if 0: 12 | pass # TCH005 @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 13 11 | 14 12 | def example(): -./resources/test/fixtures/flake8_type_checking/TCH005.py:16:9: TCH005 [*] Found empty type-checking block +TCH005.py:16:9: TCH005 [*] Found empty type-checking block | 16 | def example(): 17 | if TYPE_CHECKING: @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 18 16 | 19 17 | -./resources/test/fixtures/flake8_type_checking/TCH005.py:22:9: TCH005 [*] Found empty type-checking block +TCH005.py:22:9: TCH005 [*] Found empty type-checking block | 22 | class Test: 23 | if TYPE_CHECKING: diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap index 0cdb76a7ed..3e0bf5d7a0 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__exempt_modules.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/exempt_modules.py:14:12: TCH002 Move third-party import `flask` into a type-checking block +exempt_modules.py:14:12: TCH002 Move third-party import `flask` into a type-checking block | 14 | def f(): 15 | import flask diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap index 632a90b53d..ce326792f7 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH004_1.py:4:26: TCH004 Move import `datetime.datetime` out of type-checking block. Import is used for more than type hinting. +TCH004_1.py:4:26: TCH004 Move import `datetime.datetime` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from datetime import datetime diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap index f2256e9ee0..8ae699da43 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH004_11.py:4:24: TCH004 Move import `typing.List` out of type-checking block. Import is used for more than type hinting. +TCH004_11.py:4:24: TCH004 Move import `typing.List` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from typing import List diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap index a539b48025..7d784c1927 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_12.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH004_12.py:6:33: TCH004 Move import `collections.abc.Callable` out of type-checking block. Import is used for more than type hinting. +TCH004_12.py:6:33: TCH004 Move import `collections.abc.Callable` out of type-checking block. Import is used for more than type hinting. | 6 | if TYPE_CHECKING: 7 | from collections.abc import Callable diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap index e322371c28..93cebe6122 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH004_2.py:4:26: TCH004 Move import `datetime.date` out of type-checking block. Import is used for more than type hinting. +TCH004_2.py:4:26: TCH004 Move import `datetime.date` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from datetime import date diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap index c42aa7d61a..e7e14cc4a7 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH004_4.py:4:24: TCH004 Move import `typing.Any` out of type-checking block. Import is used for more than type hinting. +TCH004_4.py:4:24: TCH004 Move import `typing.Any` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from typing import Any diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap index 95e960ff16..d3962cb445 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_5.py.snap @@ -1,21 +1,21 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH004_5.py:4:24: TCH004 Move import `typing.List` out of type-checking block. Import is used for more than type hinting. +TCH004_5.py:4:24: TCH004 Move import `typing.List` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from typing import List, Sequence, Set | ^^^^ TCH004 | -./resources/test/fixtures/flake8_type_checking/TCH004_5.py:4:30: TCH004 Move import `typing.Sequence` out of type-checking block. Import is used for more than type hinting. +TCH004_5.py:4:30: TCH004 Move import `typing.Sequence` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from typing import List, Sequence, Set | ^^^^^^^^ TCH004 | -./resources/test/fixtures/flake8_type_checking/TCH004_5.py:4:40: TCH004 Move import `typing.Set` out of type-checking block. Import is used for more than type hinting. +TCH004_5.py:4:40: TCH004 Move import `typing.Set` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from typing import List, Sequence, Set diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap index ef7d86ae5d..d9d5ab2241 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_TCH004_9.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH004_9.py:4:24: TCH004 Move import `typing.Tuple` out of type-checking block. Import is used for more than type hinting. +TCH004_9.py:4:24: TCH004 Move import `typing.Tuple` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from typing import Tuple, List, Dict @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 7 | x: Tuple | -./resources/test/fixtures/flake8_type_checking/TCH004_9.py:4:31: TCH004 Move import `typing.List` out of type-checking block. Import is used for more than type hinting. +TCH004_9.py:4:31: TCH004 Move import `typing.List` out of type-checking block. Import is used for more than type hinting. | 4 | if TYPE_CHECKING: 5 | from typing import Tuple, List, Dict diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap index 956ca96dc9..fbef3cea8e 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_base_classes_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_base_classes_1.py:10:12: TCH004 Move import `datetime` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_base_classes_1.py:10:12: TCH004 Move import `datetime` out of type-checking block. Import is used for more than type hinting. | 10 | if TYPE_CHECKING: 11 | import datetime # TCH004 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 12 | from array import array # TCH004 | -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_base_classes_1.py:11:23: TCH004 Move import `array.array` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_base_classes_1.py:11:23: TCH004 Move import `array.array` out of type-checking block. Import is used for more than type hinting. | 11 | if TYPE_CHECKING: 12 | import datetime # TCH004 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 15 | import pandas # TCH004 | -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_base_classes_1.py:13:12: TCH004 Move import `pandas` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_base_classes_1.py:13:12: TCH004 Move import `pandas` out of type-checking block. Import is used for more than type hinting. | 13 | from array import array # TCH004 14 | diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap index 401ae51ea5..02f28eb4e3 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__runtime-import-in-type-checking-block_runtime_evaluated_decorators_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_decorators_1.py:12:12: TCH004 Move import `datetime` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_decorators_1.py:12:12: TCH004 Move import `datetime` out of type-checking block. Import is used for more than type hinting. | 12 | if TYPE_CHECKING: 13 | import datetime # TCH004 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 14 | from array import array # TCH004 | -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_decorators_1.py:13:23: TCH004 Move import `array.array` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_decorators_1.py:13:23: TCH004 Move import `array.array` out of type-checking block. Import is used for more than type hinting. | 13 | if TYPE_CHECKING: 14 | import datetime # TCH004 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 17 | import pandas # TCH004 | -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_decorators_1.py:15:12: TCH004 Move import `pandas` out of type-checking block. Import is used for more than type hinting. +runtime_evaluated_decorators_1.py:15:12: TCH004 Move import `pandas` out of type-checking block. Import is used for more than type hinting. | 15 | from array import array # TCH004 16 | diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap index 2a1870e6d2..e2c5f93837 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__strict.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/strict.py:24:21: TCH002 Move third-party import `pkg.A` into a type-checking block +strict.py:24:21: TCH002 Move third-party import `pkg.A` into a type-checking block | 24 | # In un-strict mode, this shouldn't rase an error, since `pkg` is used at runtime. 25 | import pkg @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 28 | def test(value: A): | -./resources/test/fixtures/flake8_type_checking/strict.py:32:21: TCH002 Move third-party import `pkg.A` into a type-checking block +strict.py:32:21: TCH002 Move third-party import `pkg.A` into a type-checking block | 32 | def f(): 33 | # In un-strict mode, this shouldn't rase an error, since `pkg` is used at runtime. @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 36 | def test(value: A): | -./resources/test/fixtures/flake8_type_checking/strict.py:51:25: TCH002 Move third-party import `pkg.bar.A` into a type-checking block +strict.py:51:25: TCH002 Move third-party import `pkg.bar.A` into a type-checking block | 51 | # In un-strict mode, this _should_ rase an error, since `pkg` is used at runtime. 52 | import pkg diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap index 66ec5dc29b..de90874644 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-first-party-import_TCH001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH001.py:20:19: TCH001 Move application import `.TYP001` into a type-checking block +TCH001.py:20:19: TCH001 Move application import `.TYP001` into a type-checking block | 20 | def f(): 21 | from . import TYP001 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap index 2713b493d8..2c3b8bcb48 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_TCH003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH003.py:8:12: TCH003 Move standard library import `os` into a type-checking block +TCH003.py:8:12: TCH003 Move standard library import `os` into a type-checking block | 8 | def f(): 9 | import os diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap index 7e597efbbc..6cc9df1b97 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_base_classes_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_base_classes_3.py:5:18: TCH003 Move standard library import `uuid.UUID` into a type-checking block +runtime_evaluated_base_classes_3.py:5:18: TCH003 Move standard library import `uuid.UUID` into a type-checking block | 5 | import datetime 6 | import pathlib diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap index 3f7ba10288..865cacc037 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-standard-library-import_runtime_evaluated_decorators_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_decorators_3.py:6:18: TCH003 Move standard library import `uuid.UUID` into a type-checking block +runtime_evaluated_decorators_3.py:6:18: TCH003 Move standard library import `uuid.UUID` into a type-checking block | 6 | from array import array 7 | from dataclasses import dataclass diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap index a553751d2a..3d2701eec4 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_TCH002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/TCH002.py:5:12: TCH002 Move third-party import `pandas` into a type-checking block +TCH002.py:5:12: TCH002 Move third-party import `pandas` into a type-checking block | 5 | def f(): 6 | import pandas as pd # TCH002 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 8 | x: pd.DataFrame | -./resources/test/fixtures/flake8_type_checking/TCH002.py:11:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:11:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block | 11 | def f(): 12 | from pandas import DataFrame # TCH002 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 14 | x: DataFrame | -./resources/test/fixtures/flake8_type_checking/TCH002.py:17:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:17:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block | 17 | def f(): 18 | from pandas import DataFrame as df # TCH002 @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 20 | x: df | -./resources/test/fixtures/flake8_type_checking/TCH002.py:23:12: TCH002 Move third-party import `pandas` into a type-checking block +TCH002.py:23:12: TCH002 Move third-party import `pandas` into a type-checking block | 23 | def f(): 24 | import pandas as pd # TCH002 @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 26 | x: pd.DataFrame = 1 | -./resources/test/fixtures/flake8_type_checking/TCH002.py:29:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:29:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block | 29 | def f(): 30 | from pandas import DataFrame # TCH002 @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 32 | x: DataFrame = 2 | -./resources/test/fixtures/flake8_type_checking/TCH002.py:35:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block +TCH002.py:35:24: TCH002 Move third-party import `pandas.DataFrame` into a type-checking block | 35 | def f(): 36 | from pandas import DataFrame as df # TCH002 @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 38 | x: df = 3 | -./resources/test/fixtures/flake8_type_checking/TCH002.py:41:12: TCH002 Move third-party import `pandas` into a type-checking block +TCH002.py:41:12: TCH002 Move third-party import `pandas` into a type-checking block | 41 | def f(): 42 | import pandas as pd # TCH002 @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 44 | x: "pd.DataFrame" = 1 | -./resources/test/fixtures/flake8_type_checking/TCH002.py:47:12: TCH002 Move third-party import `pandas` into a type-checking block +TCH002.py:47:12: TCH002 Move third-party import `pandas` into a type-checking block | 47 | def f(): 48 | import pandas as pd # TCH002 diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap index 89cbc927e9..247674c3fe 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_base_classes_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_base_classes_2.py:3:8: TCH002 Move third-party import `geopandas` into a type-checking block +runtime_evaluated_base_classes_2.py:3:8: TCH002 Move third-party import `geopandas` into a type-checking block | 3 | from __future__ import annotations 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_type_checking/mod.rs 7 | import pyproj # TCH002 | -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_base_classes_2.py:5:8: TCH002 Move third-party import `pyproj` into a type-checking block +runtime_evaluated_base_classes_2.py:5:8: TCH002 Move third-party import `pyproj` into a type-checking block | 5 | import geopandas as gpd # TCH002 6 | import pydantic diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap index 72c060272c..00cf182eaf 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_runtime_evaluated_decorators_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/runtime_evaluated_decorators_2.py:10:8: TCH002 Move third-party import `numpy` into a type-checking block +runtime_evaluated_decorators_2.py:10:8: TCH002 Move third-party import `numpy` into a type-checking block | 10 | from attrs import frozen 11 | diff --git a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap index 87fba3355b..705f148959 100644 --- a/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap +++ b/crates/ruff/src/rules/flake8_type_checking/snapshots/ruff__rules__flake8_type_checking__tests__typing-only-third-party-import_strict.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_type_checking/mod.rs --- -./resources/test/fixtures/flake8_type_checking/strict.py:51:25: TCH002 Move third-party import `pkg.bar.A` into a type-checking block +strict.py:51:25: TCH002 Move third-party import `pkg.bar.A` into a type-checking block | 51 | # In un-strict mode, this _should_ rase an error, since `pkg` is used at runtime. 52 | import pkg diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap index 4d8fadd149..662d457b4c 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG001_ARG.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs --- -./resources/test/fixtures/flake8_unused_arguments/ARG.py:9:7: ARG001 Unused function argument: `self` +ARG.py:9:7: ARG001 Unused function argument: `self` | 9 | # Unused arguments on functions. 10 | ### @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 12 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:9:13: ARG001 Unused function argument: `x` +ARG.py:9:13: ARG001 Unused function argument: `x` | 9 | # Unused arguments on functions. 10 | ### @@ -19,42 +19,42 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 12 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:13:7: ARG001 Unused function argument: `cls` +ARG.py:13:7: ARG001 Unused function argument: `cls` | 13 | def f(cls, x): | ^^^ ARG001 14 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:13:12: ARG001 Unused function argument: `x` +ARG.py:13:12: ARG001 Unused function argument: `x` | 13 | def f(cls, x): | ^ ARG001 14 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:17:7: ARG001 Unused function argument: `self` +ARG.py:17:7: ARG001 Unused function argument: `self` | 17 | def f(self, x): | ^^^^ ARG001 18 | ... | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:17:13: ARG001 Unused function argument: `x` +ARG.py:17:13: ARG001 Unused function argument: `x` | 17 | def f(self, x): | ^ ARG001 18 | ... | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:21:7: ARG001 Unused function argument: `cls` +ARG.py:21:7: ARG001 Unused function argument: `cls` | 21 | def f(cls, x): | ^^^ ARG001 22 | ... | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:21:12: ARG001 Unused function argument: `x` +ARG.py:21:12: ARG001 Unused function argument: `x` | 21 | def f(cls, x): | ^ ARG001 diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap index b380e823e6..be846bbc89 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG002_ARG.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs --- -./resources/test/fixtures/flake8_unused_arguments/ARG.py:35:17: ARG002 Unused method argument: `x` +ARG.py:35:17: ARG002 Unused method argument: `x` | 35 | # Unused arguments. 36 | ### @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 38 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:38:20: ARG002 Unused method argument: `x` +ARG.py:38:20: ARG002 Unused method argument: `x` | 38 | print("Hello, world!") 39 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 41 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:41:16: ARG002 Unused method argument: `x` +ARG.py:41:16: ARG002 Unused method argument: `x` | 41 | print("Hello, world!") 42 | @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 44 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:190:24: ARG002 Unused method argument: `x` +ARG.py:190:24: ARG002 Unused method argument: `x` | 190 | ### 191 | class C: diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap index d3eb8138ac..29483dc8e5 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG003_ARG.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs --- -./resources/test/fixtures/flake8_unused_arguments/ARG.py:45:16: ARG003 Unused class method argument: `x` +ARG.py:45:16: ARG003 Unused class method argument: `x` | 45 | @classmethod 46 | def f(cls, x): diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap index 0286b041e2..9e81478a1f 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG004_ARG.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs --- -./resources/test/fixtures/flake8_unused_arguments/ARG.py:49:11: ARG004 Unused static method argument: `cls` +ARG.py:49:11: ARG004 Unused static method argument: `cls` | 49 | @staticmethod 50 | def f(cls, x): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 51 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:49:16: ARG004 Unused static method argument: `x` +ARG.py:49:16: ARG004 Unused static method argument: `x` | 49 | @staticmethod 50 | def f(cls, x): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 51 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ARG.py:53:11: ARG004 Unused static method argument: `x` +ARG.py:53:11: ARG004 Unused static method argument: `x` | 53 | @staticmethod 54 | def f(x): diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap index 6a95182c9c..e62cee11b1 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ARG005_ARG.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs --- -./resources/test/fixtures/flake8_unused_arguments/ARG.py:28:8: ARG005 Unused lambda argument: `x` +ARG.py:28:8: ARG005 Unused lambda argument: `x` | 28 | # Unused arguments on lambdas. 29 | ### diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap index 859ac351db..c30dada7f1 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__enforce_variadic_names.snap @@ -1,49 +1,49 @@ --- source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs --- -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:1:7: ARG001 Unused function argument: `a` +ignore_variadic_names.py:1:7: ARG001 Unused function argument: `a` | 1 | def f(a, b): | ^ ARG001 2 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:1:10: ARG001 Unused function argument: `b` +ignore_variadic_names.py:1:10: ARG001 Unused function argument: `b` | 1 | def f(a, b): | ^ ARG001 2 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:5:7: ARG001 Unused function argument: `a` +ignore_variadic_names.py:5:7: ARG001 Unused function argument: `a` | 5 | def f(a, b, *args, **kwargs): | ^ ARG001 6 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:5:10: ARG001 Unused function argument: `b` +ignore_variadic_names.py:5:10: ARG001 Unused function argument: `b` | 5 | def f(a, b, *args, **kwargs): | ^ ARG001 6 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:5:14: ARG001 Unused function argument: `args` +ignore_variadic_names.py:5:14: ARG001 Unused function argument: `args` | 5 | def f(a, b, *args, **kwargs): | ^^^^ ARG001 6 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:5:22: ARG001 Unused function argument: `kwargs` +ignore_variadic_names.py:5:22: ARG001 Unused function argument: `kwargs` | 5 | def f(a, b, *args, **kwargs): | ^^^^^^ ARG001 6 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:10:17: ARG002 Unused method argument: `a` +ignore_variadic_names.py:10:17: ARG002 Unused method argument: `a` | 10 | class C: 11 | def f(self, a, b): @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 12 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:10:20: ARG002 Unused method argument: `b` +ignore_variadic_names.py:10:20: ARG002 Unused method argument: `b` | 10 | class C: 11 | def f(self, a, b): @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 12 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:13:17: ARG002 Unused method argument: `a` +ignore_variadic_names.py:13:17: ARG002 Unused method argument: `a` | 13 | print("Hello, world!") 14 | @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 16 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:13:20: ARG002 Unused method argument: `b` +ignore_variadic_names.py:13:20: ARG002 Unused method argument: `b` | 13 | print("Hello, world!") 14 | @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 16 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:13:24: ARG002 Unused method argument: `args` +ignore_variadic_names.py:13:24: ARG002 Unused method argument: `args` | 13 | print("Hello, world!") 14 | @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 16 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:13:32: ARG002 Unused method argument: `kwargs` +ignore_variadic_names.py:13:32: ARG002 Unused method argument: `kwargs` | 13 | print("Hello, world!") 14 | diff --git a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap index 53c71212c7..f7b4ffece2 100644 --- a/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap +++ b/crates/ruff/src/rules/flake8_unused_arguments/snapshots/ruff__rules__flake8_unused_arguments__tests__ignore_variadic_names.snap @@ -1,35 +1,35 @@ --- source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs --- -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:1:7: ARG001 Unused function argument: `a` +ignore_variadic_names.py:1:7: ARG001 Unused function argument: `a` | 1 | def f(a, b): | ^ ARG001 2 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:1:10: ARG001 Unused function argument: `b` +ignore_variadic_names.py:1:10: ARG001 Unused function argument: `b` | 1 | def f(a, b): | ^ ARG001 2 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:5:7: ARG001 Unused function argument: `a` +ignore_variadic_names.py:5:7: ARG001 Unused function argument: `a` | 5 | def f(a, b, *args, **kwargs): | ^ ARG001 6 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:5:10: ARG001 Unused function argument: `b` +ignore_variadic_names.py:5:10: ARG001 Unused function argument: `b` | 5 | def f(a, b, *args, **kwargs): | ^ ARG001 6 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:10:17: ARG002 Unused method argument: `a` +ignore_variadic_names.py:10:17: ARG002 Unused method argument: `a` | 10 | class C: 11 | def f(self, a, b): @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 12 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:10:20: ARG002 Unused method argument: `b` +ignore_variadic_names.py:10:20: ARG002 Unused method argument: `b` | 10 | class C: 11 | def f(self, a, b): @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 12 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:13:17: ARG002 Unused method argument: `a` +ignore_variadic_names.py:13:17: ARG002 Unused method argument: `a` | 13 | print("Hello, world!") 14 | @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/flake8_unused_arguments/mod.rs 16 | print("Hello, world!") | -./resources/test/fixtures/flake8_unused_arguments/ignore_variadic_names.py:13:20: ARG002 Unused method argument: `b` +ignore_variadic_names.py:13:20: ARG002 Unused method argument: `b` | 13 | print("Hello, world!") 14 | diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap index 7764e3c3c8..c9e1c69aca 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs --- -./resources/test/fixtures/flake8_use_pathlib/py_path_1.py:3:5: PTH124 `py.path` is in maintenance mode, use `pathlib` instead +py_path_1.py:3:5: PTH124 `py.path` is in maintenance mode, use `pathlib` instead | 3 | import py 4 | diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap index dd338c40a1..7bd0a729ee 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__PTH124_py_path_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs --- -./resources/test/fixtures/flake8_use_pathlib/py_path_2.py:3:5: PTH124 `py.path` is in maintenance mode, use `pathlib` instead +py_path_2.py:3:5: PTH124 `py.path` is in maintenance mode, use `pathlib` instead | 3 | from py.path import local as path 4 | diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap index 41660c86d1..f9978f47b4 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__full_name.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs --- -./resources/test/fixtures/flake8_use_pathlib/full_name.py:6:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` +full_name.py:6:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` | 6 | p = "/foo" 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 10 | aaa = os.mkdir(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:7:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` +full_name.py:7:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` | 7 | a = os.path.abspath(p) 8 | aa = os.chmod(p) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 10 | os.makedirs(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:8:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` +full_name.py:8:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` | 8 | a = os.path.abspath(p) 9 | aa = os.chmod(p) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 12 | os.rename(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:9:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` +full_name.py:9:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` | 9 | aa = os.chmod(p) 10 | aaa = os.mkdir(p) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 13 | os.replace(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:10:1: PTH104 `os.rename()` should be replaced by `Path.rename()` +full_name.py:10:1: PTH104 `os.rename()` should be replaced by `Path.rename()` | 10 | aaa = os.mkdir(p) 11 | os.makedirs(p) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 14 | os.rmdir(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:11:1: PTH105 `os.replace()` should be replaced by `Path.replace()` +full_name.py:11:1: PTH105 `os.replace()` should be replaced by `Path.replace()` | 11 | os.makedirs(p) 12 | os.rename(p) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 15 | os.remove(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:12:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` +full_name.py:12:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` | 12 | os.rename(p) 13 | os.replace(p) @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 16 | os.unlink(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:13:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` +full_name.py:13:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` | 13 | os.replace(p) 14 | os.rmdir(p) @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 17 | os.getcwd(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:14:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` +full_name.py:14:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` | 14 | os.rmdir(p) 15 | os.remove(p) @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 18 | b = os.path.exists(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:15:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` +full_name.py:15:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` | 15 | os.remove(p) 16 | os.unlink(p) @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 19 | bb = os.path.expanduser(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:16:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` +full_name.py:16:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` | 16 | os.unlink(p) 17 | os.getcwd(p) @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 20 | bbb = os.path.isdir(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:17:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` +full_name.py:17:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` | 17 | os.getcwd(p) 18 | b = os.path.exists(p) @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 21 | bbbb = os.path.isfile(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:18:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` +full_name.py:18:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` | 18 | b = os.path.exists(p) 19 | bb = os.path.expanduser(p) @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 22 | bbbbb = os.path.islink(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:19:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` +full_name.py:19:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` | 19 | bb = os.path.expanduser(p) 20 | bbb = os.path.isdir(p) @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 23 | os.readlink(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:20:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` +full_name.py:20:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` | 20 | bbb = os.path.isdir(p) 21 | bbbb = os.path.isfile(p) @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 24 | os.stat(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:21:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` +full_name.py:21:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` | 21 | bbbb = os.path.isfile(p) 22 | bbbbb = os.path.islink(p) @@ -160,7 +160,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 25 | os.path.isabs(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:22:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` +full_name.py:22:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` | 22 | bbbbb = os.path.islink(p) 23 | os.readlink(p) @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 26 | os.path.join(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:23:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` +full_name.py:23:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` | 23 | os.readlink(p) 24 | os.stat(p) @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 27 | os.path.basename(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:24:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator +full_name.py:24:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator | 24 | os.stat(p) 25 | os.path.isabs(p) @@ -190,7 +190,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 28 | os.path.dirname(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:25:1: PTH119 `os.path.basename()` should be replaced by `Path.name` +full_name.py:25:1: PTH119 `os.path.basename()` should be replaced by `Path.name` | 25 | os.path.isabs(p) 26 | os.path.join(p) @@ -200,7 +200,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 29 | os.path.samefile(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:26:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` +full_name.py:26:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` | 26 | os.path.join(p) 27 | os.path.basename(p) @@ -210,7 +210,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 30 | os.path.splitext(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:27:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` +full_name.py:27:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` | 27 | os.path.basename(p) 28 | os.path.dirname(p) @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 31 | with open(p) as fp: | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:28:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` +full_name.py:28:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` | 28 | os.path.dirname(p) 29 | os.path.samefile(p) @@ -230,7 +230,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 32 | fp.read() | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:29:6: PTH123 `open()` should be replaced by `Path.open()` +full_name.py:29:6: PTH123 `open()` should be replaced by `Path.open()` | 29 | os.path.samefile(p) 30 | os.path.splitext(p) @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 33 | open(p).close() | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:31:1: PTH123 `open()` should be replaced by `Path.open()` +full_name.py:31:1: PTH123 `open()` should be replaced by `Path.open()` | 31 | with open(p) as fp: 32 | fp.read() @@ -249,7 +249,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 34 | os.getcwdb(p) | -./resources/test/fixtures/flake8_use_pathlib/full_name.py:32:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` +full_name.py:32:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` | 32 | fp.read() 33 | open(p).close() diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap index e30d461ead..da2f4c56ea 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_as.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs --- -./resources/test/fixtures/flake8_use_pathlib/import_as.py:6:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` +import_as.py:6:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` | 6 | p = "/foo" 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 10 | aaa = foo.mkdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:7:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` +import_as.py:7:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` | 7 | a = foo_p.abspath(p) 8 | aa = foo.chmod(p) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 10 | foo.makedirs(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:8:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` +import_as.py:8:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` | 8 | a = foo_p.abspath(p) 9 | aa = foo.chmod(p) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 12 | foo.rename(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:9:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` +import_as.py:9:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` | 9 | aa = foo.chmod(p) 10 | aaa = foo.mkdir(p) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 13 | foo.replace(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:10:1: PTH104 `os.rename()` should be replaced by `Path.rename()` +import_as.py:10:1: PTH104 `os.rename()` should be replaced by `Path.rename()` | 10 | aaa = foo.mkdir(p) 11 | foo.makedirs(p) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 14 | foo.rmdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:11:1: PTH105 `os.replace()` should be replaced by `Path.replace()` +import_as.py:11:1: PTH105 `os.replace()` should be replaced by `Path.replace()` | 11 | foo.makedirs(p) 12 | foo.rename(p) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 15 | foo.remove(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:12:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` +import_as.py:12:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` | 12 | foo.rename(p) 13 | foo.replace(p) @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 16 | foo.unlink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:13:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` +import_as.py:13:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` | 13 | foo.replace(p) 14 | foo.rmdir(p) @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 17 | foo.getcwd(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:14:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` +import_as.py:14:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` | 14 | foo.rmdir(p) 15 | foo.remove(p) @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 18 | b = foo_p.exists(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:15:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` +import_as.py:15:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` | 15 | foo.remove(p) 16 | foo.unlink(p) @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 19 | bb = foo_p.expanduser(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:16:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` +import_as.py:16:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` | 16 | foo.unlink(p) 17 | foo.getcwd(p) @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 20 | bbb = foo_p.isdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:17:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` +import_as.py:17:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` | 17 | foo.getcwd(p) 18 | b = foo_p.exists(p) @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 21 | bbbb = foo_p.isfile(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:18:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` +import_as.py:18:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` | 18 | b = foo_p.exists(p) 19 | bb = foo_p.expanduser(p) @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 22 | bbbbb = foo_p.islink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:19:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` +import_as.py:19:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` | 19 | bb = foo_p.expanduser(p) 20 | bbb = foo_p.isdir(p) @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 23 | foo.readlink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:20:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` +import_as.py:20:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` | 20 | bbb = foo_p.isdir(p) 21 | bbbb = foo_p.isfile(p) @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 24 | foo.stat(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:21:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` +import_as.py:21:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` | 21 | bbbb = foo_p.isfile(p) 22 | bbbbb = foo_p.islink(p) @@ -160,7 +160,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 25 | foo_p.isabs(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:22:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` +import_as.py:22:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` | 22 | bbbbb = foo_p.islink(p) 23 | foo.readlink(p) @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 26 | foo_p.join(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:23:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` +import_as.py:23:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` | 23 | foo.readlink(p) 24 | foo.stat(p) @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 27 | foo_p.basename(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:24:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator +import_as.py:24:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator | 24 | foo.stat(p) 25 | foo_p.isabs(p) @@ -190,7 +190,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 28 | foo_p.dirname(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:25:1: PTH119 `os.path.basename()` should be replaced by `Path.name` +import_as.py:25:1: PTH119 `os.path.basename()` should be replaced by `Path.name` | 25 | foo_p.isabs(p) 26 | foo_p.join(p) @@ -200,7 +200,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 29 | foo_p.samefile(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:26:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` +import_as.py:26:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` | 26 | foo_p.join(p) 27 | foo_p.basename(p) @@ -210,7 +210,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 30 | foo_p.splitext(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:27:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` +import_as.py:27:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` | 27 | foo_p.basename(p) 28 | foo_p.dirname(p) @@ -219,7 +219,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 30 | foo_p.splitext(p) | -./resources/test/fixtures/flake8_use_pathlib/import_as.py:28:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` +import_as.py:28:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` | 28 | foo_p.dirname(p) 29 | foo_p.samefile(p) diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap index 1a35d9c0d3..bf1f7d5433 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs --- -./resources/test/fixtures/flake8_use_pathlib/import_from.py:8:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` +import_from.py:8:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` | 8 | p = "/foo" 9 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 12 | aaa = mkdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:9:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` +import_from.py:9:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` | 9 | a = abspath(p) 10 | aa = chmod(p) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 12 | makedirs(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:10:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` +import_from.py:10:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` | 10 | a = abspath(p) 11 | aa = chmod(p) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 14 | rename(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:11:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` +import_from.py:11:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` | 11 | aa = chmod(p) 12 | aaa = mkdir(p) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 15 | replace(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:12:1: PTH104 `os.rename()` should be replaced by `Path.rename()` +import_from.py:12:1: PTH104 `os.rename()` should be replaced by `Path.rename()` | 12 | aaa = mkdir(p) 13 | makedirs(p) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 16 | rmdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:13:1: PTH105 `os.replace()` should be replaced by `Path.replace()` +import_from.py:13:1: PTH105 `os.replace()` should be replaced by `Path.replace()` | 13 | makedirs(p) 14 | rename(p) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 17 | remove(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:14:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` +import_from.py:14:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` | 14 | rename(p) 15 | replace(p) @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 18 | unlink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:15:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` +import_from.py:15:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` | 15 | replace(p) 16 | rmdir(p) @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 19 | getcwd(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:16:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` +import_from.py:16:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` | 16 | rmdir(p) 17 | remove(p) @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 20 | b = exists(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:17:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` +import_from.py:17:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` | 17 | remove(p) 18 | unlink(p) @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 21 | bb = expanduser(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:18:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` +import_from.py:18:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` | 18 | unlink(p) 19 | getcwd(p) @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 22 | bbb = isdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:19:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` +import_from.py:19:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` | 19 | getcwd(p) 20 | b = exists(p) @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 23 | bbbb = isfile(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:20:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` +import_from.py:20:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` | 20 | b = exists(p) 21 | bb = expanduser(p) @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 24 | bbbbb = islink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:21:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` +import_from.py:21:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` | 21 | bb = expanduser(p) 22 | bbb = isdir(p) @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 25 | readlink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:22:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` +import_from.py:22:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` | 22 | bbb = isdir(p) 23 | bbbb = isfile(p) @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 26 | stat(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:23:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` +import_from.py:23:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` | 23 | bbbb = isfile(p) 24 | bbbbb = islink(p) @@ -160,7 +160,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 27 | isabs(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:24:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` +import_from.py:24:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` | 24 | bbbbb = islink(p) 25 | readlink(p) @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 28 | join(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:25:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` +import_from.py:25:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` | 25 | readlink(p) 26 | stat(p) @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 29 | basename(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:26:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator +import_from.py:26:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator | 26 | stat(p) 27 | isabs(p) @@ -190,7 +190,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 30 | dirname(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:27:1: PTH119 `os.path.basename()` should be replaced by `Path.name` +import_from.py:27:1: PTH119 `os.path.basename()` should be replaced by `Path.name` | 27 | isabs(p) 28 | join(p) @@ -200,7 +200,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 31 | samefile(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:28:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` +import_from.py:28:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` | 28 | join(p) 29 | basename(p) @@ -210,7 +210,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 32 | splitext(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:29:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` +import_from.py:29:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` | 29 | basename(p) 30 | dirname(p) @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 33 | with open(p) as fp: | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:30:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` +import_from.py:30:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` | 30 | dirname(p) 31 | samefile(p) @@ -230,7 +230,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 34 | fp.read() | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:31:6: PTH123 `open()` should be replaced by `Path.open()` +import_from.py:31:6: PTH123 `open()` should be replaced by `Path.open()` | 31 | samefile(p) 32 | splitext(p) @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 35 | open(p).close() | -./resources/test/fixtures/flake8_use_pathlib/import_from.py:33:1: PTH123 `open()` should be replaced by `Path.open()` +import_from.py:33:1: PTH123 `open()` should be replaced by `Path.open()` | 33 | with open(p) as fp: 34 | fp.read() diff --git a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap index 747093b186..57baf21bb7 100644 --- a/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap +++ b/crates/ruff/src/rules/flake8_use_pathlib/snapshots/ruff__rules__flake8_use_pathlib__tests__import_from_as.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs --- -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:13:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` +import_from_as.py:13:5: PTH100 `os.path.abspath()` should be replaced by `Path.resolve()` | 13 | p = "/foo" 14 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 17 | aaa = xmkdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:14:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` +import_from_as.py:14:6: PTH101 `os.chmod()` should be replaced by `Path.chmod()` | 14 | a = xabspath(p) 15 | aa = xchmod(p) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 17 | xmakedirs(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:15:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` +import_from_as.py:15:7: PTH102 `os.mkdir()` should be replaced by `Path.mkdir()` | 15 | a = xabspath(p) 16 | aa = xchmod(p) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 19 | xrename(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:16:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` +import_from_as.py:16:1: PTH103 `os.makedirs()` should be replaced by `Path.mkdir(parents=True)` | 16 | aa = xchmod(p) 17 | aaa = xmkdir(p) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 20 | xreplace(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:17:1: PTH104 `os.rename()` should be replaced by `Path.rename()` +import_from_as.py:17:1: PTH104 `os.rename()` should be replaced by `Path.rename()` | 17 | aaa = xmkdir(p) 18 | xmakedirs(p) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 21 | xrmdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:18:1: PTH105 `os.replace()` should be replaced by `Path.replace()` +import_from_as.py:18:1: PTH105 `os.replace()` should be replaced by `Path.replace()` | 18 | xmakedirs(p) 19 | xrename(p) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 22 | xremove(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:19:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` +import_from_as.py:19:1: PTH106 `os.rmdir()` should be replaced by `Path.rmdir()` | 19 | xrename(p) 20 | xreplace(p) @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 23 | xunlink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:20:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` +import_from_as.py:20:1: PTH107 `os.remove()` should be replaced by `Path.unlink()` | 20 | xreplace(p) 21 | xrmdir(p) @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 24 | xgetcwd(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:21:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` +import_from_as.py:21:1: PTH108 `os.unlink()` should be replaced by `Path.unlink()` | 21 | xrmdir(p) 22 | xremove(p) @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 25 | b = xexists(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:22:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` +import_from_as.py:22:1: PTH109 `os.getcwd()` should be replaced by `Path.cwd()` | 22 | xremove(p) 23 | xunlink(p) @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 26 | bb = xexpanduser(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:23:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` +import_from_as.py:23:5: PTH110 `os.path.exists()` should be replaced by `Path.exists()` | 23 | xunlink(p) 24 | xgetcwd(p) @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 27 | bbb = xisdir(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:24:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` +import_from_as.py:24:6: PTH111 `os.path.expanduser()` should be replaced by `Path.expanduser()` | 24 | xgetcwd(p) 25 | b = xexists(p) @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 28 | bbbb = xisfile(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:25:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` +import_from_as.py:25:7: PTH112 `os.path.isdir()` should be replaced by `Path.is_dir()` | 25 | b = xexists(p) 26 | bb = xexpanduser(p) @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 29 | bbbbb = xislink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:26:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` +import_from_as.py:26:8: PTH113 `os.path.isfile()` should be replaced by `Path.is_file()` | 26 | bb = xexpanduser(p) 27 | bbb = xisdir(p) @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 30 | xreadlink(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:27:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` +import_from_as.py:27:9: PTH114 `os.path.islink()` should be replaced by `Path.is_symlink()` | 27 | bbb = xisdir(p) 28 | bbbb = xisfile(p) @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 31 | xstat(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:28:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` +import_from_as.py:28:1: PTH115 `os.readlink()` should be replaced by `Path.readlink()` | 28 | bbbb = xisfile(p) 29 | bbbbb = xislink(p) @@ -160,7 +160,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 32 | xisabs(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:29:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` +import_from_as.py:29:1: PTH116 `os.stat()` should be replaced by `Path.stat()`, `Path.owner()`, or `Path.group()` | 29 | bbbbb = xislink(p) 30 | xreadlink(p) @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 33 | xjoin(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:30:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` +import_from_as.py:30:1: PTH117 `os.path.isabs()` should be replaced by `Path.is_absolute()` | 30 | xreadlink(p) 31 | xstat(p) @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 34 | xbasename(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:31:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator +import_from_as.py:31:1: PTH118 `os.path.join()` should be replaced by `Path` with `/` operator | 31 | xstat(p) 32 | xisabs(p) @@ -190,7 +190,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 35 | xdirname(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:32:1: PTH119 `os.path.basename()` should be replaced by `Path.name` +import_from_as.py:32:1: PTH119 `os.path.basename()` should be replaced by `Path.name` | 32 | xisabs(p) 33 | xjoin(p) @@ -200,7 +200,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 36 | xsamefile(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:33:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` +import_from_as.py:33:1: PTH120 `os.path.dirname()` should be replaced by `Path.parent` | 33 | xjoin(p) 34 | xbasename(p) @@ -210,7 +210,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 37 | xsplitext(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:34:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` +import_from_as.py:34:1: PTH121 `os.path.samefile()` should be replaced by `Path.samefile()` | 34 | xbasename(p) 35 | xdirname(p) @@ -219,7 +219,7 @@ source: crates/ruff/src/rules/flake8_use_pathlib/mod.rs 37 | xsplitext(p) | -./resources/test/fixtures/flake8_use_pathlib/import_from_as.py:35:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` +import_from_as.py:35:1: PTH122 `os.path.splitext()` should be replaced by `Path.suffix` | 35 | xdirname(p) 36 | xsamefile(p) diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap index 743d7375b4..4f17260e63 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__1_separate_subpackage_first_and_third_party_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import baz diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap index 964cd7a42d..0173d5e76c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__2_separate_subpackage_first_and_third_party_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +separate_subpackage_first_and_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import baz diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap index 2ddf344bed..1b87be91b5 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__add_newline_before_comments.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/add_newline_before_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted +add_newline_before_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import os 2 | | # This is a comment in the same section, so we need to add one newline. diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap index 321e53c98d..cd4923d5dc 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__as_imports_comments.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/as_imports_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted +as_imports_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from foo import ( # Comment on `foo` 2 | | Member as Alias, # Comment on `Alias` diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap index 407a18360c..69903f1791 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__closest_to_furthest_relative_imports_order.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/relative_imports_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted +relative_imports_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from ... import a 2 | | from .. import b diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap index 25c085b5c9..38148d302f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from module import Class as C 2 | | from module import CONSTANT diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap index cf133069f7..5c2c3f89d2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_as_imports_combine_as_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +combine_as_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from module import Class as C 2 | | from module import CONSTANT diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap index 0216c3ed3f..6a325c2dc6 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combine_import_from.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/combine_import_from.py:1:1: I001 [*] Import block is un-sorted or un-formatted +combine_import_from.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from collections import Awaitable 2 | | from collections import AsyncIterable diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap index a6b48bf28d..06f61e148e 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__combined_required_imports_docstring.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/required_imports/docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` +docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` | 1 | """Hello, world!""" | I002 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/isort/mod.rs 2 3 | 3 4 | x = 1 -./resources/test/fixtures/isort/required_imports/docstring.py:1:1: I002 [*] Missing required import: `from __future__ import generator_stop` +docstring.py:1:1: I002 [*] Missing required import: `from __future__ import generator_stop` | 1 | """Hello, world!""" | I002 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap index 9e3aa9bd57..b639dd59cb 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__comments.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/comments.py:3:1: I001 [*] Import block is un-sorted or un-formatted +comments.py:3:1: I001 [*] Import block is un-sorted or un-formatted | 3 | # Comment 1 4 | # Comment 2 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap index c2d7fcfdbd..eb896ed975 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__deduplicate_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/deduplicate_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +deduplicate_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import os 2 | | import os diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap index cfa8614791..ae9b9934b8 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/fit_line_length.py:7:1: I001 [*] Import block is un-sorted or un-formatted +fit_line_length.py:7:1: I001 [*] Import block is un-sorted or un-formatted | 7 | if indented: 8 | / from line_with_88 import aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap index 9293576d97..2dfbed7978 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__fit_line_length_comment.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/fit_line_length_comment.py:1:1: I001 [*] Import block is un-sorted or un-formatted +fit_line_length_comment.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import a 2 | | # Don't take this comment into account when determining whether the next import can fit on one line. diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap index f94bcff16d..771b2bf0d0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_single_line_force_single_line.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/force_single_line.py:1:1: I001 [*] Import block is un-sorted or un-formatted +force_single_line.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys, math 2 | | from os import path, uname diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap index 4ae6fcd0ae..5d66208de7 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted +force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from a import a1 # import_from 2 | | from c import * # import_from_star diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap index 6a78234eec..cb9acf0d4e 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_sort_within_sections_force_sort_within_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted +force_sort_within_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from a import a1 # import_from 2 | | from c import * # import_from_star diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap index d10138dea8..96167fd8d6 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted +force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import lib6 2 | | import lib2 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap index 6c9b7da749..cfc5a7fc8b 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_to_top_force_to_top.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted +force_to_top.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import lib6 2 | | import lib2 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap index 16e18547d5..0c6448490a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/force_wrap_aliases.py:1:1: I001 [*] Import block is un-sorted or un-formatted +force_wrap_aliases.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from .a import a1 as a1, a2 as a2 2 | | from .b import b1 as b1 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap index ceac02e722..eb0b782623 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__force_wrap_aliases_force_wrap_aliases.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/force_wrap_aliases.py:1:1: I001 [*] Import block is un-sorted or un-formatted +force_wrap_aliases.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from .a import a1 as a1, a2 as a2 2 | | from .b import b1 as b1 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap index aaac4db526..0af334c239 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__forced_separate.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/forced_separate.py:3:1: I001 [*] Import block is un-sorted or un-formatted +forced_separate.py:3:1: I001 [*] Import block is un-sorted or un-formatted | 3 | # office_helper and tests are both first-party, 4 | # but we want tests and experiments to be separated, in that order diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap index 9ef405e704..cbcf20291c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__import_from_after_import.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/import_from_after_import.py:1:1: I001 [*] Import block is un-sorted or un-formatted +import_from_after_import.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from collections import Collection 2 | | import os diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap index 9253122c4b..905c7decec 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__inline_comments.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/inline_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted +inline_comments.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from a.prometheus.metrics import ( # type:ignore[attr-defined] 2 | | TERMINAL_CURRENTLY_RUNNING_TOTAL, diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap index b1624d049f..da9d97ef54 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/insert_empty_lines.py:1:1: I001 [*] Import block is un-sorted or un-formatted +insert_empty_lines.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import a 2 | | import b @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/isort/mod.rs 4 5 | import os 5 6 | import sys -./resources/test/fixtures/isort/insert_empty_lines.py:4:1: I001 [*] Import block is un-sorted or un-formatted +insert_empty_lines.py:4:1: I001 [*] Import block is un-sorted or un-formatted | 4 | import b 5 | x = 1 @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/isort/mod.rs 7 9 | pass 8 10 | if True: -./resources/test/fixtures/isort/insert_empty_lines.py:14:1: I001 [*] Import block is un-sorted or un-formatted +insert_empty_lines.py:14:1: I001 [*] Import block is un-sorted or un-formatted | 14 | class X: pass 15 | y = 1 @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/isort/mod.rs 17 18 | 18 19 | if True: -./resources/test/fixtures/isort/insert_empty_lines.py:52:1: I001 [*] Import block is un-sorted or un-formatted +insert_empty_lines.py:52:1: I001 [*] Import block is un-sorted or un-formatted | 52 | / import os 53 | | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap index afbbc80594..f788459397 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__insert_empty_lines.pyi.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/insert_empty_lines.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted +insert_empty_lines.pyi:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import a 2 | | import b @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/isort/mod.rs 4 5 | import os 5 6 | import sys -./resources/test/fixtures/isort/insert_empty_lines.pyi:4:1: I001 [*] Import block is un-sorted or un-formatted +insert_empty_lines.pyi:4:1: I001 [*] Import block is un-sorted or un-formatted | 4 | import b 5 | x = 1 @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/isort/mod.rs 7 8 | pass 8 9 | if True: -./resources/test/fixtures/isort/insert_empty_lines.pyi:14:1: I001 [*] Import block is un-sorted or un-formatted +insert_empty_lines.pyi:14:1: I001 [*] Import block is un-sorted or un-formatted | 14 | class X: pass 15 | y = 1 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap index 8ae3079dc8..1af3a0949f 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__known_local_folder_separate_local_folder_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import ruff diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap index f142fd6743..6539ba1125 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__leading_prefix.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/leading_prefix.py:1:8: I001 [*] Import block is un-sorted or un-formatted +leading_prefix.py:1:8: I001 [*] Import block is un-sorted or un-formatted | 1 | x = 1; import sys | ________^ @@ -12,7 +12,7 @@ source: crates/ruff/src/rules/isort/mod.rs | = help: Organize imports -./resources/test/fixtures/isort/leading_prefix.py:5:12: I001 [*] Import block is un-sorted or un-formatted +leading_prefix.py:5:12: I001 [*] Import block is un-sorted or un-formatted | 5 | if True: 6 | x = 1; import sys @@ -24,7 +24,7 @@ source: crates/ruff/src/rules/isort/mod.rs | = help: Organize imports -./resources/test/fixtures/isort/leading_prefix.py:10:9: I001 [*] Import block is un-sorted or un-formatted +leading_prefix.py:10:9: I001 [*] Import block is un-sorted or un-formatted | 10 | if True: 11 | x = 1; \ @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/isort/mod.rs | = help: Organize imports -./resources/test/fixtures/isort/leading_prefix.py:13:1: I001 [*] Import block is un-sorted or un-formatted +leading_prefix.py:13:1: I001 [*] Import block is un-sorted or un-formatted | 13 | x = 1; \ 14 | import os diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap index 63c388a458..a28d7c0d9d 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_class_after.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/lines_after_imports_class_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted +lines_after_imports_class_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from __future__ import annotations 2 | | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap index b07c1e62ae..106ea36452 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_func_after.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/lines_after_imports_func_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted +lines_after_imports_func_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from __future__ import annotations 2 | | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap index b9293770d0..0f28da7ed4 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_after_imports_lines_after_imports_nothing_after.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/lines_after_imports_nothing_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted +lines_after_imports_nothing_after.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from __future__ import annotations 2 | | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap index 1d84061f59..730779d08a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__lines_between_typeslines_between_types.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/lines_between_types.py:1:1: I001 [*] Import block is un-sorted or un-formatted +lines_between_types.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from __future__ import annotations 2 | | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap index f52aa9bb48..43209c1082 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__magic_trailing_comma.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted +magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted | 2 | # This has a magic trailing comma, will be sorted, but not rolled into one line 3 | / from sys import ( diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap index 1a4ae5f4e1..d001d7922a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__natural_order.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/natural_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted +natural_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import numpy1 2 | | import numpy10 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap index 7c1bb455fe..ab81767a33 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/no_lines_before.py:1:1: I001 [*] Import block is un-sorted or un-formatted +no_lines_before.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from __future__ import annotations 2 | | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap index 8369aafe66..ef9df01284 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before.py_no_lines_before.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/no_lines_before.py:1:1: I001 [*] Import block is un-sorted or un-formatted +no_lines_before.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from __future__ import annotations 2 | | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap index c19c1882bd..481c39c1e2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_lines_before_with_empty_sections.py_no_lines_before_with_empty_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/no_lines_before_with_empty_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted +no_lines_before_with_empty_sections.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from __future__ import annotations 2 | | from typing import Any diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap index 4e648c0f3e..456bde70ff 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__no_wrap_star.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/no_wrap_star.py:1:1: I001 [*] Import block is un-sorted or un-formatted +no_wrap_star.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from .subscription import * # type: ignore # some very long comment explaining why this needs a type ignore | diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap index fefee509bd..c3bec94c1a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import StringIO 2 | | import glob diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap index 586368529b..1068a1c6d4 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_false_order_by_type.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import StringIO 2 | | import glob diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap index 6ca3a49742..4593956447 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from sklearn.svm import func, SVC, CONST, Klass 2 | | from subprocess import N_CLASS, PIPE, Popen, STDOUT diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap index abff0190e1..7956cfb365 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_classes_order_by_type_with_custom_classes.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type_with_custom_classes.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from sklearn.svm import func, SVC, CONST, Klass 2 | | from subprocess import N_CLASS, PIPE, Popen, STDOUT diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap index e351f4a6c1..e3e6a75772 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from sklearn.svm import XYZ, func, variable, Const, Klass, constant 2 | | from subprocess import First, var, func, Class, konst, A_constant, Last, STDOUT diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap index f2ab7f0924..eca6e9541c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_constants_order_by_type_with_custom_constants.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type_with_custom_constants.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from sklearn.svm import XYZ, func, variable, Const, Klass, constant 2 | | from subprocess import First, var, func, Class, konst, A_constant, Last, STDOUT diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap index b3c7ca4e1c..80f41f0b1b 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc 2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap index 7f5375ac53..885e9af2bb 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_by_type_with_custom_variables_order_by_type_with_custom_variables.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_by_type_with_custom_variables.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from sklearn.svm import VAR, Class, MyVar, CONST, abc 2 | | from subprocess import utils, var_ABC, Variable, Klass, CONSTANT, exe diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap index 1affe7ed26..1880d3acf2 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__order_relative_imports_by_level.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/order_relative_imports_by_level.py:1:1: I001 [*] Import block is un-sorted or un-formatted +order_relative_imports_by_level.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from .a import a 2 | | from ..a import a diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap index 364c34142c..ad469236e6 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_comment_order.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/preserve_comment_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted +preserve_comment_order.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import io 2 | | # Old MacDonald had a farm, diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap index b94eecadf9..fd4e61e73a 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_import_star.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/preserve_import_star.py:1:1: I001 [*] Import block is un-sorted or un-formatted +preserve_import_star.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from some_other_module import some_class 2 | | from some_other_module import * diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap index aaf3ab9392..fe4aa19b25 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__preserve_indentation.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/preserve_indentation.py:2:1: I001 [*] Import block is un-sorted or un-formatted +preserve_indentation.py:2:1: I001 [*] Import block is un-sorted or un-formatted | 2 | if True: 3 | / import sys @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/isort/mod.rs 5 5 | import sys 6 6 | import os -./resources/test/fixtures/isort/preserve_indentation.py:5:1: I001 [*] Import block is un-sorted or un-formatted +preserve_indentation.py:5:1: I001 [*] Import block is un-sorted or un-formatted | 5 | import os 6 | else: diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap index cc859296b0..4c595add0c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__reorder_within_section.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/reorder_within_section.py:1:1: I001 [*] Import block is un-sorted or un-formatted +reorder_within_section.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import os diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap index 3fd3e38f8f..4bad7ae0ec 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_docstring.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/required_imports/docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` +docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` | 1 | """Hello, world!""" | I002 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap index 1685447ced..f0832f6f76 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_import_multiline_docstring.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/required_imports/multiline_docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` +multiline_docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` | 1 | """a | I002 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap index a6b48bf28d..06f61e148e 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__required_imports_docstring.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/required_imports/docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` +docstring.py:1:1: I002 [*] Missing required import: `from __future__ import annotations` | 1 | """Hello, world!""" | I002 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/isort/mod.rs 2 3 | 3 4 | x = 1 -./resources/test/fixtures/isort/required_imports/docstring.py:1:1: I002 [*] Missing required import: `from __future__ import generator_stop` +docstring.py:1:1: I002 [*] Missing required import: `from __future__ import generator_stop` | 1 | """Hello, world!""" | I002 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap index de518a1392..1d79b820f0 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_first_party_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/separate_first_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +separate_first_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import leading_prefix diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap index 32e0b1d077..c80e025a20 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_future_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/separate_future_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +separate_future_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import os diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap index b790d0e03c..512687da97 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_local_folder_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +separate_local_folder_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import ruff diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap index 5e74d4ff2a..f4bbd525d4 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__separate_third_party_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/separate_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +separate_third_party_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import pandas as pd 2 | | import sys diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap index 5820b8f8f1..ec609bca13 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__skip.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/skip.py:20:1: I001 [*] Import block is un-sorted or un-formatted +skip.py:20:1: I001 [*] Import block is un-sorted or un-formatted | 20 | import sys 21 | import os # isort: skip @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/isort/mod.rs 23 23 | 24 24 | def f(): -./resources/test/fixtures/isort/skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted +skip.py:27:1: I001 [*] Import block is un-sorted or un-formatted | 27 | import sys 28 | import os # isort:skip diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap index af90315a7b..3cd427ec13 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__sort_similar_imports.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/sort_similar_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted +sort_similar_imports.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from a import b 2 | | from a import BAD as DEF diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap index dee45b516e..820b50e85e 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__split_on_trailing_comma_magic_trailing_comma.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted +magic_trailing_comma.py:2:1: I001 [*] Import block is un-sorted or un-formatted | 2 | # This has a magic trailing comma, will be sorted, but not rolled into one line 3 | / from sys import ( diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap index ff518fc70a..716293803c 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__star_before_others.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/star_before_others.py:1:1: I001 [*] Import block is un-sorted or un-formatted +star_before_others.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / from .logging import config_logging 2 | | from .settings import ENV diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap index 70b42f4366..7a579953f1 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__straight_required_import_docstring.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/required_imports/docstring.py:1:1: I002 [*] Missing required import: `import os` +docstring.py:1:1: I002 [*] Missing required import: `import os` | 1 | """Hello, world!""" | I002 diff --git a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap index ea74bcf179..494ac87629 100644 --- a/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap +++ b/crates/ruff/src/rules/isort/snapshots/ruff__rules__isort__tests__trailing_suffix.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/isort/mod.rs --- -./resources/test/fixtures/isort/trailing_suffix.py:1:1: I001 [*] Import block is un-sorted or un-formatted +trailing_suffix.py:1:1: I001 [*] Import block is un-sorted or un-formatted | 1 | / import sys 2 | | import os; x = 1 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/isort/mod.rs | = help: Organize imports -./resources/test/fixtures/isort/trailing_suffix.py:5:5: I001 [*] Import block is un-sorted or un-formatted +trailing_suffix.py:5:5: I001 [*] Import block is un-sorted or un-formatted | 5 | if True: 6 | import sys diff --git a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap index a4a2bb4a3b..c306311550 100644 --- a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap +++ b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_0.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/mccabe/mod.rs --- -./resources/test/fixtures/mccabe/C901.py:2:5: C901 `trivial` is too complex (1 > 0) +C901.py:2:5: C901 `trivial` is too complex (1 > 0) | 2 | # Complexity = 1 3 | def trivial(): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 4 | pass | -./resources/test/fixtures/mccabe/C901.py:7:5: C901 `expr_as_statement` is too complex (1 > 0) +C901.py:7:5: C901 `expr_as_statement` is too complex (1 > 0) | 7 | # Complexity = 1 8 | def expr_as_statement(): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 9 | 0xF00D | -./resources/test/fixtures/mccabe/C901.py:12:5: C901 `sequential` is too complex (1 > 0) +C901.py:12:5: C901 `sequential` is too complex (1 > 0) | 12 | # Complexity = 1 13 | def sequential(n): @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 15 | s = k + n | -./resources/test/fixtures/mccabe/C901.py:19:5: C901 `if_elif_else_dead_path` is too complex (3 > 0) +C901.py:19:5: C901 `if_elif_else_dead_path` is too complex (3 > 0) | 19 | # Complexity = 3 20 | def if_elif_else_dead_path(n): @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 22 | return "bigger than three" | -./resources/test/fixtures/mccabe/C901.py:29:5: C901 `nested_ifs` is too complex (3 > 0) +C901.py:29:5: C901 `nested_ifs` is too complex (3 > 0) | 29 | # Complexity = 3 30 | def nested_ifs(): @@ -44,7 +44,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 32 | if n > 4: | -./resources/test/fixtures/mccabe/C901.py:40:5: C901 `for_loop` is too complex (2 > 0) +C901.py:40:5: C901 `for_loop` is too complex (2 > 0) | 40 | # Complexity = 2 41 | def for_loop(): @@ -53,7 +53,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 43 | print(i) | -./resources/test/fixtures/mccabe/C901.py:46:5: C901 `for_else` is too complex (2 > 0) +C901.py:46:5: C901 `for_else` is too complex (2 > 0) | 46 | # Complexity = 2 47 | def for_else(mylist): @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 49 | print(i) | -./resources/test/fixtures/mccabe/C901.py:54:5: C901 `recursive` is too complex (2 > 0) +C901.py:54:5: C901 `recursive` is too complex (2 > 0) | 54 | # Complexity = 2 55 | def recursive(n): @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 57 | return f(n - 1) | -./resources/test/fixtures/mccabe/C901.py:62:5: C901 `nested_functions` is too complex (3 > 0) +C901.py:62:5: C901 `nested_functions` is too complex (3 > 0) | 62 | # Complexity = 3 63 | def nested_functions(): @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 65 | def b(): | -./resources/test/fixtures/mccabe/C901.py:63:9: C901 `a` is too complex (2 > 0) +C901.py:63:9: C901 `a` is too complex (2 > 0) | 63 | # Complexity = 3 64 | def nested_functions(): @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 67 | pass | -./resources/test/fixtures/mccabe/C901.py:64:13: C901 `b` is too complex (1 > 0) +C901.py:64:13: C901 `b` is too complex (1 > 0) | 64 | def nested_functions(): 65 | def a(): @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 67 | pass | -./resources/test/fixtures/mccabe/C901.py:73:5: C901 `try_else` is too complex (4 > 0) +C901.py:73:5: C901 `try_else` is too complex (4 > 0) | 73 | # Complexity = 4 74 | def try_else(): @@ -108,7 +108,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 76 | print(1) | -./resources/test/fixtures/mccabe/C901.py:85:5: C901 `nested_try_finally` is too complex (1 > 0) +C901.py:85:5: C901 `nested_try_finally` is too complex (1 > 0) | 85 | # Complexity = 3 86 | def nested_try_finally(): @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 88 | try: | -./resources/test/fixtures/mccabe/C901.py:96:11: C901 `foobar` is too complex (3 > 0) +C901.py:96:11: C901 `foobar` is too complex (3 > 0) | 96 | # Complexity = 3 97 | async def foobar(a, b, c): @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 99 | if await b: | -./resources/test/fixtures/mccabe/C901.py:107:5: C901 `annotated_assign` is too complex (1 > 0) +C901.py:107:5: C901 `annotated_assign` is too complex (1 > 0) | 107 | # Complexity = 1 108 | def annotated_assign(): @@ -134,7 +134,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 109 | x: Any = None | -./resources/test/fixtures/mccabe/C901.py:113:9: C901 `handle` is too complex (9 > 0) +C901.py:113:9: C901 `handle` is too complex (9 > 0) | 113 | # Complexity = 9 114 | class Class: @@ -144,7 +144,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 117 | return | -./resources/test/fixtures/mccabe/C901.py:118:17: C901 `a` is too complex (1 > 0) +C901.py:118:17: C901 `a` is too complex (1 > 0) | 118 | class ServiceProvider: 119 | def a(self): @@ -152,7 +152,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 120 | pass | -./resources/test/fixtures/mccabe/C901.py:121:17: C901 `b` is too complex (2 > 0) +C901.py:121:17: C901 `b` is too complex (2 > 0) | 121 | pass 122 | @@ -162,7 +162,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 125 | pass | -./resources/test/fixtures/mccabe/C901.py:126:17: C901 `c` is too complex (1 > 0) +C901.py:126:17: C901 `c` is too complex (1 > 0) | 126 | class Logger: 127 | def c(*args, **kwargs): @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 128 | pass | -./resources/test/fixtures/mccabe/C901.py:129:17: C901 `error` is too complex (1 > 0) +C901.py:129:17: C901 `error` is too complex (1 > 0) | 129 | pass 130 | @@ -179,7 +179,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 132 | pass | -./resources/test/fixtures/mccabe/C901.py:132:17: C901 `info` is too complex (1 > 0) +C901.py:132:17: C901 `info` is too complex (1 > 0) | 132 | pass 133 | @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 135 | pass | -./resources/test/fixtures/mccabe/C901.py:135:17: C901 `exception` is too complex (1 > 0) +C901.py:135:17: C901 `exception` is too complex (1 > 0) | 135 | pass 136 | diff --git a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap index 6d386d8bb1..d4694de3d2 100644 --- a/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap +++ b/crates/ruff/src/rules/mccabe/snapshots/ruff__rules__mccabe__tests__max_complexity_3.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/mccabe/mod.rs --- -./resources/test/fixtures/mccabe/C901.py:73:5: C901 `try_else` is too complex (4 > 3) +C901.py:73:5: C901 `try_else` is too complex (4 > 3) | 73 | # Complexity = 4 74 | def try_else(): @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/mccabe/mod.rs 76 | print(1) | -./resources/test/fixtures/mccabe/C901.py:113:9: C901 `handle` is too complex (9 > 3) +C901.py:113:9: C901 `handle` is too complex (9 > 3) | 113 | # Complexity = 9 114 | class Class: diff --git a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap index 2a7db8fbf0..521828bd80 100644 --- a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap +++ b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-deprecated-type-alias_NPY001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/numpy/mod.rs --- -./resources/test/fixtures/numpy/NPY001.py:6:1: NPY001 [*] Type alias `np.bool` is deprecated, replace with builtin type +NPY001.py:6:1: NPY001 [*] Type alias `np.bool` is deprecated, replace with builtin type | 6 | # Error 7 | npy.bool @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 8 8 | 9 9 | if dtype == np.object: -./resources/test/fixtures/numpy/NPY001.py:7:1: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type +NPY001.py:7:1: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type | 7 | # Error 8 | npy.bool @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 9 9 | if dtype == np.object: 10 10 | ... -./resources/test/fixtures/numpy/NPY001.py:9:13: NPY001 [*] Type alias `np.object` is deprecated, replace with builtin type +NPY001.py:9:13: NPY001 [*] Type alias `np.object` is deprecated, replace with builtin type | 9 | npy.int 10 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 11 11 | 12 12 | result = result.select_dtypes([np.byte, np.ubyte, np.short, np.ushort, np.int, np.long]) -./resources/test/fixtures/numpy/NPY001.py:12:72: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type +NPY001.py:12:72: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type | 12 | ... 13 | @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 14 14 | pdf = pd.DataFrame( 15 15 | data=[[1, 2, 3]], -./resources/test/fixtures/numpy/NPY001.py:12:80: NPY001 [*] Type alias `np.long` is deprecated, replace with builtin type +NPY001.py:12:80: NPY001 [*] Type alias `np.long` is deprecated, replace with builtin type | 12 | ... 13 | @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 14 14 | pdf = pd.DataFrame( 15 15 | data=[[1, 2, 3]], -./resources/test/fixtures/numpy/NPY001.py:17:11: NPY001 [*] Type alias `np.object` is deprecated, replace with builtin type +NPY001.py:17:11: NPY001 [*] Type alias `np.object` is deprecated, replace with builtin type | 17 | data=[[1, 2, 3]], 18 | columns=["a", "b", "c"], @@ -123,7 +123,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 19 19 | 20 20 | _ = arr.astype(np.int) -./resources/test/fixtures/numpy/NPY001.py:20:16: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type +NPY001.py:20:16: NPY001 [*] Type alias `np.int` is deprecated, replace with builtin type | 20 | ) 21 | diff --git a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap index b9d55c0e4b..86ce304740 100644 --- a/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap +++ b/crates/ruff/src/rules/numpy/snapshots/ruff__rules__numpy__tests__numpy-legacy-random_NPY002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/numpy/mod.rs --- -./resources/test/fixtures/numpy/NPY002.py:10:8: NPY002 Replace legacy `np.random.standard_normal` call with `np.random.Generator` +NPY002.py:10:8: NPY002 Replace legacy `np.random.standard_normal` call with `np.random.Generator` | 10 | # instead of this (legacy version) 11 | from numpy import random @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 14 | numbers = random.integers(high, size=5) | -./resources/test/fixtures/numpy/NPY002.py:11:13: NPY002 Replace legacy `np.random.standard_normal` call with `np.random.Generator` +NPY002.py:11:13: NPY002 Replace legacy `np.random.standard_normal` call with `np.random.Generator` | 11 | from numpy import random 12 | vals = random.standard_normal(10) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 14 | numbers = random.integers(high, size=5) | -./resources/test/fixtures/numpy/NPY002.py:15:1: NPY002 Replace legacy `np.random.seed` call with `np.random.Generator` +NPY002.py:15:1: NPY002 Replace legacy `np.random.seed` call with `np.random.Generator` | 15 | import numpy 16 | numpy.random.seed() @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 18 | numpy.random.set_state() | -./resources/test/fixtures/numpy/NPY002.py:16:1: NPY002 Replace legacy `np.random.get_state` call with `np.random.Generator` +NPY002.py:16:1: NPY002 Replace legacy `np.random.get_state` call with `np.random.Generator` | 16 | import numpy 17 | numpy.random.seed() @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 20 | numpy.random.rand() | -./resources/test/fixtures/numpy/NPY002.py:17:1: NPY002 Replace legacy `np.random.set_state` call with `np.random.Generator` +NPY002.py:17:1: NPY002 Replace legacy `np.random.set_state` call with `np.random.Generator` | 17 | numpy.random.seed() 18 | numpy.random.get_state() @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 21 | numpy.random.randn() | -./resources/test/fixtures/numpy/NPY002.py:18:1: NPY002 Replace legacy `np.random.rand` call with `np.random.Generator` +NPY002.py:18:1: NPY002 Replace legacy `np.random.rand` call with `np.random.Generator` | 18 | numpy.random.get_state() 19 | numpy.random.set_state() @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 22 | numpy.random.randint() | -./resources/test/fixtures/numpy/NPY002.py:19:1: NPY002 Replace legacy `np.random.randn` call with `np.random.Generator` +NPY002.py:19:1: NPY002 Replace legacy `np.random.randn` call with `np.random.Generator` | 19 | numpy.random.set_state() 20 | numpy.random.rand() @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 23 | numpy.random.random_integers() | -./resources/test/fixtures/numpy/NPY002.py:20:1: NPY002 Replace legacy `np.random.randint` call with `np.random.Generator` +NPY002.py:20:1: NPY002 Replace legacy `np.random.randint` call with `np.random.Generator` | 20 | numpy.random.rand() 21 | numpy.random.randn() @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 24 | numpy.random.random_sample() | -./resources/test/fixtures/numpy/NPY002.py:21:1: NPY002 Replace legacy `np.random.random_integers` call with `np.random.Generator` +NPY002.py:21:1: NPY002 Replace legacy `np.random.random_integers` call with `np.random.Generator` | 21 | numpy.random.randn() 22 | numpy.random.randint() @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 25 | numpy.random.choice() | -./resources/test/fixtures/numpy/NPY002.py:22:1: NPY002 Replace legacy `np.random.random_sample` call with `np.random.Generator` +NPY002.py:22:1: NPY002 Replace legacy `np.random.random_sample` call with `np.random.Generator` | 22 | numpy.random.randint() 23 | numpy.random.random_integers() @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 26 | numpy.random.bytes() | -./resources/test/fixtures/numpy/NPY002.py:23:1: NPY002 Replace legacy `np.random.choice` call with `np.random.Generator` +NPY002.py:23:1: NPY002 Replace legacy `np.random.choice` call with `np.random.Generator` | 23 | numpy.random.random_integers() 24 | numpy.random.random_sample() @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 27 | numpy.random.shuffle() | -./resources/test/fixtures/numpy/NPY002.py:24:1: NPY002 Replace legacy `np.random.bytes` call with `np.random.Generator` +NPY002.py:24:1: NPY002 Replace legacy `np.random.bytes` call with `np.random.Generator` | 24 | numpy.random.random_sample() 25 | numpy.random.choice() @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 28 | numpy.random.permutation() | -./resources/test/fixtures/numpy/NPY002.py:25:1: NPY002 Replace legacy `np.random.shuffle` call with `np.random.Generator` +NPY002.py:25:1: NPY002 Replace legacy `np.random.shuffle` call with `np.random.Generator` | 25 | numpy.random.choice() 26 | numpy.random.bytes() @@ -129,7 +129,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 29 | numpy.random.beta() | -./resources/test/fixtures/numpy/NPY002.py:26:1: NPY002 Replace legacy `np.random.permutation` call with `np.random.Generator` +NPY002.py:26:1: NPY002 Replace legacy `np.random.permutation` call with `np.random.Generator` | 26 | numpy.random.bytes() 27 | numpy.random.shuffle() @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 30 | numpy.random.binomial() | -./resources/test/fixtures/numpy/NPY002.py:27:1: NPY002 Replace legacy `np.random.beta` call with `np.random.Generator` +NPY002.py:27:1: NPY002 Replace legacy `np.random.beta` call with `np.random.Generator` | 27 | numpy.random.shuffle() 28 | numpy.random.permutation() @@ -149,7 +149,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 31 | numpy.random.chisquare() | -./resources/test/fixtures/numpy/NPY002.py:28:1: NPY002 Replace legacy `np.random.binomial` call with `np.random.Generator` +NPY002.py:28:1: NPY002 Replace legacy `np.random.binomial` call with `np.random.Generator` | 28 | numpy.random.permutation() 29 | numpy.random.beta() @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 32 | numpy.random.dirichlet() | -./resources/test/fixtures/numpy/NPY002.py:29:1: NPY002 Replace legacy `np.random.chisquare` call with `np.random.Generator` +NPY002.py:29:1: NPY002 Replace legacy `np.random.chisquare` call with `np.random.Generator` | 29 | numpy.random.beta() 30 | numpy.random.binomial() @@ -169,7 +169,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 33 | numpy.random.exponential() | -./resources/test/fixtures/numpy/NPY002.py:30:1: NPY002 Replace legacy `np.random.dirichlet` call with `np.random.Generator` +NPY002.py:30:1: NPY002 Replace legacy `np.random.dirichlet` call with `np.random.Generator` | 30 | numpy.random.binomial() 31 | numpy.random.chisquare() @@ -179,7 +179,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 34 | numpy.random.f() | -./resources/test/fixtures/numpy/NPY002.py:31:1: NPY002 Replace legacy `np.random.exponential` call with `np.random.Generator` +NPY002.py:31:1: NPY002 Replace legacy `np.random.exponential` call with `np.random.Generator` | 31 | numpy.random.chisquare() 32 | numpy.random.dirichlet() @@ -189,7 +189,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 35 | numpy.random.gamma() | -./resources/test/fixtures/numpy/NPY002.py:32:1: NPY002 Replace legacy `np.random.f` call with `np.random.Generator` +NPY002.py:32:1: NPY002 Replace legacy `np.random.f` call with `np.random.Generator` | 32 | numpy.random.dirichlet() 33 | numpy.random.exponential() @@ -199,7 +199,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 36 | numpy.random.geometric() | -./resources/test/fixtures/numpy/NPY002.py:33:1: NPY002 Replace legacy `np.random.gamma` call with `np.random.Generator` +NPY002.py:33:1: NPY002 Replace legacy `np.random.gamma` call with `np.random.Generator` | 33 | numpy.random.exponential() 34 | numpy.random.f() @@ -209,7 +209,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 37 | numpy.random.get_state() | -./resources/test/fixtures/numpy/NPY002.py:34:1: NPY002 Replace legacy `np.random.geometric` call with `np.random.Generator` +NPY002.py:34:1: NPY002 Replace legacy `np.random.geometric` call with `np.random.Generator` | 34 | numpy.random.f() 35 | numpy.random.gamma() @@ -219,7 +219,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 38 | numpy.random.gumbel() | -./resources/test/fixtures/numpy/NPY002.py:35:1: NPY002 Replace legacy `np.random.get_state` call with `np.random.Generator` +NPY002.py:35:1: NPY002 Replace legacy `np.random.get_state` call with `np.random.Generator` | 35 | numpy.random.gamma() 36 | numpy.random.geometric() @@ -229,7 +229,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 39 | numpy.random.hypergeometric() | -./resources/test/fixtures/numpy/NPY002.py:36:1: NPY002 Replace legacy `np.random.gumbel` call with `np.random.Generator` +NPY002.py:36:1: NPY002 Replace legacy `np.random.gumbel` call with `np.random.Generator` | 36 | numpy.random.geometric() 37 | numpy.random.get_state() @@ -239,7 +239,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 40 | numpy.random.laplace() | -./resources/test/fixtures/numpy/NPY002.py:37:1: NPY002 Replace legacy `np.random.hypergeometric` call with `np.random.Generator` +NPY002.py:37:1: NPY002 Replace legacy `np.random.hypergeometric` call with `np.random.Generator` | 37 | numpy.random.get_state() 38 | numpy.random.gumbel() @@ -249,7 +249,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 41 | numpy.random.logistic() | -./resources/test/fixtures/numpy/NPY002.py:38:1: NPY002 Replace legacy `np.random.laplace` call with `np.random.Generator` +NPY002.py:38:1: NPY002 Replace legacy `np.random.laplace` call with `np.random.Generator` | 38 | numpy.random.gumbel() 39 | numpy.random.hypergeometric() @@ -259,7 +259,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 42 | numpy.random.lognormal() | -./resources/test/fixtures/numpy/NPY002.py:39:1: NPY002 Replace legacy `np.random.logistic` call with `np.random.Generator` +NPY002.py:39:1: NPY002 Replace legacy `np.random.logistic` call with `np.random.Generator` | 39 | numpy.random.hypergeometric() 40 | numpy.random.laplace() @@ -269,7 +269,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 43 | numpy.random.logseries() | -./resources/test/fixtures/numpy/NPY002.py:40:1: NPY002 Replace legacy `np.random.lognormal` call with `np.random.Generator` +NPY002.py:40:1: NPY002 Replace legacy `np.random.lognormal` call with `np.random.Generator` | 40 | numpy.random.laplace() 41 | numpy.random.logistic() @@ -279,7 +279,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 44 | numpy.random.multinomial() | -./resources/test/fixtures/numpy/NPY002.py:41:1: NPY002 Replace legacy `np.random.logseries` call with `np.random.Generator` +NPY002.py:41:1: NPY002 Replace legacy `np.random.logseries` call with `np.random.Generator` | 41 | numpy.random.logistic() 42 | numpy.random.lognormal() @@ -289,7 +289,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 45 | numpy.random.multivariate_normal() | -./resources/test/fixtures/numpy/NPY002.py:42:1: NPY002 Replace legacy `np.random.multinomial` call with `np.random.Generator` +NPY002.py:42:1: NPY002 Replace legacy `np.random.multinomial` call with `np.random.Generator` | 42 | numpy.random.lognormal() 43 | numpy.random.logseries() @@ -299,7 +299,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 46 | numpy.random.negative_binomial() | -./resources/test/fixtures/numpy/NPY002.py:43:1: NPY002 Replace legacy `np.random.multivariate_normal` call with `np.random.Generator` +NPY002.py:43:1: NPY002 Replace legacy `np.random.multivariate_normal` call with `np.random.Generator` | 43 | numpy.random.logseries() 44 | numpy.random.multinomial() @@ -309,7 +309,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 47 | numpy.random.noncentral_chisquare() | -./resources/test/fixtures/numpy/NPY002.py:44:1: NPY002 Replace legacy `np.random.negative_binomial` call with `np.random.Generator` +NPY002.py:44:1: NPY002 Replace legacy `np.random.negative_binomial` call with `np.random.Generator` | 44 | numpy.random.multinomial() 45 | numpy.random.multivariate_normal() @@ -319,7 +319,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 48 | numpy.random.noncentral_f() | -./resources/test/fixtures/numpy/NPY002.py:45:1: NPY002 Replace legacy `np.random.noncentral_chisquare` call with `np.random.Generator` +NPY002.py:45:1: NPY002 Replace legacy `np.random.noncentral_chisquare` call with `np.random.Generator` | 45 | numpy.random.multivariate_normal() 46 | numpy.random.negative_binomial() @@ -329,7 +329,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 49 | numpy.random.normal() | -./resources/test/fixtures/numpy/NPY002.py:46:1: NPY002 Replace legacy `np.random.noncentral_f` call with `np.random.Generator` +NPY002.py:46:1: NPY002 Replace legacy `np.random.noncentral_f` call with `np.random.Generator` | 46 | numpy.random.negative_binomial() 47 | numpy.random.noncentral_chisquare() @@ -339,7 +339,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 50 | numpy.random.pareto() | -./resources/test/fixtures/numpy/NPY002.py:47:1: NPY002 Replace legacy `np.random.normal` call with `np.random.Generator` +NPY002.py:47:1: NPY002 Replace legacy `np.random.normal` call with `np.random.Generator` | 47 | numpy.random.noncentral_chisquare() 48 | numpy.random.noncentral_f() @@ -349,7 +349,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 51 | numpy.random.poisson() | -./resources/test/fixtures/numpy/NPY002.py:48:1: NPY002 Replace legacy `np.random.pareto` call with `np.random.Generator` +NPY002.py:48:1: NPY002 Replace legacy `np.random.pareto` call with `np.random.Generator` | 48 | numpy.random.noncentral_f() 49 | numpy.random.normal() @@ -359,7 +359,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 52 | numpy.random.power() | -./resources/test/fixtures/numpy/NPY002.py:49:1: NPY002 Replace legacy `np.random.poisson` call with `np.random.Generator` +NPY002.py:49:1: NPY002 Replace legacy `np.random.poisson` call with `np.random.Generator` | 49 | numpy.random.normal() 50 | numpy.random.pareto() @@ -369,7 +369,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 53 | numpy.random.rayleigh() | -./resources/test/fixtures/numpy/NPY002.py:50:1: NPY002 Replace legacy `np.random.power` call with `np.random.Generator` +NPY002.py:50:1: NPY002 Replace legacy `np.random.power` call with `np.random.Generator` | 50 | numpy.random.pareto() 51 | numpy.random.poisson() @@ -379,7 +379,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 54 | numpy.random.standard_cauchy() | -./resources/test/fixtures/numpy/NPY002.py:51:1: NPY002 Replace legacy `np.random.rayleigh` call with `np.random.Generator` +NPY002.py:51:1: NPY002 Replace legacy `np.random.rayleigh` call with `np.random.Generator` | 51 | numpy.random.poisson() 52 | numpy.random.power() @@ -389,7 +389,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 55 | numpy.random.standard_exponential() | -./resources/test/fixtures/numpy/NPY002.py:52:1: NPY002 Replace legacy `np.random.standard_cauchy` call with `np.random.Generator` +NPY002.py:52:1: NPY002 Replace legacy `np.random.standard_cauchy` call with `np.random.Generator` | 52 | numpy.random.power() 53 | numpy.random.rayleigh() @@ -399,7 +399,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 56 | numpy.random.standard_gamma() | -./resources/test/fixtures/numpy/NPY002.py:53:1: NPY002 Replace legacy `np.random.standard_exponential` call with `np.random.Generator` +NPY002.py:53:1: NPY002 Replace legacy `np.random.standard_exponential` call with `np.random.Generator` | 53 | numpy.random.rayleigh() 54 | numpy.random.standard_cauchy() @@ -409,7 +409,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 57 | numpy.random.standard_normal() | -./resources/test/fixtures/numpy/NPY002.py:54:1: NPY002 Replace legacy `np.random.standard_gamma` call with `np.random.Generator` +NPY002.py:54:1: NPY002 Replace legacy `np.random.standard_gamma` call with `np.random.Generator` | 54 | numpy.random.standard_cauchy() 55 | numpy.random.standard_exponential() @@ -419,7 +419,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 58 | numpy.random.standard_t() | -./resources/test/fixtures/numpy/NPY002.py:55:1: NPY002 Replace legacy `np.random.standard_normal` call with `np.random.Generator` +NPY002.py:55:1: NPY002 Replace legacy `np.random.standard_normal` call with `np.random.Generator` | 55 | numpy.random.standard_exponential() 56 | numpy.random.standard_gamma() @@ -429,7 +429,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 59 | numpy.random.triangular() | -./resources/test/fixtures/numpy/NPY002.py:56:1: NPY002 Replace legacy `np.random.standard_t` call with `np.random.Generator` +NPY002.py:56:1: NPY002 Replace legacy `np.random.standard_t` call with `np.random.Generator` | 56 | numpy.random.standard_gamma() 57 | numpy.random.standard_normal() @@ -439,7 +439,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 60 | numpy.random.uniform() | -./resources/test/fixtures/numpy/NPY002.py:57:1: NPY002 Replace legacy `np.random.triangular` call with `np.random.Generator` +NPY002.py:57:1: NPY002 Replace legacy `np.random.triangular` call with `np.random.Generator` | 57 | numpy.random.standard_normal() 58 | numpy.random.standard_t() @@ -449,7 +449,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 61 | numpy.random.vonmises() | -./resources/test/fixtures/numpy/NPY002.py:58:1: NPY002 Replace legacy `np.random.uniform` call with `np.random.Generator` +NPY002.py:58:1: NPY002 Replace legacy `np.random.uniform` call with `np.random.Generator` | 58 | numpy.random.standard_t() 59 | numpy.random.triangular() @@ -459,7 +459,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 62 | numpy.random.wald() | -./resources/test/fixtures/numpy/NPY002.py:59:1: NPY002 Replace legacy `np.random.vonmises` call with `np.random.Generator` +NPY002.py:59:1: NPY002 Replace legacy `np.random.vonmises` call with `np.random.Generator` | 59 | numpy.random.triangular() 60 | numpy.random.uniform() @@ -469,7 +469,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 63 | numpy.random.weibull() | -./resources/test/fixtures/numpy/NPY002.py:60:1: NPY002 Replace legacy `np.random.wald` call with `np.random.Generator` +NPY002.py:60:1: NPY002 Replace legacy `np.random.wald` call with `np.random.Generator` | 60 | numpy.random.uniform() 61 | numpy.random.vonmises() @@ -479,7 +479,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 64 | numpy.random.zipf() | -./resources/test/fixtures/numpy/NPY002.py:61:1: NPY002 Replace legacy `np.random.weibull` call with `np.random.Generator` +NPY002.py:61:1: NPY002 Replace legacy `np.random.weibull` call with `np.random.Generator` | 61 | numpy.random.vonmises() 62 | numpy.random.wald() @@ -488,7 +488,7 @@ source: crates/ruff/src/rules/numpy/mod.rs 64 | numpy.random.zipf() | -./resources/test/fixtures/numpy/NPY002.py:62:1: NPY002 Replace legacy `np.random.zipf` call with `np.random.Generator` +NPY002.py:62:1: NPY002 Replace legacy `np.random.zipf` call with `np.random.Generator` | 62 | numpy.random.wald() 63 | numpy.random.weibull() diff --git a/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap b/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap index aee313c84b..25851f81dc 100644 --- a/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap +++ b/crates/ruff/src/rules/pandas_vet/snapshots/ruff__rules__pandas_vet__tests__PD002_PD002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pandas_vet/mod.rs --- -./resources/test/fixtures/pandas_vet/PD002.py:5:23: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:5:23: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior | 5 | x = pd.DataFrame() 6 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs 7 7 | x.drop(["a"], axis=1, inplace=True) 8 8 | -./resources/test/fixtures/pandas_vet/PD002.py:7:23: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:7:23: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior | 7 | x.drop(["a"], axis=1, inplace=True) 8 | @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs 9 9 | x.drop( 10 10 | inplace=True, -./resources/test/fixtures/pandas_vet/PD002.py:10:5: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:10:5: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior | 10 | x.drop( 11 | inplace=True, @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs 12 11 | axis=1, 13 12 | ) -./resources/test/fixtures/pandas_vet/PD002.py:17:9: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:17:9: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior | 17 | if True: 18 | x.drop( @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs 19 18 | axis=1, 20 19 | ) -./resources/test/fixtures/pandas_vet/PD002.py:22:33: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:22:33: PD002 [*] `inplace=True` should be avoided; it has inconsistent behavior | 22 | ) 23 | @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs 23 23 | x.drop(["a"], axis=1, inplace=True, **kwargs) 24 24 | f(x.drop(["a"], axis=1, inplace=True)) -./resources/test/fixtures/pandas_vet/PD002.py:23:23: PD002 `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:23:23: PD002 `inplace=True` should be avoided; it has inconsistent behavior | 23 | x.drop(["a"], axis=1, **kwargs, inplace=True) 24 | x.drop(["a"], axis=1, inplace=True, **kwargs) @@ -114,7 +114,7 @@ source: crates/ruff/src/rules/pandas_vet/mod.rs 25 | f(x.drop(["a"], axis=1, inplace=True)) | -./resources/test/fixtures/pandas_vet/PD002.py:24:25: PD002 `inplace=True` should be avoided; it has inconsistent behavior +PD002.py:24:25: PD002 `inplace=True` should be avoided; it has inconsistent behavior | 24 | x.drop(["a"], axis=1, **kwargs, inplace=True) 25 | x.drop(["a"], axis=1, inplace=True, **kwargs) diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap index 205674422b..1756c047ab 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N801_N801.py.snap @@ -1,35 +1,35 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N801.py:1:7: N801 Class name `bad` should use CapWords convention +N801.py:1:7: N801 Class name `bad` should use CapWords convention | 1 | class bad: | ^^^ N801 2 | pass | -./resources/test/fixtures/pep8_naming/N801.py:5:7: N801 Class name `_bad` should use CapWords convention +N801.py:5:7: N801 Class name `_bad` should use CapWords convention | 5 | class _bad: | ^^^^ N801 6 | pass | -./resources/test/fixtures/pep8_naming/N801.py:9:7: N801 Class name `bad_class` should use CapWords convention +N801.py:9:7: N801 Class name `bad_class` should use CapWords convention | 9 | class bad_class: | ^^^^^^^^^ N801 10 | pass | -./resources/test/fixtures/pep8_naming/N801.py:13:7: N801 Class name `Bad_Class` should use CapWords convention +N801.py:13:7: N801 Class name `Bad_Class` should use CapWords convention | 13 | class Bad_Class: | ^^^^^^^^^ N801 14 | pass | -./resources/test/fixtures/pep8_naming/N801.py:17:7: N801 Class name `BAD_CLASS` should use CapWords convention +N801.py:17:7: N801 Class name `BAD_CLASS` should use CapWords convention | 17 | class BAD_CLASS: | ^^^^^^^^^ N801 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap index a043788af2..d7d407bd37 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N802_N802.py.snap @@ -1,35 +1,35 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N802.py:4:5: N802 Function name `Bad` should be lowercase +N802.py:4:5: N802 Function name `Bad` should be lowercase | 4 | def Bad(): | ^^^ N802 5 | pass | -./resources/test/fixtures/pep8_naming/N802.py:8:5: N802 Function name `_Bad` should be lowercase +N802.py:8:5: N802 Function name `_Bad` should be lowercase | 8 | def _Bad(): | ^^^^ N802 9 | pass | -./resources/test/fixtures/pep8_naming/N802.py:12:5: N802 Function name `BAD` should be lowercase +N802.py:12:5: N802 Function name `BAD` should be lowercase | 12 | def BAD(): | ^^^ N802 13 | pass | -./resources/test/fixtures/pep8_naming/N802.py:16:5: N802 Function name `BAD_FUNC` should be lowercase +N802.py:16:5: N802 Function name `BAD_FUNC` should be lowercase | 16 | def BAD_FUNC(): | ^^^^^^^^ N802 17 | pass | -./resources/test/fixtures/pep8_naming/N802.py:40:9: N802 Function name `testTest` should be lowercase +N802.py:40:9: N802 Function name `testTest` should be lowercase | 40 | return super().tearDown() 41 | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap index a9cf6f7403..f3440fb9a2 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N803_N803.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N803.py:1:16: N803 Argument name `A` should be lowercase +N803.py:1:16: N803 Argument name `A` should be lowercase | 1 | def func(_, a, A): | ^ N803 2 | return _, a, A | -./resources/test/fixtures/pep8_naming/N803.py:6:28: N803 Argument name `A` should be lowercase +N803.py:6:28: N803 Argument name `A` should be lowercase | 6 | class Class: 7 | def method(self, _, a, A): diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap index 22c8f6c8b3..4382a750e5 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N804_N804.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N804.py:30:27: N804 First argument of a class method should be named `cls` +N804.py:30:27: N804 First argument of a class method should be named `cls` | 30 | ... 31 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 33 | ... | -./resources/test/fixtures/pep8_naming/N804.py:38:56: N804 First argument of a class method should be named `cls` +N804.py:38:56: N804 First argument of a class method should be named `cls` | 38 | @classmethod 39 | def bad_class_method_with_positional_only_argument(self, x, /, other): @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 40 | ... | -./resources/test/fixtures/pep8_naming/N804.py:43:20: N804 First argument of a class method should be named `cls` +N804.py:43:20: N804 First argument of a class method should be named `cls` | 43 | class MetaClass(ABCMeta): 44 | def bad_method(self): diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap index 97c261596e..25c6d8965a 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N805_N805.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N805.py:7:20: N805 First argument of a method should be named `self` +N805.py:7:20: N805 First argument of a method should be named `self` | 7 | class Class: 8 | def bad_method(this): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 9 | pass | -./resources/test/fixtures/pep8_naming/N805.py:12:30: N805 First argument of a method should be named `self` +N805.py:12:30: N805 First argument of a method should be named `self` | 12 | if False: 13 | @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 15 | pass | -./resources/test/fixtures/pep8_naming/N805.py:27:15: N805 First argument of a method should be named `self` +N805.py:27:15: N805 First argument of a method should be named `self` | 27 | @pydantic.validator 28 | def lower(cls, my_field: str) -> str: @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 29 | pass | -./resources/test/fixtures/pep8_naming/N805.py:31:15: N805 First argument of a method should be named `self` +N805.py:31:15: N805 First argument of a method should be named `self` | 31 | @pydantic.validator("my_field") 32 | def lower(cls, my_field: str) -> str: @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 33 | pass | -./resources/test/fixtures/pep8_naming/N805.py:60:29: N805 First argument of a method should be named `self` +N805.py:60:29: N805 First argument of a method should be named `self` | 60 | pass 61 | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap index 5b8703ac4a..f38ae55019 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N806_N806.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N806.py:14:5: N806 Variable `Camel` in function should be lowercase +N806.py:14:5: N806 Variable `Camel` in function should be lowercase | 14 | GLOBAL = "bar" 15 | lower = 0 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 18 | _ = 0 | -./resources/test/fixtures/pep8_naming/N806.py:15:5: N806 Variable `CONSTANT` in function should be lowercase +N806.py:15:5: N806 Variable `CONSTANT` in function should be lowercase | 15 | lower = 0 16 | Camel = 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap index aea2dd33f0..2dd6714a5c 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N807_N807.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N807.py:1:5: N807 Function name should not start and end with `__` +N807.py:1:5: N807 Function name should not start and end with `__` | 1 | def __bad__(): | ^^^^^^^ N807 2 | pass | -./resources/test/fixtures/pep8_naming/N807.py:14:9: N807 Function name should not start and end with `__` +N807.py:14:9: N807 Function name should not start and end with `__` | 14 | def nested(): 15 | def __bad__(): diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap index 08ab3a1517..7ed5e1bbcc 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N811_N811.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N811.py:1:8: N811 Constant `CONST` imported as non-constant `const` +N811.py:1:8: N811 Constant `CONST` imported as non-constant `const` | 1 | import mod.CONST as const | ^^^^^^^^^^^^^^^^^^ N811 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 3 | from mod import ANOTHER_CONSTANT as another_constant | -./resources/test/fixtures/pep8_naming/N811.py:2:17: N811 Constant `CONSTANT` imported as non-constant `constant` +N811.py:2:17: N811 Constant `CONSTANT` imported as non-constant `constant` | 2 | import mod.CONST as const 3 | from mod import CONSTANT as constant @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 4 | from mod import ANOTHER_CONSTANT as another_constant | -./resources/test/fixtures/pep8_naming/N811.py:3:17: N811 Constant `ANOTHER_CONSTANT` imported as non-constant `another_constant` +N811.py:3:17: N811 Constant `ANOTHER_CONSTANT` imported as non-constant `another_constant` | 3 | import mod.CONST as const 4 | from mod import CONSTANT as constant diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap index 4accdf113a..da7b95c338 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N812_N812.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N812.py:1:8: N812 Lowercase `lowercase` imported as non-lowercase `Lower` +N812.py:1:8: N812 Lowercase `lowercase` imported as non-lowercase `Lower` | 1 | import modl.lowercase as Lower | ^^^^^^^^^^^^^^^^^^^^^^^ N812 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 3 | from mod import another_lowercase as AnotherLowercase | -./resources/test/fixtures/pep8_naming/N812.py:2:17: N812 Lowercase `lowercase` imported as non-lowercase `Lowercase` +N812.py:2:17: N812 Lowercase `lowercase` imported as non-lowercase `Lowercase` | 2 | import modl.lowercase as Lower 3 | from mod import lowercase as Lowercase @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 4 | from mod import another_lowercase as AnotherLowercase | -./resources/test/fixtures/pep8_naming/N812.py:3:17: N812 Lowercase `another_lowercase` imported as non-lowercase `AnotherLowercase` +N812.py:3:17: N812 Lowercase `another_lowercase` imported as non-lowercase `AnotherLowercase` | 3 | import modl.lowercase as Lower 4 | from mod import lowercase as Lowercase diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap index a3a8a9dd4c..45f17ec031 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N813_N813.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N813.py:1:8: N813 Camelcase `Camel` imported as lowercase `camel` +N813.py:1:8: N813 Camelcase `Camel` imported as lowercase `camel` | 1 | import mod.Camel as camel | ^^^^^^^^^^^^^^^^^^ N813 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 3 | from mod import AnotherCamelCase as another_camelcase | -./resources/test/fixtures/pep8_naming/N813.py:2:17: N813 Camelcase `CamelCase` imported as lowercase `camelcase` +N813.py:2:17: N813 Camelcase `CamelCase` imported as lowercase `camelcase` | 2 | import mod.Camel as camel 3 | from mod import CamelCase as camelcase @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 4 | from mod import AnotherCamelCase as another_camelcase | -./resources/test/fixtures/pep8_naming/N813.py:3:17: N813 Camelcase `AnotherCamelCase` imported as lowercase `another_camelcase` +N813.py:3:17: N813 Camelcase `AnotherCamelCase` imported as lowercase `another_camelcase` | 3 | import mod.Camel as camel 4 | from mod import CamelCase as camelcase diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap index 04f31f8cdb..e945b5e2c8 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N814_N814.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N814.py:1:8: N814 Camelcase `Camel` imported as constant `CAMEL` +N814.py:1:8: N814 Camelcase `Camel` imported as constant `CAMEL` | 1 | import mod.Camel as CAMEL | ^^^^^^^^^^^^^^^^^^ N814 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 3 | from mod import AnotherCamelCase as ANOTHER_CAMELCASE | -./resources/test/fixtures/pep8_naming/N814.py:2:17: N814 Camelcase `CamelCase` imported as constant `CAMELCASE` +N814.py:2:17: N814 Camelcase `CamelCase` imported as constant `CAMELCASE` | 2 | import mod.Camel as CAMEL 3 | from mod import CamelCase as CAMELCASE @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 4 | from mod import AnotherCamelCase as ANOTHER_CAMELCASE | -./resources/test/fixtures/pep8_naming/N814.py:3:17: N814 Camelcase `AnotherCamelCase` imported as constant `ANOTHER_CAMELCASE` +N814.py:3:17: N814 Camelcase `AnotherCamelCase` imported as constant `ANOTHER_CAMELCASE` | 3 | import mod.Camel as CAMEL 4 | from mod import CamelCase as CAMELCASE diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap index ac0459b981..079e8e6b2a 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N815_N815.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N815.py:9:5: N815 Variable `mixedCase` in class scope should not be mixedCase +N815.py:9:5: N815 Variable `mixedCase` in class scope should not be mixedCase | 9 | lower = 0 10 | CONSTANT = 0 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 13 | mixed_Case = 0 | -./resources/test/fixtures/pep8_naming/N815.py:10:5: N815 Variable `_mixedCase` in class scope should not be mixedCase +N815.py:10:5: N815 Variable `_mixedCase` in class scope should not be mixedCase | 10 | CONSTANT = 0 11 | mixedCase = 0 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 14 | myObj1 = collections.namedtuple("MyObj1", ["a", "b"]) | -./resources/test/fixtures/pep8_naming/N815.py:11:5: N815 Variable `mixed_Case` in class scope should not be mixedCase +N815.py:11:5: N815 Variable `mixed_Case` in class scope should not be mixedCase | 11 | mixedCase = 0 12 | _mixedCase = 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap index a59a0498b9..9f1688bfd5 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N816_N816.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N816.py:7:1: N816 Variable `mixedCase` in global scope should not be mixedCase +N816.py:7:1: N816 Variable `mixedCase` in global scope should not be mixedCase | 7 | lower = 0 8 | CONSTANT = 0 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 11 | mixed_Case = 0 | -./resources/test/fixtures/pep8_naming/N816.py:8:1: N816 Variable `_mixedCase` in global scope should not be mixedCase +N816.py:8:1: N816 Variable `_mixedCase` in global scope should not be mixedCase | 8 | CONSTANT = 0 9 | mixedCase = 0 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 12 | myObj1 = collections.namedtuple("MyObj1", ["a", "b"]) | -./resources/test/fixtures/pep8_naming/N816.py:9:1: N816 Variable `mixed_Case` in global scope should not be mixedCase +N816.py:9:1: N816 Variable `mixed_Case` in global scope should not be mixedCase | 9 | mixedCase = 0 10 | _mixedCase = 0 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap index 3ddbc090a4..e194e79ab0 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N817_N817.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N817.py:1:8: N817 CamelCase `CaMel` imported as acronym `CM` +N817.py:1:8: N817 CamelCase `CaMel` imported as acronym `CM` | 1 | import mod.CaMel as CM | ^^^^^^^^^^^^^^^ N817 2 | from mod import CamelCase as CC | -./resources/test/fixtures/pep8_naming/N817.py:2:17: N817 CamelCase `CamelCase` imported as acronym `CC` +N817.py:2:17: N817 CamelCase `CamelCase` imported as acronym `CC` | 2 | import mod.CaMel as CM 3 | from mod import CamelCase as CC diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap index 343e819fc0..9acf3b6bcc 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N818_N818.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N818.py:9:7: N818 Exception name `C` should be named with an Error suffix +N818.py:9:7: N818 Exception name `C` should be named with an Error suffix | 9 | class C(Exception): | ^ N818 10 | pass | -./resources/test/fixtures/pep8_naming/N818.py:17:7: N818 Exception name `E` should be named with an Error suffix +N818.py:17:7: N818 Exception name `E` should be named with an Error suffix | 17 | class E(AnotherError): | ^ N818 diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap index 667ec8673b..2167171d58 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__MODULE____init__.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N999/module/MODULE/__init__.py:1:1: N999 Invalid module name: 'MODULE' +__init__.py:1:1: N999 Invalid module name: 'MODULE' | | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap index 720585782d..f5d2a97e9a 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__0001_initial.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N999/module/invalid_name/0001_initial.py:1:1: N999 Invalid module name: '0001_initial' +0001_initial.py:1:1: N999 Invalid module name: '0001_initial' | | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap index 2d432d8a6a..b57d684ac9 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__invalid_name__import.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N999/module/invalid_name/import.py:1:1: N999 Invalid module name: 'import' +import.py:1:1: N999 Invalid module name: 'import' | | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap index 741170e865..16357a2fa0 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod with spaces____init__.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N999/module/mod with spaces/__init__.py:1:1: N999 Invalid module name: 'mod with spaces' +__init__.py:1:1: N999 Invalid module name: 'mod with spaces' | | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap index 33c3b77318..75c4e4aacb 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__mod-with-dashes____init__.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N999/module/mod-with-dashes/__init__.py:1:1: N999 Invalid module name: 'mod-with-dashes' +__init__.py:1:1: N999 Invalid module name: 'mod-with-dashes' | | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap index 382b4b7d3e..c95f6877f7 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__N999_N999__module__valid_name__file-with-dashes.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N999/module/valid_name/file-with-dashes.py:1:1: N999 Invalid module name: 'file-with-dashes' +file-with-dashes.py:1:1: N999 Invalid module name: 'file-with-dashes' | | diff --git a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap index 6af0b302a5..843d9ea44f 100644 --- a/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap +++ b/crates/ruff/src/rules/pep8_naming/snapshots/ruff__rules__pep8_naming__tests__classmethod_decorators.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pep8_naming/mod.rs --- -./resources/test/fixtures/pep8_naming/N805.py:7:20: N805 First argument of a method should be named `self` +N805.py:7:20: N805 First argument of a method should be named `self` | 7 | class Class: 8 | def bad_method(this): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 9 | pass | -./resources/test/fixtures/pep8_naming/N805.py:12:30: N805 First argument of a method should be named `self` +N805.py:12:30: N805 First argument of a method should be named `self` | 12 | if False: 13 | @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pep8_naming/mod.rs 15 | pass | -./resources/test/fixtures/pep8_naming/N805.py:60:29: N805 First argument of a method should be named `self` +N805.py:60:29: N805 First argument of a method should be named `self` | 60 | pass 61 | diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap index 11b9db1bb2..754f1c42a2 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E101_E101.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E101.py:11:1: E101 Indentation contains mixed spaces and tabs +E101.py:11:1: E101 Indentation contains mixed spaces and tabs | 11 | def func_mixed_start_with_tab(): 12 | # E101 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 15 | def func_mixed_start_with_space(): | -./resources/test/fixtures/pycodestyle/E101.py:15:1: E101 Indentation contains mixed spaces and tabs +E101.py:15:1: E101 Indentation contains mixed spaces and tabs | 15 | def func_mixed_start_with_space(): 16 | # E101 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 | def xyz(): | -./resources/test/fixtures/pycodestyle/E101.py:19:1: E101 Indentation contains mixed spaces and tabs +E101.py:19:1: E101 Indentation contains mixed spaces and tabs | 19 | def xyz(): 20 | # E101 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap index 2635c1ae8b..de931cf1fe 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E111_E11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E11.py:3:3: E111 Indentation is not a multiple of 4 +E11.py:3:3: E111 Indentation is not a multiple of 4 | 3 | #: E111 4 | if x > 2: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 | if True: | -./resources/test/fixtures/pycodestyle/E11.py:6:6: E111 Indentation is not a multiple of 4 +E11.py:6:6: E111 Indentation is not a multiple of 4 | 6 | #: E111 E117 7 | if True: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap index 62545c372a..71c8fb92eb 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E112_E11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E11.py:9:1: E112 Expected an indented block +E11.py:9:1: E112 Expected an indented block | 9 | #: E112 10 | if False: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap index 4db2d51174..5d91e775ba 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E113_E11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E11.py:12:5: E113 Unexpected indentation +E11.py:12:5: E113 Unexpected indentation | 12 | #: E113 13 | print() diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap index 9f48bdcce5..ffcfc4d481 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E114_E11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E11.py:15:6: E114 Indentation is not a multiple of 4 (comment) +E11.py:15:6: E114 Indentation is not a multiple of 4 (comment) | 15 | #: E114 E116 16 | mimetype = 'application/x-directory' diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap index c04c6f056b..6a8cc9b1ad 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E115_E11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E11.py:30:1: E115 Expected an indented block (comment) +E11.py:30:1: E115 Expected an indented block (comment) | 30 | def start(self): 31 | if True: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 34 | # except MasterExit: | -./resources/test/fixtures/pycodestyle/E11.py:31:1: E115 Expected an indented block (comment) +E11.py:31:1: E115 Expected an indented block (comment) | 31 | if True: 32 | # try: @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 35 | # self.shutdown() | -./resources/test/fixtures/pycodestyle/E11.py:32:1: E115 Expected an indented block (comment) +E11.py:32:1: E115 Expected an indented block (comment) | 32 | # try: 33 | # self.master.start() @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 36 | # finally: | -./resources/test/fixtures/pycodestyle/E11.py:33:1: E115 Expected an indented block (comment) +E11.py:33:1: E115 Expected an indented block (comment) | 33 | # self.master.start() 34 | # except MasterExit: @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 37 | # sys.exit() | -./resources/test/fixtures/pycodestyle/E11.py:34:1: E115 Expected an indented block (comment) +E11.py:34:1: E115 Expected an indented block (comment) | 34 | # except MasterExit: 35 | # self.shutdown() @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 38 | self.master.start() | -./resources/test/fixtures/pycodestyle/E11.py:35:1: E115 Expected an indented block (comment) +E11.py:35:1: E115 Expected an indented block (comment) | 35 | # self.shutdown() 36 | # finally: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap index 431add0af8..0445413afc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E116_E11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E11.py:15:6: E116 Unexpected indentation (comment) +E11.py:15:6: E116 Unexpected indentation (comment) | 15 | #: E114 E116 16 | mimetype = 'application/x-directory' @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 | #: E116 E116 E116 | -./resources/test/fixtures/pycodestyle/E11.py:22:13: E116 Unexpected indentation (comment) +E11.py:22:13: E116 Unexpected indentation (comment) | 22 | self.master.start() 23 | # try: @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 26 | # self.shutdown() | -./resources/test/fixtures/pycodestyle/E11.py:24:13: E116 Unexpected indentation (comment) +E11.py:24:13: E116 Unexpected indentation (comment) | 24 | # self.master.start() 25 | # except MasterExit: @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 28 | # sys.exit() | -./resources/test/fixtures/pycodestyle/E11.py:26:13: E116 Unexpected indentation (comment) +E11.py:26:13: E116 Unexpected indentation (comment) | 26 | # self.shutdown() 27 | # finally: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap index 66cf78d89a..fa9e1867be 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E117_E11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E11.py:6:6: E117 Over-indented +E11.py:6:6: E117 Over-indented | 6 | #: E111 E117 7 | if True: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | if False: | -./resources/test/fixtures/pycodestyle/E11.py:39:9: E117 Over-indented +E11.py:39:9: E117 Over-indented | 39 | #: E117 40 | def start(): @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 43 | def start(): | -./resources/test/fixtures/pycodestyle/E11.py:42:3: E117 Over-indented +E11.py:42:3: E117 Over-indented | 42 | #: E117 W191 43 | def start(): diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap index 318aeea66c..65ff9adf5c 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E201_E20.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E20.py:2:6: E201 Whitespace after '(' +E20.py:2:6: E201 Whitespace after '(' | 2 | #: E201:1:6 3 | spam( ham[1], {eggs: 2}) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 5 | spam(ham[ 1], {eggs: 2}) | -./resources/test/fixtures/pycodestyle/E20.py:4:10: E201 Whitespace after '(' +E20.py:4:10: E201 Whitespace after '(' | 4 | spam( ham[1], {eggs: 2}) 5 | #: E201:1:10 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | spam(ham[1], { eggs: 2}) | -./resources/test/fixtures/pycodestyle/E20.py:6:15: E201 Whitespace after '(' +E20.py:6:15: E201 Whitespace after '(' | 6 | spam(ham[ 1], {eggs: 2}) 7 | #: E201:1:15 @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | spam( ham[1], {eggs: 2}) | -./resources/test/fixtures/pycodestyle/E20.py:8:6: E201 Whitespace after '(' +E20.py:8:6: E201 Whitespace after '(' | 8 | spam(ham[1], { eggs: 2}) 9 | #: E201:1:6 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 | spam(ham[ 1], {eggs: 2}) | -./resources/test/fixtures/pycodestyle/E20.py:10:10: E201 Whitespace after '(' +E20.py:10:10: E201 Whitespace after '(' | 10 | spam( ham[1], {eggs: 2}) 11 | #: E201:1:10 @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | spam(ham[1], { eggs: 2}) | -./resources/test/fixtures/pycodestyle/E20.py:12:15: E201 Whitespace after '(' +E20.py:12:15: E201 Whitespace after '(' | 12 | spam(ham[ 1], {eggs: 2}) 13 | #: E201:1:15 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap index c474ce2b84..022fe45994 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E202_E20.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E20.py:19:23: E202 Whitespace before ')' +E20.py:19:23: E202 Whitespace before ')' | 19 | #: E202:1:23 20 | spam(ham[1], {eggs: 2} ) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 | spam(ham[1], {eggs: 2 }) | -./resources/test/fixtures/pycodestyle/E20.py:21:22: E202 Whitespace before ')' +E20.py:21:22: E202 Whitespace before ')' | 21 | spam(ham[1], {eggs: 2} ) 22 | #: E202:1:22 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 25 | spam(ham[1 ], {eggs: 2}) | -./resources/test/fixtures/pycodestyle/E20.py:23:11: E202 Whitespace before ')' +E20.py:23:11: E202 Whitespace before ')' | 23 | spam(ham[1], {eggs: 2 }) 24 | #: E202:1:11 @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 27 | spam(ham[1], {eggs: 2} ) | -./resources/test/fixtures/pycodestyle/E20.py:25:23: E202 Whitespace before ')' +E20.py:25:23: E202 Whitespace before ')' | 25 | spam(ham[1 ], {eggs: 2}) 26 | #: E202:1:23 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 29 | spam(ham[1], {eggs: 2 }) | -./resources/test/fixtures/pycodestyle/E20.py:27:22: E202 Whitespace before ')' +E20.py:27:22: E202 Whitespace before ')' | 27 | spam(ham[1], {eggs: 2} ) 28 | #: E202:1:22 @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 31 | spam(ham[1 ], {eggs: 2}) | -./resources/test/fixtures/pycodestyle/E20.py:29:11: E202 Whitespace before ')' +E20.py:29:11: E202 Whitespace before ')' | 29 | spam(ham[1], {eggs: 2 }) 30 | #: E202:1:11 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap index c6bdb8a3ad..4f2d7c1c22 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E203_E20.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E20.py:51:10: E203 Whitespace before ',', ';', or ':' +E20.py:51:10: E203 Whitespace before ',', ';', or ':' | 51 | #: E203:1:10 52 | if x == 4 : @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 54 | x, y = y, x | -./resources/test/fixtures/pycodestyle/E20.py:55:10: E203 Whitespace before ',', ';', or ':' +E20.py:55:10: E203 Whitespace before ',', ';', or ':' | 55 | x, y = y, x 56 | #: E203:1:10 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 59 | x, y = y, x | -./resources/test/fixtures/pycodestyle/E20.py:60:15: E203 Whitespace before ',', ';', or ':' +E20.py:60:15: E203 Whitespace before ',', ';', or ':' | 60 | #: E203:2:15 E702:2:16 61 | if x == 4: @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 64 | if x == 4: | -./resources/test/fixtures/pycodestyle/E20.py:63:15: E203 Whitespace before ',', ';', or ':' +E20.py:63:15: E203 Whitespace before ',', ';', or ':' | 63 | #: E203:2:15 E702:2:16 64 | if x == 4: @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 67 | if x == 4: | -./resources/test/fixtures/pycodestyle/E20.py:67:13: E203 Whitespace before ',', ';', or ':' +E20.py:67:13: E203 Whitespace before ',', ';', or ':' | 67 | if x == 4: 68 | print x, y @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 71 | if x == 4: | -./resources/test/fixtures/pycodestyle/E20.py:71:13: E203 Whitespace before ',', ';', or ':' +E20.py:71:13: E203 Whitespace before ',', ';', or ':' | 71 | if x == 4: 72 | print x, y diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap index 73b73e60be..0544ec733c 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E211_E21.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E21.py:2:5: E211 [*] Whitespace before '(' +E21.py:2:5: E211 [*] Whitespace before '(' | 2 | #: E211 3 | spam (1) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | dict ['key'] = list [index] 5 5 | #: E211 -./resources/test/fixtures/pycodestyle/E21.py:4:5: E211 [*] Whitespace before '[' +E21.py:4:5: E211 [*] Whitespace before '[' | 4 | spam (1) 5 | #: E211 E211 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 6 6 | dict['key'] ['subkey'] = list[index] 7 7 | #: Okay -./resources/test/fixtures/pycodestyle/E21.py:4:20: E211 [*] Whitespace before '[' +E21.py:4:20: E211 [*] Whitespace before '[' | 4 | spam (1) 5 | #: E211 E211 @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 6 6 | dict['key'] ['subkey'] = list[index] 7 7 | #: Okay -./resources/test/fixtures/pycodestyle/E21.py:6:12: E211 [*] Whitespace before '[' +E21.py:6:12: E211 [*] Whitespace before '[' | 6 | dict ['key'] = list [index] 7 | #: E211 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap index 4aefe26617..2dd5e63fd6 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E221_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:3:6: E221 Multiple spaces before operator +E22.py:3:6: E221 Multiple spaces before operator | 3 | #: E221 4 | a = 12 + 3 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 | x = 1 | -./resources/test/fixtures/pycodestyle/E22.py:5:2: E221 Multiple spaces before operator +E22.py:5:2: E221 Multiple spaces before operator | 5 | b = 4 + 5 6 | #: E221 E221 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 9 | long_variable = 3 | -./resources/test/fixtures/pycodestyle/E22.py:6:2: E221 Multiple spaces before operator +E22.py:6:2: E221 Multiple spaces before operator | 6 | #: E221 E221 7 | x = 1 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | #: E221 E221 | -./resources/test/fixtures/pycodestyle/E22.py:9:5: E221 Multiple spaces before operator +E22.py:9:5: E221 Multiple spaces before operator | 9 | long_variable = 3 10 | #: E221 E221 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 | long_variable = 3 | -./resources/test/fixtures/pycodestyle/E22.py:10:5: E221 Multiple spaces before operator +E22.py:10:5: E221 Multiple spaces before operator | 10 | #: E221 E221 11 | x[0] = 1 @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | #: E221 E221 | -./resources/test/fixtures/pycodestyle/E22.py:13:9: E221 Multiple spaces before operator +E22.py:13:9: E221 Multiple spaces before operator | 13 | long_variable = 3 14 | #: E221 E221 @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 17 | z = x[0] + 3 | -./resources/test/fixtures/pycodestyle/E22.py:15:9: E221 Multiple spaces before operator +E22.py:15:9: E221 Multiple spaces before operator | 15 | x = f(x) + 1 16 | y = long_variable + 2 @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 | text = """ | -./resources/test/fixtures/pycodestyle/E22.py:19:14: E221 Multiple spaces before operator +E22.py:19:14: E221 Multiple spaces before operator | 19 | text = """ 20 | bar diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap index 025979cc99..e3e4d8d9ae 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E222_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:28:8: E222 Multiple spaces after operator +E22.py:28:8: E222 Multiple spaces after operator | 28 | #: E222 29 | a = a + 1 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 31 | #: E222 E222 | -./resources/test/fixtures/pycodestyle/E22.py:31:4: E222 Multiple spaces after operator +E22.py:31:4: E222 Multiple spaces after operator | 31 | b = b + 10 32 | #: E222 E222 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 35 | long_variable = 3 | -./resources/test/fixtures/pycodestyle/E22.py:32:4: E222 Multiple spaces after operator +E22.py:32:4: E222 Multiple spaces after operator | 32 | #: E222 E222 33 | x = -1 @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 36 | #: E222 E222 | -./resources/test/fixtures/pycodestyle/E22.py:35:7: E222 Multiple spaces after operator +E22.py:35:7: E222 Multiple spaces after operator | 35 | long_variable = 3 36 | #: E222 E222 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 39 | long_variable = 3 | -./resources/test/fixtures/pycodestyle/E22.py:36:7: E222 Multiple spaces after operator +E22.py:36:7: E222 Multiple spaces after operator | 36 | #: E222 E222 37 | x[0] = 1 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap index c802f85d75..fad6ed3133 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E223_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:43:2: E223 Tab before operator +E22.py:43:2: E223 Tab before operator | 43 | #: E223 44 | foobart = 4 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap index 870dca11cb..cdb3d18aa4 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E224_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:48:5: E224 Tab after operator +E22.py:48:5: E224 Tab after operator | 48 | #: E224 49 | a += 1 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap index 22d573ee00..0d8ec1b68c 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E225_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:54:13: E225 Missing whitespace around operator +E22.py:54:13: E225 Missing whitespace around operator | 54 | #: E225 55 | submitted +=1 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 57 | submitted+= 1 | -./resources/test/fixtures/pycodestyle/E22.py:58:4: E225 Missing whitespace around operator +E22.py:58:4: E225 Missing whitespace around operator | 58 | submitted+= 1 59 | #: E225 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 62 | x = x /2 - 1 | -./resources/test/fixtures/pycodestyle/E22.py:60:8: E225 Missing whitespace around operator +E22.py:60:8: E225 Missing whitespace around operator | 60 | c =-1 61 | #: E225 @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 64 | c = alpha -4 | -./resources/test/fixtures/pycodestyle/E22.py:62:12: E225 Missing whitespace around operator +E22.py:62:12: E225 Missing whitespace around operator | 62 | x = x /2 - 1 63 | #: E225 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 66 | c = alpha- 4 | -./resources/test/fixtures/pycodestyle/E22.py:64:10: E225 Missing whitespace around operator +E22.py:64:10: E225 Missing whitespace around operator | 64 | c = alpha -4 65 | #: E225 @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 68 | z = x **y | -./resources/test/fixtures/pycodestyle/E22.py:66:9: E225 Missing whitespace around operator +E22.py:66:9: E225 Missing whitespace around operator | 66 | c = alpha- 4 67 | #: E225 @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 70 | z = (x + 1) **y | -./resources/test/fixtures/pycodestyle/E22.py:68:15: E225 Missing whitespace around operator +E22.py:68:15: E225 Missing whitespace around operator | 68 | z = x **y 69 | #: E225 @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 72 | z = (x + 1)** y | -./resources/test/fixtures/pycodestyle/E22.py:70:12: E225 Missing whitespace around operator +E22.py:70:12: E225 Missing whitespace around operator | 70 | z = (x + 1) **y 71 | #: E225 @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 74 | _1kB = _1MB >>10 | -./resources/test/fixtures/pycodestyle/E22.py:72:15: E225 Missing whitespace around operator +E22.py:72:15: E225 Missing whitespace around operator | 72 | z = (x + 1)** y 73 | #: E225 @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 76 | _1kB = _1MB>> 10 | -./resources/test/fixtures/pycodestyle/E22.py:74:12: E225 Missing whitespace around operator +E22.py:74:12: E225 Missing whitespace around operator | 74 | _1kB = _1MB >>10 75 | #: E225 @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 78 | i=i+ 1 | -./resources/test/fixtures/pycodestyle/E22.py:76:3: E225 Missing whitespace around operator +E22.py:76:3: E225 Missing whitespace around operator | 76 | _1kB = _1MB>> 10 77 | #: E225 E225 @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 80 | i=i +1 | -./resources/test/fixtures/pycodestyle/E22.py:76:4: E225 Missing whitespace around operator +E22.py:76:4: E225 Missing whitespace around operator | 76 | _1kB = _1MB>> 10 77 | #: E225 E225 @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 80 | i=i +1 | -./resources/test/fixtures/pycodestyle/E22.py:78:3: E225 Missing whitespace around operator +E22.py:78:3: E225 Missing whitespace around operator | 78 | i=i+ 1 79 | #: E225 E225 @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 82 | i = 1and 1 | -./resources/test/fixtures/pycodestyle/E22.py:78:6: E225 Missing whitespace around operator +E22.py:78:6: E225 Missing whitespace around operator | 78 | i=i+ 1 79 | #: E225 E225 @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 82 | i = 1and 1 | -./resources/test/fixtures/pycodestyle/E22.py:88:8: E225 Missing whitespace around operator +E22.py:88:8: E225 Missing whitespace around operator | 88 | 1in [] 89 | #: E225 @@ -150,7 +150,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 92 | i = 1@ 2 | -./resources/test/fixtures/pycodestyle/E22.py:90:6: E225 Missing whitespace around operator +E22.py:90:6: E225 Missing whitespace around operator | 90 | i = 1 @2 91 | #: E225 @@ -160,7 +160,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 94 | i=i+1 | -./resources/test/fixtures/pycodestyle/E22.py:92:3: E225 Missing whitespace around operator +E22.py:92:3: E225 Missing whitespace around operator | 92 | i = 1@ 2 93 | #: E225 E226 @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 96 | i =i+1 | -./resources/test/fixtures/pycodestyle/E22.py:94:4: E225 Missing whitespace around operator +E22.py:94:4: E225 Missing whitespace around operator | 94 | i=i+1 95 | #: E225 E226 @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 98 | i= i+1 | -./resources/test/fixtures/pycodestyle/E22.py:98:9: E225 Missing whitespace around operator +E22.py:98:9: E225 Missing whitespace around operator | 98 | i= i+1 99 | #: E225 E226 @@ -190,7 +190,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 102 | c = (a+ b)*(a - b) | -./resources/test/fixtures/pycodestyle/E22.py:100:7: E225 Missing whitespace around operator +E22.py:100:7: E225 Missing whitespace around operator | 100 | c = (a +b)*(a - b) 101 | #: E225 E226 @@ -199,7 +199,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 103 | #: | -./resources/test/fixtures/pycodestyle/E22.py:154:13: E225 Missing whitespace around operator +E22.py:154:13: E225 Missing whitespace around operator | 154 | func2(lambda a, b=h[:], c=0: (a, b, c)) 155 | if not -5 < x < +5: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap index f54566a11f..c13c83a120 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E226_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:92:4: E226 Missing whitespace around arithmetic operator +E22.py:92:4: E226 Missing whitespace around arithmetic operator | 92 | i = 1@ 2 93 | #: E225 E226 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 96 | i =i+1 | -./resources/test/fixtures/pycodestyle/E22.py:94:5: E226 Missing whitespace around arithmetic operator +E22.py:94:5: E226 Missing whitespace around arithmetic operator | 94 | i=i+1 95 | #: E225 E226 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 98 | i= i+1 | -./resources/test/fixtures/pycodestyle/E22.py:96:5: E226 Missing whitespace around arithmetic operator +E22.py:96:5: E226 Missing whitespace around arithmetic operator | 96 | i =i+1 97 | #: E225 E226 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 100 | c = (a +b)*(a - b) | -./resources/test/fixtures/pycodestyle/E22.py:98:11: E226 Missing whitespace around arithmetic operator +E22.py:98:11: E226 Missing whitespace around arithmetic operator | 98 | i= i+1 99 | #: E225 E226 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 102 | c = (a+ b)*(a - b) | -./resources/test/fixtures/pycodestyle/E22.py:100:11: E226 Missing whitespace around arithmetic operator +E22.py:100:11: E226 Missing whitespace around arithmetic operator | 100 | c = (a +b)*(a - b) 101 | #: E225 E226 @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 103 | #: | -./resources/test/fixtures/pycodestyle/E22.py:106:7: E226 Missing whitespace around arithmetic operator +E22.py:106:7: E226 Missing whitespace around arithmetic operator | 106 | z = 2//30 107 | #: E226 E226 @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 110 | norman = True+False | -./resources/test/fixtures/pycodestyle/E22.py:106:15: E226 Missing whitespace around arithmetic operator +E22.py:106:15: E226 Missing whitespace around arithmetic operator | 106 | z = 2//30 107 | #: E226 E226 @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 110 | norman = True+False | -./resources/test/fixtures/pycodestyle/E22.py:110:6: E226 Missing whitespace around arithmetic operator +E22.py:110:6: E226 Missing whitespace around arithmetic operator | 110 | norman = True+False 111 | #: E226 @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 114 | x = x/2 - 1 | -./resources/test/fixtures/pycodestyle/E22.py:112:6: E226 Missing whitespace around arithmetic operator +E22.py:112:6: E226 Missing whitespace around arithmetic operator | 112 | x = x*2 - 1 113 | #: E226 @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 116 | hypot2 = x*x + y*y | -./resources/test/fixtures/pycodestyle/E22.py:114:11: E226 Missing whitespace around arithmetic operator +E22.py:114:11: E226 Missing whitespace around arithmetic operator | 114 | x = x/2 - 1 115 | #: E226 E226 @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 118 | c = (a + b)*(a - b) | -./resources/test/fixtures/pycodestyle/E22.py:114:17: E226 Missing whitespace around arithmetic operator +E22.py:114:17: E226 Missing whitespace around arithmetic operator | 114 | x = x/2 - 1 115 | #: E226 E226 @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 118 | c = (a + b)*(a - b) | -./resources/test/fixtures/pycodestyle/E22.py:116:12: E226 Missing whitespace around arithmetic operator +E22.py:116:12: E226 Missing whitespace around arithmetic operator | 116 | hypot2 = x*x + y*y 117 | #: E226 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap index 82a7df2691..f482ceb131 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E227_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:121:12: E227 Missing whitespace around bitwise or shift operator +E22.py:121:12: E227 Missing whitespace around bitwise or shift operator | 121 | return (i//2 for i in range(n)) 122 | #: E227 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 125 | _1MB = _1kB<<10 | -./resources/test/fixtures/pycodestyle/E22.py:123:12: E227 Missing whitespace around bitwise or shift operator +E22.py:123:12: E227 Missing whitespace around bitwise or shift operator | 123 | _1kB = _1MB>>10 124 | #: E227 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 127 | a = b|c | -./resources/test/fixtures/pycodestyle/E22.py:125:6: E227 Missing whitespace around bitwise or shift operator +E22.py:125:6: E227 Missing whitespace around bitwise or shift operator | 125 | _1MB = _1kB<<10 126 | #: E227 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 129 | b = c&a | -./resources/test/fixtures/pycodestyle/E22.py:127:6: E227 Missing whitespace around bitwise or shift operator +E22.py:127:6: E227 Missing whitespace around bitwise or shift operator | 127 | a = b|c 128 | #: E227 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 131 | c = b^a | -./resources/test/fixtures/pycodestyle/E22.py:129:6: E227 Missing whitespace around bitwise or shift operator +E22.py:129:6: E227 Missing whitespace around bitwise or shift operator | 129 | b = c&a 130 | #: E227 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap index ec7ec77026..fbb2c5c510 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E228_E22.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E22.py:131:6: E228 Missing whitespace around modulo operator +E22.py:131:6: E228 Missing whitespace around modulo operator | 131 | c = b^a 132 | #: E228 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 135 | msg = fmt%(errno, errmsg) | -./resources/test/fixtures/pycodestyle/E22.py:133:10: E228 Missing whitespace around modulo operator +E22.py:133:10: E228 Missing whitespace around modulo operator | 133 | a = b%c 134 | #: E228 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 137 | msg = "Error %d occurred"%errno | -./resources/test/fixtures/pycodestyle/E22.py:135:26: E228 Missing whitespace around modulo operator +E22.py:135:26: E228 Missing whitespace around modulo operator | 135 | msg = fmt%(errno, errmsg) 136 | #: E228 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap index e7856038b1..26828dc776 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E231_E23.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E23.py:2:7: E231 [*] Missing whitespace after ',' +E23.py:2:7: E231 [*] Missing whitespace after ',' | 2 | #: E231 3 | a = (1,2) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | a[b1,:] 5 5 | #: E231 -./resources/test/fixtures/pycodestyle/E23.py:4:5: E231 [*] Missing whitespace after ',' +E23.py:4:5: E231 [*] Missing whitespace after ',' | 4 | a = (1,2) 5 | #: E231 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 6 6 | a = [{'a':''}] 7 7 | #: Okay -./resources/test/fixtures/pycodestyle/E23.py:6:10: E231 [*] Missing whitespace after ':' +E23.py:6:10: E231 [*] Missing whitespace after ':' | 6 | a[b1,:] 7 | #: E231 @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 8 | a = (4,) 9 9 | b = (5, ) -./resources/test/fixtures/pycodestyle/E23.py:19:10: E231 [*] Missing whitespace after ',' +E23.py:19:10: E231 [*] Missing whitespace after ',' | 19 | def foo() -> None: 20 | #: E231 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap index 8dc96edbd2..723f894708 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E251_E25.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E25.py:2:12: E251 Unexpected spaces around keyword / parameter equals +E25.py:2:12: E251 Unexpected spaces around keyword / parameter equals | 2 | #: E251 E251 3 | def foo(bar = False): @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 5 | pass | -./resources/test/fixtures/pycodestyle/E25.py:2:14: E251 Unexpected spaces around keyword / parameter equals +E25.py:2:14: E251 Unexpected spaces around keyword / parameter equals | 2 | #: E251 E251 3 | def foo(bar = False): @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 5 | pass | -./resources/test/fixtures/pycodestyle/E25.py:6:9: E251 Unexpected spaces around keyword / parameter equals +E25.py:6:9: E251 Unexpected spaces around keyword / parameter equals | 6 | pass 7 | #: E251 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | foo(bar =True) | -./resources/test/fixtures/pycodestyle/E25.py:8:8: E251 Unexpected spaces around keyword / parameter equals +E25.py:8:8: E251 Unexpected spaces around keyword / parameter equals | 8 | foo(bar= True) 9 | #: E251 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 | foo(bar = True) | -./resources/test/fixtures/pycodestyle/E25.py:10:8: E251 Unexpected spaces around keyword / parameter equals +E25.py:10:8: E251 Unexpected spaces around keyword / parameter equals | 10 | foo(bar =True) 11 | #: E251 E251 @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | y = bar(root= "sdasd") | -./resources/test/fixtures/pycodestyle/E25.py:10:10: E251 Unexpected spaces around keyword / parameter equals +E25.py:10:10: E251 Unexpected spaces around keyword / parameter equals | 10 | foo(bar =True) 11 | #: E251 E251 @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | y = bar(root= "sdasd") | -./resources/test/fixtures/pycodestyle/E25.py:12:14: E251 Unexpected spaces around keyword / parameter equals +E25.py:12:14: E251 Unexpected spaces around keyword / parameter equals | 12 | foo(bar = True) 13 | #: E251 @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 | parser.add_argument('--long-option', | -./resources/test/fixtures/pycodestyle/E25.py:15:29: E251 Unexpected spaces around keyword / parameter equals +E25.py:15:29: E251 Unexpected spaces around keyword / parameter equals | 15 | #: E251:2:29 16 | parser.add_argument('--long-option', @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 | #: E251:1:45 | -./resources/test/fixtures/pycodestyle/E25.py:18:45: E251 Unexpected spaces around keyword / parameter equals +E25.py:18:45: E251 Unexpected spaces around keyword / parameter equals | 18 | "/rather/long/filesystem/path/here/blah/blah/blah") 19 | #: E251:1:45 @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 | #: E251:3:8 E251:3:10 | -./resources/test/fixtures/pycodestyle/E25.py:23:8: E251 Unexpected spaces around keyword / parameter equals +E25.py:23:8: E251 Unexpected spaces around keyword / parameter equals | 23 | foo(True, 24 | baz=(1, 2), @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 27 | #: Okay | -./resources/test/fixtures/pycodestyle/E25.py:23:10: E251 Unexpected spaces around keyword / parameter equals +E25.py:23:10: E251 Unexpected spaces around keyword / parameter equals | 23 | foo(True, 24 | baz=(1, 2), diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap index d2721b0981..00acfa92e6 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E252_E25.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E25.py:46:15: E252 Missing whitespace around parameter equals +E25.py:46:15: E252 Missing whitespace around parameter equals | 46 | return a + b 47 | #: E252:1:15 E252:1:16 E252:1:27 E252:1:36 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 50 | #: Okay | -./resources/test/fixtures/pycodestyle/E25.py:46:16: E252 Missing whitespace around parameter equals +E25.py:46:16: E252 Missing whitespace around parameter equals | 46 | return a + b 47 | #: E252:1:15 E252:1:16 E252:1:27 E252:1:36 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 50 | #: Okay | -./resources/test/fixtures/pycodestyle/E25.py:46:27: E252 Missing whitespace around parameter equals +E25.py:46:27: E252 Missing whitespace around parameter equals | 46 | return a + b 47 | #: E252:1:15 E252:1:16 E252:1:27 E252:1:36 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 50 | #: Okay | -./resources/test/fixtures/pycodestyle/E25.py:46:36: E252 Missing whitespace around parameter equals +E25.py:46:36: E252 Missing whitespace around parameter equals | 46 | return a + b 47 | #: E252:1:15 E252:1:16 E252:1:27 E252:1:36 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap index 83de218594..dc946334ed 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E261_E26.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E26.py:2:5: E261 Insert at least two spaces before an inline comment +E26.py:2:5: E261 Insert at least two spaces before an inline comment | 2 | #: E261:1:5 3 | pass # an inline comment diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap index 231e76010f..36c1bd5be8 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E262_E26.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E26.py:4:12: E262 Inline comment should start with `# ` +E26.py:4:12: E262 Inline comment should start with `# ` | 4 | pass # an inline comment 5 | #: E262:1:12 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | x = x + 1 # Increment x | -./resources/test/fixtures/pycodestyle/E26.py:6:12: E262 Inline comment should start with `# ` +E26.py:6:12: E262 Inline comment should start with `# ` | 6 | x = x + 1 #Increment x 7 | #: E262:1:12 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | x = y + 1 #: Increment x | -./resources/test/fixtures/pycodestyle/E26.py:8:12: E262 Inline comment should start with `# ` +E26.py:8:12: E262 Inline comment should start with `# ` | 8 | x = x + 1 # Increment x 9 | #: E262:1:12 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 | #Block comment | -./resources/test/fixtures/pycodestyle/E26.py:63:9: E262 Inline comment should start with `# ` +E26.py:63:9: E262 Inline comment should start with `# ` | 63 | # -*- coding: utf8 -*- 64 | #  (One space one NBSP) Ok for block comment @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 67 | # (Two spaces) Ok for block comment | -./resources/test/fixtures/pycodestyle/E26.py:66:9: E262 Inline comment should start with `# ` +E26.py:66:9: E262 Inline comment should start with `# ` | 66 | #: E262:2:9 67 | # (Two spaces) Ok for block comment diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap index 073552853d..72764afcb3 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E265_E26.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E26.py:10:1: E265 Block comment should start with `# ` +E26.py:10:1: E265 Block comment should start with `# ` | 10 | x = y + 1 #: Increment x 11 | #: E265:1:1 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | #: E265:2:1 | -./resources/test/fixtures/pycodestyle/E26.py:14:1: E265 Block comment should start with `# ` +E26.py:14:1: E265 Block comment should start with `# ` | 14 | #: E265:2:1 15 | m = 42 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 18 | #: E266:3:5 E266:6:5 | -./resources/test/fixtures/pycodestyle/E26.py:25:1: E265 Block comment should start with `# ` +E26.py:25:1: E265 Block comment should start with `# ` | 25 | return 26 | #: E265:1:1 E266:2:1 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 29 | #: W291:1:42 | -./resources/test/fixtures/pycodestyle/E26.py:32:1: E265 Block comment should start with `# ` +E26.py:32:1: E265 Block comment should start with `# ` | 32 | #: Okay 33 | #!/usr/bin/env python diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap index 276bad481a..4ecd7f71f7 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E266_E26.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E26.py:19:5: E266 Too many leading `#` before block comment +E26.py:19:5: E266 Too many leading `#` before block comment | 19 | def how_it_feel(r): 20 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 | a = 42 | -./resources/test/fixtures/pycodestyle/E26.py:22:5: E266 Too many leading `#` before block comment +E26.py:22:5: E266 Too many leading `#` before block comment | 22 | a = 42 23 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 26 | #: E265:1:1 E266:2:1 | -./resources/test/fixtures/pycodestyle/E26.py:26:1: E266 Too many leading `#` before block comment +E26.py:26:1: E266 Too many leading `#` before block comment | 26 | #: E265:1:1 E266:2:1 27 | ##if DEBUG: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap index bb2042f924..b05c7d68b0 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E271_E27.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E27.py:4:9: E271 Multiple spaces after keyword +E27.py:4:9: E271 Multiple spaces after keyword | 4 | True and False 5 | #: E271 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | True and False | -./resources/test/fixtures/pycodestyle/E27.py:6:5: E271 Multiple spaces after keyword +E27.py:6:5: E271 Multiple spaces after keyword | 6 | True and False 7 | #: E272 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | if 1: | -./resources/test/fixtures/pycodestyle/E27.py:8:3: E271 Multiple spaces after keyword +E27.py:8:3: E271 Multiple spaces after keyword | 8 | True and False 9 | #: E271 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 | True and False | -./resources/test/fixtures/pycodestyle/E27.py:14:6: E271 Multiple spaces after keyword +E27.py:14:6: E271 Multiple spaces after keyword | 14 | True and False 15 | #: E271 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 18 | 1 and b | -./resources/test/fixtures/pycodestyle/E27.py:16:6: E271 Multiple spaces after keyword +E27.py:16:6: E271 Multiple spaces after keyword | 16 | a and b 17 | #: E271 @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 20 | a and 2 | -./resources/test/fixtures/pycodestyle/E27.py:18:6: E271 Multiple spaces after keyword +E27.py:18:6: E271 Multiple spaces after keyword | 18 | 1 and b 19 | #: E271 @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 | 1 and b | -./resources/test/fixtures/pycodestyle/E27.py:20:7: E271 Multiple spaces after keyword +E27.py:20:7: E271 Multiple spaces after keyword | 20 | a and 2 21 | #: E271 E272 @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 24 | a and 2 | -./resources/test/fixtures/pycodestyle/E27.py:22:7: E271 Multiple spaces after keyword +E27.py:22:7: E271 Multiple spaces after keyword | 22 | 1 and b 23 | #: E271 E272 @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 26 | this and False | -./resources/test/fixtures/pycodestyle/E27.py:35:14: E271 Multiple spaces after keyword +E27.py:35:14: E271 Multiple spaces after keyword | 35 | from v import c, d 36 | #: E271 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap index 0e79420870..fa61e8f61f 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E272_E27.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E27.py:20:2: E272 Multiple spaces before keyword +E27.py:20:2: E272 Multiple spaces before keyword | 20 | a and 2 21 | #: E271 E272 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 24 | a and 2 | -./resources/test/fixtures/pycodestyle/E27.py:22:2: E272 Multiple spaces before keyword +E27.py:22:2: E272 Multiple spaces before keyword | 22 | 1 and b 23 | #: E271 E272 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 26 | this and False | -./resources/test/fixtures/pycodestyle/E27.py:24:5: E272 Multiple spaces before keyword +E27.py:24:5: E272 Multiple spaces before keyword | 24 | a and 2 25 | #: E272 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap index ef8a952f38..9fefdace97 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E273_E27.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E27.py:10:9: E273 Tab after keyword +E27.py:10:9: E273 Tab after keyword | 10 | if 1: 11 | #: E273 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | True and False | -./resources/test/fixtures/pycodestyle/E27.py:12:5: E273 Tab after keyword +E27.py:12:5: E273 Tab after keyword | 12 | True and False 13 | #: E273 E274 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 | a and b | -./resources/test/fixtures/pycodestyle/E27.py:12:10: E273 Tab after keyword +E27.py:12:10: E273 Tab after keyword | 12 | True and False 13 | #: E273 E274 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 | a and b | -./resources/test/fixtures/pycodestyle/E27.py:26:6: E273 Tab after keyword +E27.py:26:6: E273 Tab after keyword | 26 | this and False 27 | #: E273 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 30 | a and b | -./resources/test/fixtures/pycodestyle/E27.py:30:10: E273 Tab after keyword +E27.py:30:10: E273 Tab after keyword | 30 | a and b 31 | #: E273 E274 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap index 01e697666d..9adc314ea5 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E274_E27.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E27.py:28:3: E274 Tab before keyword +E27.py:28:3: E274 Tab before keyword | 28 | a and b 29 | #: E274 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 32 | this and False | -./resources/test/fixtures/pycodestyle/E27.py:30:6: E274 Tab before keyword +E27.py:30:6: E274 Tab before keyword | 30 | a and b 31 | #: E273 E274 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap index e2a448538b..fa43f95e73 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E275_E27.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E27.py:37:14: E275 Missing whitespace after keyword +E27.py:37:14: E275 Missing whitespace after keyword | 37 | from w import (e, f) 38 | #: E275 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 41 | from importable.module import(e, f) | -./resources/test/fixtures/pycodestyle/E27.py:39:30: E275 Missing whitespace after keyword +E27.py:39:30: E275 Missing whitespace after keyword | 39 | from w import(e, f) 40 | #: E275 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 43 | try: | -./resources/test/fixtures/pycodestyle/E27.py:42:34: E275 Missing whitespace after keyword +E27.py:42:34: E275 Missing whitespace after keyword | 42 | #: E275 43 | try: @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 46 | pass | -./resources/test/fixtures/pycodestyle/E27.py:46:3: E275 Missing whitespace after keyword +E27.py:46:3: E275 Missing whitespace after keyword | 46 | pass 47 | #: E275 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 50 | else: | -./resources/test/fixtures/pycodestyle/E27.py:54:11: E275 Missing whitespace after keyword +E27.py:54:11: E275 Missing whitespace after keyword | 54 | #: E275:2:11 55 | if True: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap index 3090be136c..83759996d6 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E401_E40.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E40.py:2:1: E401 Multiple imports on one line +E40.py:2:1: E401 Multiple imports on one line | 2 | #: E401 3 | import os, sys diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap index 1b2f010475..e664cb5812 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E40.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E40.py:55:1: E402 Module level import not at top of file +E40.py:55:1: E402 Module level import not at top of file | 55 | VERSION = '1.2.3' 56 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 59 | import foo | -./resources/test/fixtures/pycodestyle/E40.py:57:1: E402 Module level import not at top of file +E40.py:57:1: E402 Module level import not at top of file | 57 | import foo 58 | #: E402 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 61 | a = 1 | -./resources/test/fixtures/pycodestyle/E40.py:61:1: E402 Module level import not at top of file +E40.py:61:1: E402 Module level import not at top of file | 61 | a = 1 62 | diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap index bfe96cd579..c5ab26ba38 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E402_E402.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E402.py:24:1: E402 Module level import not at top of file +E402.py:24:1: E402 Module level import not at top of file | 24 | y = x + 1 25 | diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap index fe3f08f767..b90b05b2e9 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E501_E501.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E501.py:5:89: E501 Line too long (123 > 88 characters) +E501.py:5:89: E501 Line too long (123 > 88 characters) | 5 | https://github.com/PyCQA/pycodestyle/pull/258/files#diff-841c622497a8033d10152bfdfb15b20b92437ecdea21a260944ea86b77b51533 6 | @@ -10,14 +10,14 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | """ | -./resources/test/fixtures/pycodestyle/E501.py:16:89: E501 Line too long (95 > 88 characters) +E501.py:16:89: E501 Line too long (95 > 88 characters) | 16 | _ = "---------------------------------------------------------------------------AAAAAAA" 17 | _ = "---------------------------------------------------------------------------亜亜亜亜亜亜亜" | E501 | -./resources/test/fixtures/pycodestyle/E501.py:25:89: E501 Line too long (127 > 88 characters) +E501.py:25:89: E501 Line too long (127 > 88 characters) | 25 | caller( 26 | """ @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 29 | ) | -./resources/test/fixtures/pycodestyle/E501.py:40:89: E501 Line too long (132 > 88 characters) +E501.py:40:89: E501 Line too long (132 > 88 characters) | 40 | "Lorem ipsum dolor": "sit amet", 41 | # E501 Line too long @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 44 | "Lorem ipsum dolor": """ | -./resources/test/fixtures/pycodestyle/E501.py:43:89: E501 Line too long (105 > 88 characters) +E501.py:43:89: E501 Line too long (105 > 88 characters) | 43 | # E501 Line too long 44 | "Lorem ipsum dolor": """ @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 47 | # OK | -./resources/test/fixtures/pycodestyle/E501.py:83:89: E501 Line too long (147 > 88 characters) +E501.py:83:89: E501 Line too long (147 > 88 characters) | 83 | class Bar: 84 | """ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap index 836f2198a2..e4a0a648eb 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E701_E70.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E70.py:2:5: E701 Multiple statements on one line (colon) +E70.py:2:5: E701 Multiple statements on one line (colon) | 2 | #: E701:1:5 3 | if a: a = False @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 5 | if not header or header[:6] != 'bytes=': return | -./resources/test/fixtures/pycodestyle/E70.py:4:40: E701 Multiple statements on one line (colon) +E70.py:4:40: E701 Multiple statements on one line (colon) | 4 | if a: a = False 5 | #: E701:1:40 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | a = False; b = True | -./resources/test/fixtures/pycodestyle/E70.py:25:8: E701 Multiple statements on one line (colon) +E70.py:25:8: E701 Multiple statements on one line (colon) | 25 | def f(x): return 2*x 26 | #: E704:1:8 E702:1:11 E703:1:14 @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 29 | if True: lambda a: b | -./resources/test/fixtures/pycodestyle/E70.py:27:8: E701 Multiple statements on one line (colon) +E70.py:27:8: E701 Multiple statements on one line (colon) | 27 | if True: x; y; 28 | #: E701:1:8 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 31 | if a := 1: pass | -./resources/test/fixtures/pycodestyle/E70.py:29:10: E701 Multiple statements on one line (colon) +E70.py:29:10: E701 Multiple statements on one line (colon) | 29 | if True: lambda a: b 30 | #: E701:1:10 @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 33 | try: lambda foo: bar | -./resources/test/fixtures/pycodestyle/E70.py:31:4: E701 Multiple statements on one line (colon) +E70.py:31:4: E701 Multiple statements on one line (colon) | 31 | if a := 1: pass 32 | # E701:1:4 E701:2:18 E701:3:8 @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 35 | finally: pass | -./resources/test/fixtures/pycodestyle/E70.py:32:18: E701 Multiple statements on one line (colon) +E70.py:32:18: E701 Multiple statements on one line (colon) | 32 | # E701:1:4 E701:2:18 E701:3:8 33 | try: lambda foo: bar @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 36 | # E701:1:7 | -./resources/test/fixtures/pycodestyle/E70.py:33:8: E701 Multiple statements on one line (colon) +E70.py:33:8: E701 Multiple statements on one line (colon) | 33 | try: lambda foo: bar 34 | except ValueError: pass @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 37 | class C: pass | -./resources/test/fixtures/pycodestyle/E70.py:35:8: E701 Multiple statements on one line (colon) +E70.py:35:8: E701 Multiple statements on one line (colon) | 35 | finally: pass 36 | # E701:1:7 @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 39 | with C(): pass | -./resources/test/fixtures/pycodestyle/E70.py:37:9: E701 Multiple statements on one line (colon) +E70.py:37:9: E701 Multiple statements on one line (colon) | 37 | class C: pass 38 | # E701:1:7 @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 41 | async with C(): pass | -./resources/test/fixtures/pycodestyle/E70.py:39:15: E701 Multiple statements on one line (colon) +E70.py:39:15: E701 Multiple statements on one line (colon) | 39 | with C(): pass 40 | # E701:1:14 @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 43 | lambda a: b | -./resources/test/fixtures/pycodestyle/E70.py:54:8: E701 Multiple statements on one line (colon) +E70.py:54:8: E701 Multiple statements on one line (colon) | 54 | def f(): ... 55 | #: E701:1:8 E702:1:13 @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 58 | class C: ...; ... | -./resources/test/fixtures/pycodestyle/E70.py:56:8: E701 Multiple statements on one line (colon) +E70.py:56:8: E701 Multiple statements on one line (colon) | 56 | class C: ...; x = 1 57 | #: E701:1:8 E702:1:13 @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 60 | match *0, 1, *2: | -./resources/test/fixtures/pycodestyle/E70.py:59:12: E701 Multiple statements on one line (colon) +E70.py:59:12: E701 Multiple statements on one line (colon) | 59 | #: E701:2:12 60 | match *0, 1, *2: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap index 49ef93000c..14829a91be 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E702_E70.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E70.py:6:10: E702 Multiple statements on one line (semicolon) +E70.py:6:10: E702 Multiple statements on one line (semicolon) | 6 | if not header or header[:6] != 'bytes=': return 7 | #: E702:1:10 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe) | -./resources/test/fixtures/pycodestyle/E70.py:8:17: E702 Multiple statements on one line (semicolon) +E70.py:8:17: E702 Multiple statements on one line (semicolon) | 8 | a = False; b = True 9 | #: E702:1:17 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 | import shlex; | -./resources/test/fixtures/pycodestyle/E70.py:12:9: E702 Multiple statements on one line (semicolon) +E70.py:12:9: E702 Multiple statements on one line (semicolon) | 12 | import shlex; 13 | #: E702:1:9 E703:1:23 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 | def f(x): return 2 | -./resources/test/fixtures/pycodestyle/E70.py:25:11: E702 Multiple statements on one line (semicolon) +E70.py:25:11: E702 Multiple statements on one line (semicolon) | 25 | def f(x): return 2*x 26 | #: E704:1:8 E702:1:11 E703:1:14 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 29 | if True: lambda a: b | -./resources/test/fixtures/pycodestyle/E70.py:54:13: E702 Multiple statements on one line (semicolon) +E70.py:54:13: E702 Multiple statements on one line (semicolon) | 54 | def f(): ... 55 | #: E701:1:8 E702:1:13 @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 58 | class C: ...; ... | -./resources/test/fixtures/pycodestyle/E70.py:56:13: E702 Multiple statements on one line (semicolon) +E70.py:56:13: E702 Multiple statements on one line (semicolon) | 56 | class C: ...; x = 1 57 | #: E701:1:8 E702:1:13 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap index 864c4bce8d..29be404d52 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E703_E70.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E70.py:10:13: E703 [*] Statement ends with an unnecessary semicolon +E70.py:10:13: E703 [*] Statement ends with an unnecessary semicolon | 10 | import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe) 11 | #: E703:1:13 @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 12 | del a[:]; a.append(42); 13 13 | #: E704:1:1 -./resources/test/fixtures/pycodestyle/E70.py:12:23: E703 [*] Statement ends with an unnecessary semicolon +E70.py:12:23: E703 [*] Statement ends with an unnecessary semicolon | 12 | import shlex; 13 | #: E702:1:9 E703:1:23 @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 14 | def f(x): return 2 15 15 | #: E704:1:1 -./resources/test/fixtures/pycodestyle/E70.py:25:14: E703 [*] Statement ends with an unnecessary semicolon +E70.py:25:14: E703 [*] Statement ends with an unnecessary semicolon | 25 | def f(x): return 2*x 26 | #: E704:1:8 E702:1:11 E703:1:14 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap index 83a5103d92..fa627b13ca 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E711_E711.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E711.py:2:11: E711 [*] Comparison to `None` should be `cond is None` +E711.py:2:11: E711 [*] Comparison to `None` should be `cond is None` | 2 | #: E711 3 | if res == None: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | #: E711 5 5 | if res != None: -./resources/test/fixtures/pycodestyle/E711.py:5:11: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:5:11: E711 [*] Comparison to `None` should be `cond is not None` | 5 | pass 6 | #: E711 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 7 | #: E711 8 8 | if None == res: -./resources/test/fixtures/pycodestyle/E711.py:8:4: E711 [*] Comparison to `None` should be `cond is None` +E711.py:8:4: E711 [*] Comparison to `None` should be `cond is None` | 8 | pass 9 | #: E711 @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 10 | #: E711 11 11 | if None != res: -./resources/test/fixtures/pycodestyle/E711.py:11:4: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:11:4: E711 [*] Comparison to `None` should be `cond is not None` | 11 | pass 12 | #: E711 @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 13 | #: E711 14 14 | if res[1] == None: -./resources/test/fixtures/pycodestyle/E711.py:14:14: E711 [*] Comparison to `None` should be `cond is None` +E711.py:14:14: E711 [*] Comparison to `None` should be `cond is None` | 14 | pass 15 | #: E711 @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 16 | #: E711 17 17 | if res[1] != None: -./resources/test/fixtures/pycodestyle/E711.py:17:14: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:17:14: E711 [*] Comparison to `None` should be `cond is not None` | 17 | pass 18 | #: E711 @@ -124,7 +124,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 19 | #: E711 20 20 | if None != res[1]: -./resources/test/fixtures/pycodestyle/E711.py:20:4: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:20:4: E711 [*] Comparison to `None` should be `cond is not None` | 20 | pass 21 | #: E711 @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 22 | #: E711 23 23 | if None == res[1]: -./resources/test/fixtures/pycodestyle/E711.py:23:4: E711 [*] Comparison to `None` should be `cond is None` +E711.py:23:4: E711 [*] Comparison to `None` should be `cond is None` | 23 | pass 24 | #: E711 @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 25 25 | 26 26 | if x == None != None: -./resources/test/fixtures/pycodestyle/E711.py:26:9: E711 [*] Comparison to `None` should be `cond is None` +E711.py:26:9: E711 [*] Comparison to `None` should be `cond is None` | 26 | pass 27 | @@ -185,7 +185,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 28 28 | 29 29 | #: Okay -./resources/test/fixtures/pycodestyle/E711.py:26:17: E711 [*] Comparison to `None` should be `cond is not None` +E711.py:26:17: E711 [*] Comparison to `None` should be `cond is not None` | 26 | pass 27 | diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap index b3ead61e7a..7571cf1aec 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E712_E712.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E712.py:2:11: E712 [*] Comparison to `True` should be `cond is True` +E712.py:2:11: E712 [*] Comparison to `True` should be `cond is True` | 2 | #: E712 3 | if res == True: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | #: E712 5 5 | if res != False: -./resources/test/fixtures/pycodestyle/E712.py:5:11: E712 [*] Comparison to `False` should be `cond is not False` +E712.py:5:11: E712 [*] Comparison to `False` should be `cond is not False` | 5 | pass 6 | #: E712 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 7 | #: E712 8 8 | if True != res: -./resources/test/fixtures/pycodestyle/E712.py:8:4: E712 [*] Comparison to `True` should be `cond is not True` +E712.py:8:4: E712 [*] Comparison to `True` should be `cond is not True` | 8 | pass 9 | #: E712 @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 10 | #: E712 11 11 | if False == res: -./resources/test/fixtures/pycodestyle/E712.py:11:4: E712 [*] Comparison to `False` should be `cond is False` +E712.py:11:4: E712 [*] Comparison to `False` should be `cond is False` | 11 | pass 12 | #: E712 @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 13 | #: E712 14 14 | if res[1] == True: -./resources/test/fixtures/pycodestyle/E712.py:14:14: E712 [*] Comparison to `True` should be `cond is True` +E712.py:14:14: E712 [*] Comparison to `True` should be `cond is True` | 14 | pass 15 | #: E712 @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 16 | #: E712 17 17 | if res[1] != False: -./resources/test/fixtures/pycodestyle/E712.py:17:14: E712 [*] Comparison to `False` should be `cond is not False` +E712.py:17:14: E712 [*] Comparison to `False` should be `cond is not False` | 17 | pass 18 | #: E712 @@ -124,7 +124,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 19 | #: E712 20 20 | var = 1 if cond == True else -1 if cond == False else cond -./resources/test/fixtures/pycodestyle/E712.py:20:20: E712 [*] Comparison to `True` should be `cond is True` +E712.py:20:20: E712 [*] Comparison to `True` should be `cond is True` | 20 | pass 21 | #: E712 @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 22 | if (True) == TrueElement or x == TrueElement: 23 23 | pass -./resources/test/fixtures/pycodestyle/E712.py:20:44: E712 [*] Comparison to `False` should be `cond is False` +E712.py:20:44: E712 [*] Comparison to `False` should be `cond is False` | 20 | pass 21 | #: E712 @@ -166,7 +166,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 22 | if (True) == TrueElement or x == TrueElement: 23 23 | pass -./resources/test/fixtures/pycodestyle/E712.py:22:5: E712 [*] Comparison to `True` should be `cond is True` +E712.py:22:5: E712 [*] Comparison to `True` should be `cond is True` | 22 | var = 1 if cond == True else -1 if cond == False else cond 23 | #: E712 @@ -186,7 +186,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 24 24 | 25 25 | if res == True != False: -./resources/test/fixtures/pycodestyle/E712.py:25:11: E712 [*] Comparison to `True` should be `cond is True` +E712.py:25:11: E712 [*] Comparison to `True` should be `cond is True` | 25 | pass 26 | @@ -206,7 +206,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 27 27 | 28 28 | #: Okay -./resources/test/fixtures/pycodestyle/E712.py:25:19: E712 [*] Comparison to `False` should be `cond is not False` +E712.py:25:19: E712 [*] Comparison to `False` should be `cond is not False` | 25 | pass 26 | diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap index b24ccafa95..3bd94f9519 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E713_E713.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E713.py:2:8: E713 [*] Test for membership should be `not in` +E713.py:2:8: E713 [*] Test for membership should be `not in` | 2 | #: E713 3 | if not X in Y: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | #: E713 5 5 | if not X.B in Y: -./resources/test/fixtures/pycodestyle/E713.py:5:8: E713 [*] Test for membership should be `not in` +E713.py:5:8: E713 [*] Test for membership should be `not in` | 5 | pass 6 | #: E713 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 7 | #: E713 8 8 | if not X in Y and Z == "zero": -./resources/test/fixtures/pycodestyle/E713.py:8:8: E713 [*] Test for membership should be `not in` +E713.py:8:8: E713 [*] Test for membership should be `not in` | 8 | pass 9 | #: E713 @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 10 | #: E713 11 11 | if X == "zero" or not Y in Z: -./resources/test/fixtures/pycodestyle/E713.py:11:23: E713 [*] Test for membership should be `not in` +E713.py:11:23: E713 [*] Test for membership should be `not in` | 11 | pass 12 | #: E713 @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 13 | #: E713 14 14 | if not (X in Y): -./resources/test/fixtures/pycodestyle/E713.py:14:9: E713 [*] Test for membership should be `not in` +E713.py:14:9: E713 [*] Test for membership should be `not in` | 14 | pass 15 | #: E713 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap index dd86ab367b..aa9105a4ce 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E714_E714.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E714.py:2:8: E714 [*] Test for object identity should be `is not` +E714.py:2:8: E714 [*] Test for object identity should be `is not` | 2 | #: E714 3 | if not X is Y: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | #: E714 5 5 | if not X.B is Y: -./resources/test/fixtures/pycodestyle/E714.py:5:8: E714 [*] Test for object identity should be `is not` +E714.py:5:8: E714 [*] Test for object identity should be `is not` | 5 | pass 6 | #: E714 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 7 | #: E714 8 8 | if not X is Y is not Z: -./resources/test/fixtures/pycodestyle/E714.py:8:8: E714 [*] Test for object identity should be `is not` +E714.py:8:8: E714 [*] Test for object identity should be `is not` | 8 | pass 9 | #: E714 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap index 98178b8e48..823a524349 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E721_E721.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E721.py:2:4: E721 Do not compare types, use `isinstance()` +E721.py:2:4: E721 Do not compare types, use `isinstance()` | 2 | #: E721 3 | if type(res) == type(42): @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 5 | #: E721 | -./resources/test/fixtures/pycodestyle/E721.py:5:4: E721 Do not compare types, use `isinstance()` +E721.py:5:4: E721 Do not compare types, use `isinstance()` | 5 | pass 6 | #: E721 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 9 | #: E721 | -./resources/test/fixtures/pycodestyle/E721.py:10:4: E721 Do not compare types, use `isinstance()` +E721.py:10:4: E721 Do not compare types, use `isinstance()` | 10 | import types 11 | @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | #: E721 | -./resources/test/fixtures/pycodestyle/E721.py:15:4: E721 Do not compare types, use `isinstance()` +E721.py:15:4: E721 Do not compare types, use `isinstance()` | 15 | import types 16 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 | #: E721 | -./resources/test/fixtures/pycodestyle/E721.py:18:8: E721 Do not compare types, use `isinstance()` +E721.py:18:8: E721 Do not compare types, use `isinstance()` | 18 | pass 19 | #: E721 @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 22 | assert type(res) == type([]) | -./resources/test/fixtures/pycodestyle/E721.py:20:8: E721 Do not compare types, use `isinstance()` +E721.py:20:8: E721 Do not compare types, use `isinstance()` | 20 | assert type(res) == type(False) 21 | #: E721 @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 24 | assert type(res) == type(()) | -./resources/test/fixtures/pycodestyle/E721.py:22:8: E721 Do not compare types, use `isinstance()` +E721.py:22:8: E721 Do not compare types, use `isinstance()` | 22 | assert type(res) == type([]) 23 | #: E721 @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 26 | assert type(res) == type((0,)) | -./resources/test/fixtures/pycodestyle/E721.py:24:8: E721 Do not compare types, use `isinstance()` +E721.py:24:8: E721 Do not compare types, use `isinstance()` | 24 | assert type(res) == type(()) 25 | #: E721 @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 28 | assert type(res) == type((0)) | -./resources/test/fixtures/pycodestyle/E721.py:26:8: E721 Do not compare types, use `isinstance()` +E721.py:26:8: E721 Do not compare types, use `isinstance()` | 26 | assert type(res) == type((0,)) 27 | #: E721 @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 30 | assert type(res) != type((1,)) | -./resources/test/fixtures/pycodestyle/E721.py:28:8: E721 Do not compare types, use `isinstance()` +E721.py:28:8: E721 Do not compare types, use `isinstance()` | 28 | assert type(res) == type((0)) 29 | #: E721 @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 32 | assert type(res) is type((1,)) | -./resources/test/fixtures/pycodestyle/E721.py:30:8: E721 Do not compare types, use `isinstance()` +E721.py:30:8: E721 Do not compare types, use `isinstance()` | 30 | assert type(res) != type((1,)) 31 | #: E721 @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 34 | assert type(res) is not type((1,)) | -./resources/test/fixtures/pycodestyle/E721.py:32:8: E721 Do not compare types, use `isinstance()` +E721.py:32:8: E721 Do not compare types, use `isinstance()` | 32 | assert type(res) is type((1,)) 33 | #: E721 @@ -120,7 +120,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 36 | assert type(res) == type( | -./resources/test/fixtures/pycodestyle/E721.py:34:8: E721 Do not compare types, use `isinstance()` +E721.py:34:8: E721 Do not compare types, use `isinstance()` | 34 | assert type(res) is not type((1,)) 35 | #: E211 E721 @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 42 | assert type(res) == type(()) | -./resources/test/fixtures/pycodestyle/E721.py:40:8: E721 Do not compare types, use `isinstance()` +E721.py:40:8: E721 Do not compare types, use `isinstance()` | 40 | ) 41 | #: E201 E201 E202 E721 @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 44 | assert type(res) == type((0,)) | -./resources/test/fixtures/pycodestyle/E721.py:42:8: E721 Do not compare types, use `isinstance()` +E721.py:42:8: E721 Do not compare types, use `isinstance()` | 42 | assert type(res) == type(()) 43 | #: E201 E202 E721 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap index 1ded6b3579..d6c27bf102 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E722_E722.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E722.py:4:1: E722 Do not use bare `except` +E722.py:4:1: E722 Do not use bare `except` | 4 | try: 5 | pass @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | #: E722 | -./resources/test/fixtures/pycodestyle/E722.py:11:1: E722 Do not use bare `except` +E722.py:11:1: E722 Do not use bare `except` | 11 | except Exception: 12 | pass @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 15 | #: E722 | -./resources/test/fixtures/pycodestyle/E722.py:16:1: E722 Do not use bare `except` +E722.py:16:1: E722 Do not use bare `except` | 16 | try: 17 | pass diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap index 31f6dcb242..17f548b703 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E731_E731.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E731.py:2:1: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:2:1: E731 [*] Do not assign a `lambda` expression, use a `def` | 2 | #: E731 3 | f = lambda x: 2 * x @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 5 | f = lambda x: 2 * x 5 6 | #: E731 -./resources/test/fixtures/pycodestyle/E731.py:4:1: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:4:1: E731 [*] Do not assign a `lambda` expression, use a `def` | 4 | f = lambda x: 2 * x 5 | #: E731 @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 6 7 | while False: 7 8 | this = lambda y, z: 2 * x -./resources/test/fixtures/pycodestyle/E731.py:7:5: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:7:5: E731 [*] Do not assign a `lambda` expression, use a `def` | 7 | #: E731 8 | while False: @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 9 10 | f = lambda: (yield 1) 10 11 | #: E731 -./resources/test/fixtures/pycodestyle/E731.py:9:1: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:9:1: E731 [*] Do not assign a `lambda` expression, use a `def` | 9 | this = lambda y, z: 2 * x 10 | #: E731 @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 11 12 | f = lambda: (yield from g()) 12 13 | #: E731 -./resources/test/fixtures/pycodestyle/E731.py:11:1: E731 [*] Do not assign a `lambda` expression, use a `def` +E731.py:11:1: E731 [*] Do not assign a `lambda` expression, use a `def` | 11 | f = lambda: (yield 1) 12 | #: E731 @@ -108,7 +108,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 14 | class F: 14 15 | f = lambda x: 2 * x -./resources/test/fixtures/pycodestyle/E731.py:14:5: E731 Do not assign a `lambda` expression, use a `def` +E731.py:14:5: E731 Do not assign a `lambda` expression, use a `def` | 14 | #: E731 15 | class F: diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap index 88b03f96de..5e49cc4d68 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E741_E741.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E741.py:3:1: E741 Ambiguous variable name: `l` +E741.py:3:1: E741 Ambiguous variable name: `l` | 3 | from contextlib import contextmanager 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 | O = 0 | -./resources/test/fixtures/pycodestyle/E741.py:4:1: E741 Ambiguous variable name: `I` +E741.py:4:1: E741 Ambiguous variable name: `I` | 4 | l = 0 5 | I = 0 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 | l: int = 0 | -./resources/test/fixtures/pycodestyle/E741.py:5:1: E741 Ambiguous variable name: `O` +E741.py:5:1: E741 Ambiguous variable name: `O` | 5 | l = 0 6 | I = 0 @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | l: int = 0 | -./resources/test/fixtures/pycodestyle/E741.py:6:1: E741 Ambiguous variable name: `l` +E741.py:6:1: E741 Ambiguous variable name: `l` | 6 | I = 0 7 | O = 0 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 | a, l = 0, 1 | -./resources/test/fixtures/pycodestyle/E741.py:8:4: E741 Ambiguous variable name: `l` +E741.py:8:4: E741 Ambiguous variable name: `l` | 8 | l: int = 0 9 | @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 | a, *l = 0, 1, 2 | -./resources/test/fixtures/pycodestyle/E741.py:9:5: E741 Ambiguous variable name: `l` +E741.py:9:5: E741 Ambiguous variable name: `l` | 9 | a, l = 0, 1 10 | [a, l] = 0, 1 @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 | a = l = 0 | -./resources/test/fixtures/pycodestyle/E741.py:10:5: E741 Ambiguous variable name: `l` +E741.py:10:5: E741 Ambiguous variable name: `l` | 10 | a, l = 0, 1 11 | [a, l] = 0, 1 @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 | a = l = 0 | -./resources/test/fixtures/pycodestyle/E741.py:11:5: E741 Ambiguous variable name: `l` +E741.py:11:5: E741 Ambiguous variable name: `l` | 11 | [a, l] = 0, 1 12 | a, *l = 0, 1, 2 @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 15 | o = 0 | -./resources/test/fixtures/pycodestyle/E741.py:16:5: E741 Ambiguous variable name: `l` +E741.py:16:5: E741 Ambiguous variable name: `l` | 16 | i = 0 17 | @@ -86,14 +86,14 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 19 | pass | -./resources/test/fixtures/pycodestyle/E741.py:20:8: E741 Ambiguous variable name: `l` +E741.py:20:8: E741 Ambiguous variable name: `l` | 20 | for a, l in zip(range(3), range(3)): | ^ E741 21 | pass | -./resources/test/fixtures/pycodestyle/E741.py:25:12: E741 Ambiguous variable name: `l` +E741.py:25:12: E741 Ambiguous variable name: `l` | 25 | def f1(): 26 | global l @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 27 | l = 0 | -./resources/test/fixtures/pycodestyle/E741.py:26:5: E741 Ambiguous variable name: `l` +E741.py:26:5: E741 Ambiguous variable name: `l` | 26 | def f1(): 27 | global l @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs | ^ E741 | -./resources/test/fixtures/pycodestyle/E741.py:30:5: E741 Ambiguous variable name: `l` +E741.py:30:5: E741 Ambiguous variable name: `l` | 30 | def f2(): 31 | l = 0 @@ -118,7 +118,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 33 | def f3(): | -./resources/test/fixtures/pycodestyle/E741.py:33:18: E741 Ambiguous variable name: `l` +E741.py:33:18: E741 Ambiguous variable name: `l` | 33 | def f3(): 34 | nonlocal l @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 35 | l = 1 | -./resources/test/fixtures/pycodestyle/E741.py:34:9: E741 Ambiguous variable name: `l` +E741.py:34:9: E741 Ambiguous variable name: `l` | 34 | def f3(): 35 | nonlocal l @@ -136,63 +136,63 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 38 | f3() | -./resources/test/fixtures/pycodestyle/E741.py:40:8: E741 Ambiguous variable name: `l` +E741.py:40:8: E741 Ambiguous variable name: `l` | 40 | def f4(l, /, I): | ^ E741 41 | return l, I, O | -./resources/test/fixtures/pycodestyle/E741.py:40:14: E741 Ambiguous variable name: `I` +E741.py:40:14: E741 Ambiguous variable name: `I` | 40 | def f4(l, /, I): | ^ E741 41 | return l, I, O | -./resources/test/fixtures/pycodestyle/E741.py:44:8: E741 Ambiguous variable name: `l` +E741.py:44:8: E741 Ambiguous variable name: `l` | 44 | def f5(l=0, *, I=1): | ^ E741 45 | return l, I | -./resources/test/fixtures/pycodestyle/E741.py:44:16: E741 Ambiguous variable name: `I` +E741.py:44:16: E741 Ambiguous variable name: `I` | 44 | def f5(l=0, *, I=1): | ^ E741 45 | return l, I | -./resources/test/fixtures/pycodestyle/E741.py:48:9: E741 Ambiguous variable name: `l` +E741.py:48:9: E741 Ambiguous variable name: `l` | 48 | def f6(*l, **I): | ^ E741 49 | return l, I | -./resources/test/fixtures/pycodestyle/E741.py:48:14: E741 Ambiguous variable name: `I` +E741.py:48:14: E741 Ambiguous variable name: `I` | 48 | def f6(*l, **I): | ^ E741 49 | return l, I | -./resources/test/fixtures/pycodestyle/E741.py:57:16: E741 Ambiguous variable name: `l` +E741.py:57:16: E741 Ambiguous variable name: `l` | 57 | with ctx1() as l: | ^ E741 58 | pass | -./resources/test/fixtures/pycodestyle/E741.py:66:20: E741 Ambiguous variable name: `l` +E741.py:66:20: E741 Ambiguous variable name: `l` | 66 | with ctx2() as (a, l): | ^ E741 67 | pass | -./resources/test/fixtures/pycodestyle/E741.py:71:22: E741 Ambiguous variable name: `l` +E741.py:71:22: E741 Ambiguous variable name: `l` | 71 | try: 72 | pass @@ -201,7 +201,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 74 | pass | -./resources/test/fixtures/pycodestyle/E741.py:74:5: E741 Ambiguous variable name: `l` +E741.py:74:5: E741 Ambiguous variable name: `l` | 74 | pass 75 | diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap index b272691c02..7031549d65 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E742_E742.py.snap @@ -1,21 +1,21 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E742.py:1:7: E742 Ambiguous class name: `l` +E742.py:1:7: E742 Ambiguous class name: `l` | 1 | class l: | ^ E742 2 | pass | -./resources/test/fixtures/pycodestyle/E742.py:5:7: E742 Ambiguous class name: `I` +E742.py:5:7: E742 Ambiguous class name: `I` | 5 | class I: | ^ E742 6 | pass | -./resources/test/fixtures/pycodestyle/E742.py:9:7: E742 Ambiguous class name: `O` +E742.py:9:7: E742 Ambiguous class name: `O` | 9 | class O: | ^ E742 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap index d1ea632821..b28c4f4f9b 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E743_E743.py.snap @@ -1,21 +1,21 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E743.py:1:5: E743 Ambiguous function name: `l` +E743.py:1:5: E743 Ambiguous function name: `l` | 1 | def l(): | ^ E743 2 | pass | -./resources/test/fixtures/pycodestyle/E743.py:5:5: E743 Ambiguous function name: `I` +E743.py:5:5: E743 Ambiguous function name: `I` | 5 | def I(): | ^ E743 6 | pass | -./resources/test/fixtures/pycodestyle/E743.py:10:9: E743 Ambiguous function name: `O` +E743.py:10:9: E743 Ambiguous function name: `O` | 10 | class X: 11 | def O(self): diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap index ff16d25989..3c365978ca 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__E999_E999.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E999.py:3:1: E999 SyntaxError: unindent does not match any outer indentation level +E999.py:3:1: E999 SyntaxError: unindent does not match any outer indentation level | 3 | def x(): 4 | diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap index 12c5373533..fc23f107e6 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W191_W19.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W19.py:3:1: W191 Indentation contains tabs +W19.py:3:1: W191 Indentation contains tabs | 3 | #: W191 4 | if False: @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 6 | #: | -./resources/test/fixtures/pycodestyle/W19.py:9:1: W191 Indentation contains tabs +W19.py:9:1: W191 Indentation contains tabs | 9 | #: W191 10 | y = x == 2 \ @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 | if ( | -./resources/test/fixtures/pycodestyle/W19.py:16:1: W191 Indentation contains tabs +W19.py:16:1: W191 Indentation contains tabs | 16 | ) or 17 | y == 4): @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 20 | if x == 2 \ | -./resources/test/fixtures/pycodestyle/W19.py:21:1: W191 Indentation contains tabs +W19.py:21:1: W191 Indentation contains tabs | 21 | or y > 1 \ 22 | or x == 3: @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 25 | if x == 2 \ | -./resources/test/fixtures/pycodestyle/W19.py:26:1: W191 Indentation contains tabs +W19.py:26:1: W191 Indentation contains tabs | 26 | or y > 1 \ 27 | or x == 3: @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 29 | #: | -./resources/test/fixtures/pycodestyle/W19.py:32:1: W191 Indentation contains tabs +W19.py:32:1: W191 Indentation contains tabs | 32 | if (foo == bar and 33 | baz == bop): @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 36 | if ( | -./resources/test/fixtures/pycodestyle/W19.py:38:1: W191 Indentation contains tabs +W19.py:38:1: W191 Indentation contains tabs | 38 | baz == bop 39 | ): @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 41 | #: | -./resources/test/fixtures/pycodestyle/W19.py:44:1: W191 Indentation contains tabs +W19.py:44:1: W191 Indentation contains tabs | 44 | if start[1] > end_col and not ( 45 | over_indent == 4 and indent_next): @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 48 | #: | -./resources/test/fixtures/pycodestyle/W19.py:45:1: W191 Indentation contains tabs +W19.py:45:1: W191 Indentation contains tabs | 45 | over_indent == 4 and indent_next): 46 | return (0, "E121 continuation line over-" @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 48 | #: | -./resources/test/fixtures/pycodestyle/W19.py:54:1: W191 Indentation contains tabs +W19.py:54:1: W191 Indentation contains tabs | 54 | var_one, var_two, var_three, 55 | var_four): @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 58 | if ((row < 0 or self.moduleCount <= row or | -./resources/test/fixtures/pycodestyle/W19.py:58:1: W191 Indentation contains tabs +W19.py:58:1: W191 Indentation contains tabs | 58 | if ((row < 0 or self.moduleCount <= row or 59 | col < 0 or self.moduleCount <= col)): @@ -107,7 +107,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 62 | if bar: | -./resources/test/fixtures/pycodestyle/W19.py:61:1: W191 Indentation contains tabs +W19.py:61:1: W191 Indentation contains tabs | 61 | #: E101 E101 E101 E101 W191 W191 W191 W191 W191 W191 62 | if bar: @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 65 | 'closing bracket should be indented ' | -./resources/test/fixtures/pycodestyle/W19.py:62:1: W191 Indentation contains tabs +W19.py:62:1: W191 Indentation contains tabs | 62 | if bar: 63 | return ( @@ -127,7 +127,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 66 | "to match that of the opening " | -./resources/test/fixtures/pycodestyle/W19.py:63:1: W191 Indentation contains tabs +W19.py:63:1: W191 Indentation contains tabs | 63 | return ( 64 | start, 'E121 lines starting with a ' @@ -137,7 +137,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 67 | "bracket's line" | -./resources/test/fixtures/pycodestyle/W19.py:64:1: W191 Indentation contains tabs +W19.py:64:1: W191 Indentation contains tabs | 64 | start, 'E121 lines starting with a ' 65 | 'closing bracket should be indented ' @@ -147,7 +147,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 68 | ) | -./resources/test/fixtures/pycodestyle/W19.py:65:1: W191 Indentation contains tabs +W19.py:65:1: W191 Indentation contains tabs | 65 | 'closing bracket should be indented ' 66 | "to match that of the opening " @@ -157,7 +157,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 69 | # | -./resources/test/fixtures/pycodestyle/W19.py:66:1: W191 Indentation contains tabs +W19.py:66:1: W191 Indentation contains tabs | 66 | "to match that of the opening " 67 | "bracket's line" @@ -167,7 +167,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 70 | #: E101 W191 W504 | -./resources/test/fixtures/pycodestyle/W19.py:73:1: W191 Indentation contains tabs +W19.py:73:1: W191 Indentation contains tabs | 73 | foo.bar("bop") 74 | )): @@ -177,7 +177,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 77 | # also ok, but starting to look like LISP | -./resources/test/fixtures/pycodestyle/W19.py:78:1: W191 Indentation contains tabs +W19.py:78:1: W191 Indentation contains tabs | 78 | if ((foo.bar("baz") and 79 | foo.bar("bop"))): @@ -187,7 +187,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 82 | if (a == 2 or | -./resources/test/fixtures/pycodestyle/W19.py:83:1: W191 Indentation contains tabs +W19.py:83:1: W191 Indentation contains tabs | 83 | b == "abc def ghi" 84 | "jkl mno"): @@ -197,7 +197,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 87 | if (a == 2 or | -./resources/test/fixtures/pycodestyle/W19.py:88:1: W191 Indentation contains tabs +W19.py:88:1: W191 Indentation contains tabs | 88 | b == """abc def ghi 89 | jkl mno"""): @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 92 | if length > options.max_line_length: | -./resources/test/fixtures/pycodestyle/W19.py:91:1: W191 Indentation contains tabs +W19.py:91:1: W191 Indentation contains tabs | 91 | #: W191:2:1 W191:3:1 E101:3:2 92 | if length > options.max_line_length: @@ -216,7 +216,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 94 | "E501 line too long (%d characters)" % length | -./resources/test/fixtures/pycodestyle/W19.py:92:1: W191 Indentation contains tabs +W19.py:92:1: W191 Indentation contains tabs | 92 | if length > options.max_line_length: 93 | return options.max_line_length, \ @@ -224,7 +224,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs | ^^^^ W191 | -./resources/test/fixtures/pycodestyle/W19.py:98:1: W191 Indentation contains tabs +W19.py:98:1: W191 Indentation contains tabs | 98 | #: E101 W191 W191 W504 99 | if os.path.exists(os.path.join(path, PEP8_BIN)): @@ -234,7 +234,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 102 | #: W191 - okay | -./resources/test/fixtures/pycodestyle/W19.py:99:1: W191 Indentation contains tabs +W19.py:99:1: W191 Indentation contains tabs | 99 | if os.path.exists(os.path.join(path, PEP8_BIN)): 100 | cmd = ([os.path.join(path, PEP8_BIN)] + @@ -244,7 +244,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 103 | ''' | -./resources/test/fixtures/pycodestyle/W19.py:125:1: W191 Indentation contains tabs +W19.py:125:1: W191 Indentation contains tabs | 125 | if foo is None and bar is "bop" and \ 126 | blah == 'yeah': @@ -252,7 +252,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs | W191 | -./resources/test/fixtures/pycodestyle/W19.py:131:1: W191 Indentation contains tabs +W19.py:131:1: W191 Indentation contains tabs | 131 | #: W191 W191 W191 132 | if True: @@ -262,7 +262,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 135 | 2) | -./resources/test/fixtures/pycodestyle/W19.py:132:1: W191 Indentation contains tabs +W19.py:132:1: W191 Indentation contains tabs | 132 | if True: 133 | foo( @@ -272,7 +272,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 136 | #: W191 W191 W191 W191 W191 | -./resources/test/fixtures/pycodestyle/W19.py:133:1: W191 Indentation contains tabs +W19.py:133:1: W191 Indentation contains tabs | 133 | foo( 134 | 1, @@ -282,7 +282,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 137 | def test_keys(self): | -./resources/test/fixtures/pycodestyle/W19.py:137:1: W191 Indentation contains tabs +W19.py:137:1: W191 Indentation contains tabs | 137 | def test_keys(self): 138 | """areas.json - All regions are accounted for.""" @@ -292,7 +292,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 141 | u'V\xe4sterbotten', | -./resources/test/fixtures/pycodestyle/W19.py:138:1: W191 Indentation contains tabs +W19.py:138:1: W191 Indentation contains tabs | 138 | """areas.json - All regions are accounted for.""" 139 | expected = set([ @@ -302,7 +302,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 142 | ]) | -./resources/test/fixtures/pycodestyle/W19.py:139:1: W191 Indentation contains tabs +W19.py:139:1: W191 Indentation contains tabs | 139 | expected = set([ 140 | u'Norrbotten', @@ -312,7 +312,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 143 | #: W191 | -./resources/test/fixtures/pycodestyle/W19.py:140:1: W191 Indentation contains tabs +W19.py:140:1: W191 Indentation contains tabs | 140 | u'Norrbotten', 141 | u'V\xe4sterbotten', @@ -322,7 +322,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 144 | x = [ | -./resources/test/fixtures/pycodestyle/W19.py:143:1: W191 Indentation contains tabs +W19.py:143:1: W191 Indentation contains tabs | 143 | #: W191 144 | x = [ diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap index 9044aabd34..168d4465cc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W291_W29.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W29.py:4:6: W291 [*] Trailing whitespace +W29.py:4:6: W291 [*] Trailing whitespace | 4 | # 情 5 | #: W291:1:6 @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 6 6 | class Foo(object): 7 7 | -./resources/test/fixtures/pycodestyle/W29.py:11:35: W291 [*] Trailing whitespace +W29.py:11:35: W291 [*] Trailing whitespace | 11 | #: W291:2:35 12 | '''multiline @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 13 | x = 1 14 14 | #: W191 W292 noeol -./resources/test/fixtures/pycodestyle/W29.py:13:6: W291 [*] Trailing whitespace +W29.py:13:6: W291 [*] Trailing whitespace | 13 | string with trailing whitespace''' 14 | #: W291 W292 noeol diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap index b5262cd5ec..01ab3469b4 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W292_W292_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W292_0.py:2:9: W292 [*] No newline at end of file +W292_0.py:2:9: W292 [*] No newline at end of file | 2 | def fn() -> None: 3 | pass diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap index 07d5e11009..07d5883048 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W293_W29.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W29.py:7:1: W293 [*] Blank line contains whitespace +W29.py:7:1: W293 [*] Blank line contains whitespace | 7 | #: W293:2:1 8 | class Foo(object): diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap index f4514cac60..8d1122eca1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W605_0.py:2:10: W605 [*] Invalid escape sequence: `\.` +W605_0.py:2:10: W605 [*] Invalid escape sequence: `\.` | 2 | #: W605:1:10 3 | regex = '\.png$' @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | #: W605:2:1 5 5 | regex = ''' -./resources/test/fixtures/pycodestyle/W605_0.py:6:1: W605 [*] Invalid escape sequence: `\.` +W605_0.py:6:1: W605 [*] Invalid escape sequence: `\.` | 6 | #: W605:2:1 7 | regex = ''' @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 8 | 9 9 | #: W605:2:6 -./resources/test/fixtures/pycodestyle/W605_0.py:11:6: W605 [*] Invalid escape sequence: `\_` +W605_0.py:11:6: W605 [*] Invalid escape sequence: `\_` | 11 | #: W605:2:6 12 | f( @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 13 | 14 14 | #: W605:4:6 -./resources/test/fixtures/pycodestyle/W605_0.py:18:6: W605 [*] Invalid escape sequence: `\_` +W605_0.py:18:6: W605 [*] Invalid escape sequence: `\_` | 18 | multi-line 19 | literal diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap index 77a05ee9df..48fac0c7bc 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__W605_W605_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W605_1.py:2:10: W605 [*] Invalid escape sequence: `\.` +W605_1.py:2:10: W605 [*] Invalid escape sequence: `\.` | 2 | #: W605:1:10 3 | regex = '\.png$' @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 4 4 | #: W605:2:1 5 5 | regex = ''' -./resources/test/fixtures/pycodestyle/W605_1.py:6:1: W605 [*] Invalid escape sequence: `\.` +W605_1.py:6:1: W605 [*] Invalid escape sequence: `\.` | 6 | #: W605:2:1 7 | regex = ''' @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 8 | 9 9 | #: W605:2:6 -./resources/test/fixtures/pycodestyle/W605_1.py:11:6: W605 [*] Invalid escape sequence: `\_` +W605_1.py:11:6: W605 [*] Invalid escape sequence: `\_` | 11 | #: W605:2:6 12 | f( @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 13 13 | 14 14 | #: W605:4:6 -./resources/test/fixtures/pycodestyle/W605_1.py:18:6: W605 [*] Invalid escape sequence: `\_` +W605_1.py:18:6: W605 [*] Invalid escape sequence: `\_` | 18 | multi-line 19 | literal diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap index 849b74e738..cd697f4d15 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__constant_literals.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/constant_literals.py:4:4: F632 [*] Use `==` to compare constant literals +constant_literals.py:4:4: F632 [*] Use `==` to compare constant literals | 4 | # Errors 5 | ### @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 6 6 | if "abc" is None: # F632 (fix, but leaves behind unfixable E711) 7 7 | pass -./resources/test/fixtures/pycodestyle/constant_literals.py:6:4: F632 [*] Use `==` to compare constant literals +constant_literals.py:6:4: F632 [*] Use `==` to compare constant literals | 6 | if "abc" is "def": # F632 (fix) 7 | pass @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 8 | if None is "abc": # F632 (fix, but leaves behind unfixable E711) 9 9 | pass -./resources/test/fixtures/pycodestyle/constant_literals.py:8:4: F632 [*] Use `==` to compare constant literals +constant_literals.py:8:4: F632 [*] Use `==` to compare constant literals | 8 | if "abc" is None: # F632 (fix, but leaves behind unfixable E711) 9 | pass @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 10 10 | if "abc" is False: # F632 (fix, but leaves behind unfixable E712) 11 11 | pass -./resources/test/fixtures/pycodestyle/constant_literals.py:10:4: F632 [*] Use `==` to compare constant literals +constant_literals.py:10:4: F632 [*] Use `==` to compare constant literals | 10 | if None is "abc": # F632 (fix, but leaves behind unfixable E711) 11 | pass @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 12 12 | if False is "abc": # F632 (fix, but leaves behind unfixable E712) 13 13 | pass -./resources/test/fixtures/pycodestyle/constant_literals.py:12:4: F632 [*] Use `==` to compare constant literals +constant_literals.py:12:4: F632 [*] Use `==` to compare constant literals | 12 | if "abc" is False: # F632 (fix, but leaves behind unfixable E712) 13 | pass @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 14 | if False == None: # E711, E712 (fix) 15 15 | pass -./resources/test/fixtures/pycodestyle/constant_literals.py:14:4: E712 [*] Comparison to `False` should be `cond is False` +constant_literals.py:14:4: E712 [*] Comparison to `False` should be `cond is False` | 14 | if False is "abc": # F632 (fix, but leaves behind unfixable E712) 15 | pass @@ -127,7 +127,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 16 | if None == False: # E711, E712 (fix) 17 17 | pass -./resources/test/fixtures/pycodestyle/constant_literals.py:14:13: E711 [*] Comparison to `None` should be `cond is None` +constant_literals.py:14:13: E711 [*] Comparison to `None` should be `cond is None` | 14 | if False is "abc": # F632 (fix, but leaves behind unfixable E712) 15 | pass @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 16 16 | if None == False: # E711, E712 (fix) 17 17 | pass -./resources/test/fixtures/pycodestyle/constant_literals.py:16:4: E711 [*] Comparison to `None` should be `cond is None` +constant_literals.py:16:4: E711 [*] Comparison to `None` should be `cond is None` | 16 | if False == None: # E711, E712 (fix) 17 | pass @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 18 18 | 19 19 | ### -./resources/test/fixtures/pycodestyle/constant_literals.py:16:12: E712 [*] Comparison to `False` should be `cond is False` +constant_literals.py:16:12: E712 [*] Comparison to `False` should be `cond is False` | 16 | if False == None: # E711, E712 (fix) 17 | pass diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap index 048839aec7..03608fd9d5 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__max_doc_length.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W505.py:2:51: W505 Doc line too long (57 > 50 characters) +W505.py:2:51: W505 Doc line too long (57 > 50 characters) | 2 | #!/usr/bin/env python3 3 | """Here's a top-level docstring that's over the limit.""" | ^^^^^^^ W505 | -./resources/test/fixtures/pycodestyle/W505.py:6:51: W505 Doc line too long (56 > 50 characters) +W505.py:6:51: W505 Doc line too long (56 > 50 characters) | 6 | def f(): 7 | """Here's a docstring that's also over the limit.""" @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 9 | x = 1 # Here's a comment that's over the limit, but it's not standalone. | -./resources/test/fixtures/pycodestyle/W505.py:10:51: W505 Doc line too long (56 > 50 characters) +W505.py:10:51: W505 Doc line too long (56 > 50 characters) | 10 | x = 1 # Here's a comment that's over the limit, but it's not standalone. 11 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 14 | print("Here's a string that's over the limit, but it's not a docstring.") | -./resources/test/fixtures/pycodestyle/W505.py:15:51: W505 Doc line too long (61 > 50 characters) +W505.py:15:51: W505 Doc line too long (61 > 50 characters) | 15 | "This is also considered a docstring, and is over the limit." | ^^^^^^^^^^^ W505 diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap index 136ee60b58..327b3e477d 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__task_tags_false.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/E501_1.py:1:89: E501 Line too long (149 > 88 characters) +E501_1.py:1:89: E501 Line too long (149 > 88 characters) | 1 | # TODO: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E501 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 3 | # TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | -./resources/test/fixtures/pycodestyle/E501_1.py:2:89: E501 Line too long (148 > 88 characters) +E501_1.py:2:89: E501 Line too long (148 > 88 characters) | 2 | # TODO: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` 3 | # TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 5 | # FIXME: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | -./resources/test/fixtures/pycodestyle/E501_1.py:3:89: E501 Line too long (155 > 88 characters) +E501_1.py:3:89: E501 Line too long (155 > 88 characters) | 3 | # TODO: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` 4 | # TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 7 | # FIXME comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | -./resources/test/fixtures/pycodestyle/E501_1.py:4:89: E501 Line too long (150 > 88 characters) +E501_1.py:4:89: E501 Line too long (150 > 88 characters) | 4 | # TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` 5 | # TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | # FIXME comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | -./resources/test/fixtures/pycodestyle/E501_1.py:5:89: E501 Line too long (149 > 88 characters) +E501_1.py:5:89: E501 Line too long (149 > 88 characters) | 5 | # TODO comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` 6 | # FIXME: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/pycodestyle/mod.rs 8 | # FIXME comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` | -./resources/test/fixtures/pycodestyle/E501_1.py:6:89: E501 Line too long (156 > 88 characters) +E501_1.py:6:89: E501 Line too long (156 > 88 characters) | 6 | # FIXME: comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` 7 | # FIXME comments starting with one of the configured task-tags sometimes are longer than line-length so that you can easily find them with `git grep` diff --git a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap index 2e3fe4788a..2b15945ea1 100644 --- a/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap +++ b/crates/ruff/src/rules/pycodestyle/snapshots/ruff__rules__pycodestyle__tests__w292_4.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pycodestyle/mod.rs --- -./resources/test/fixtures/pycodestyle/W292_4.py:1:2: W292 [*] No newline at end of file +W292_4.py:1:2: W292 [*] No newline at end of file | 1 | | W292 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap index 2bfa99d7df..1d8675730c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:1:1: D100 Missing docstring in public module +D.py:1:1: D100 Missing docstring in public module | 1 | # No docstring, so we can test D100 | D100 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap index 7d9cbf7bb8..4432d7ac1c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D100__unrelated__pkg__D100_pub.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/_unrelated/pkg/D100_pub.py:1:1: D100 Missing docstring in public module +D100_pub.py:1:1: D100 Missing docstring in public module | | diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap index 71f06be05a..3120356f61 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D101_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:15:7: D101 Missing docstring in public class +D.py:15:7: D101 Missing docstring in public class | 15 | class class_: | ^^^^^^ D101 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap index 8b37f47b63..71d0952f07 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:23:9: D102 Missing docstring in public method +D.py:23:9: D102 Missing docstring in public method | 23 | @expect('D102: Missing docstring in public method') 24 | def method(self=None): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 25 | pass | -./resources/test/fixtures/pydocstyle/D.py:56:9: D102 Missing docstring in public method +D.py:56:9: D102 Missing docstring in public method | 56 | @expect('D102: Missing docstring in public method') 57 | def __new__(self=None): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 58 | pass | -./resources/test/fixtures/pydocstyle/D.py:68:9: D102 Missing docstring in public method +D.py:68:9: D102 Missing docstring in public method | 68 | @expect('D102: Missing docstring in public method') 69 | def __call__(self=None, x=None, y=None, z=None): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap index 436543a695..bf31726283 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D102_setter.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/setter.py:16:9: D102 Missing docstring in public method +setter.py:16:9: D102 Missing docstring in public method | 16 | @foo 17 | def foo(self, value: str) -> None: diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap index f8ad577964..d1c88f2c44 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D103_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:400:5: D103 Missing docstring in public function +D.py:400:5: D103 Missing docstring in public function | 400 | @expect("D103: Missing docstring in public function") 401 | def oneliner_d102(): return diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap index e5460a7074..6db44d1079 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D104_D104____init__.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D104/__init__.py:1:1: D104 Missing docstring in public package +__init__.py:1:1: D104 Missing docstring in public package | | diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap index b4bc48d743..1a6938b405 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D105_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:64:9: D105 Missing docstring in magic method +D.py:64:9: D105 Missing docstring in magic method | 64 | @expect('D105: Missing docstring in magic method') 65 | def __str__(self=None): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap index ef7a156c2e..ca45f3449d 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D107_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:60:9: D107 Missing docstring in `__init__` +D.py:60:9: D107 Missing docstring in `__init__` | 60 | @expect('D107: Missing docstring in __init__') 61 | def __init__(self=None): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 62 | pass | -./resources/test/fixtures/pydocstyle/D.py:534:9: D107 Missing docstring in `__init__` +D.py:534:9: D107 Missing docstring in `__init__` | 534 | """ 535 | diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap index fb7223e730..522bc46e3f 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D200_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:129:5: D200 [*] One-line docstring should fit on one line +D.py:129:5: D200 [*] One-line docstring should fit on one line | 129 | @expect('D212: Multi-line docstring summary should start at the first line') 130 | def asdlkfasd(): @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 133 131 | 134 132 | @expect('D201: No blank lines allowed before function docstring (found 1)') -./resources/test/fixtures/pydocstyle/D.py:597:5: D200 [*] One-line docstring should fit on one line +D.py:597:5: D200 [*] One-line docstring should fit on one line | 597 | @expect('D212: Multi-line docstring summary should start at the first line') 598 | def one_liner(): @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 601 599 | 602 600 | @expect('D200: One-line docstring should fit on one line with quotes ' -./resources/test/fixtures/pydocstyle/D.py:606:5: D200 [*] One-line docstring should fit on one line +D.py:606:5: D200 [*] One-line docstring should fit on one line | 606 | @expect('D212: Multi-line docstring summary should start at the first line') 607 | def one_liner(): @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 610 608 | 611 609 | @expect('D200: One-line docstring should fit on one line with quotes ' -./resources/test/fixtures/pydocstyle/D.py:615:5: D200 [*] One-line docstring should fit on one line +D.py:615:5: D200 [*] One-line docstring should fit on one line | 615 | @expect('D212: Multi-line docstring summary should start at the first line') 616 | def one_liner(): @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | = help: Reformat to one line -./resources/test/fixtures/pydocstyle/D.py:624:5: D200 [*] One-line docstring should fit on one line +D.py:624:5: D200 [*] One-line docstring should fit on one line | 624 | @expect('D212: Multi-line docstring summary should start at the first line') 625 | def one_liner(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap index 19eeddec1e..19fad1ac34 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D201_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:137:5: D201 [*] No blank lines allowed before function docstring (found 1) +D.py:137:5: D201 [*] No blank lines allowed before function docstring (found 1) | 137 | def leading_space(): 138 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 138 137 | 139 138 | -./resources/test/fixtures/pydocstyle/D.py:151:5: D201 [*] No blank lines allowed before function docstring (found 1) +D.py:151:5: D201 [*] No blank lines allowed before function docstring (found 1) | 151 | def trailing_and_leading_space(): 152 | @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 152 151 | 153 152 | pass -./resources/test/fixtures/pydocstyle/D.py:546:5: D201 [*] No blank lines allowed before function docstring (found 1) +D.py:546:5: D201 [*] No blank lines allowed before function docstring (found 1) | 546 | def multiline_leading_space(): 547 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 547 546 | 548 547 | More content. -./resources/test/fixtures/pydocstyle/D.py:568:5: D201 [*] No blank lines allowed before function docstring (found 1) +D.py:568:5: D201 [*] No blank lines allowed before function docstring (found 1) | 568 | def multiline_trailing_and_leading_space(): 569 | diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap index 88229397af..b17aef7519 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:142:5: D202 [*] No blank lines allowed after function docstring (found 1) +D.py:142:5: D202 [*] No blank lines allowed after function docstring (found 1) | 142 | @expect('D202: No blank lines allowed after function docstring (found 1)') 143 | def trailing_space(): @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 145 144 | 146 145 | -./resources/test/fixtures/pydocstyle/D.py:151:5: D202 [*] No blank lines allowed after function docstring (found 1) +D.py:151:5: D202 [*] No blank lines allowed after function docstring (found 1) | 151 | def trailing_and_leading_space(): 152 | @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 154 153 | 155 154 | -./resources/test/fixtures/pydocstyle/D.py:555:5: D202 [*] No blank lines allowed after function docstring (found 1) +D.py:555:5: D202 [*] No blank lines allowed after function docstring (found 1) | 555 | @expect('D213: Multi-line docstring summary should start at the second line') 556 | def multiline_trailing_space(): @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 561 560 | 562 561 | -./resources/test/fixtures/pydocstyle/D.py:568:5: D202 [*] No blank lines allowed after function docstring (found 1) +D.py:568:5: D202 [*] No blank lines allowed after function docstring (found 1) | 568 | def multiline_trailing_and_leading_space(): 569 | diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap index 16b20e1ad3..234a52e0cb 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D202_D202.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D202.py:57:5: D202 [*] No blank lines allowed after function docstring (found 2) +D202.py:57:5: D202 [*] No blank lines allowed after function docstring (found 2) | 57 | # D202 58 | def outer(): @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 61 59 | return 62 60 | -./resources/test/fixtures/pydocstyle/D202.py:68:5: D202 [*] No blank lines allowed after function docstring (found 2) +D202.py:68:5: D202 [*] No blank lines allowed after function docstring (found 2) | 68 | # D202 69 | def outer(): @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 72 70 | def inner(): 73 71 | return -./resources/test/fixtures/pydocstyle/D202.py:80:5: D202 [*] No blank lines allowed after function docstring (found 1) +D202.py:80:5: D202 [*] No blank lines allowed after function docstring (found 1) | 80 | # D202 81 | def outer(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap index ee69bdfea5..5ef473146e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D203_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:161:5: D203 [*] 1 blank line required before class docstring +D.py:161:5: D203 [*] 1 blank line required before class docstring | 161 | class LeadingSpaceMissing: 162 | """Leading space missing.""" @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 162 163 | 163 164 | -./resources/test/fixtures/pydocstyle/D.py:192:5: D203 [*] 1 blank line required before class docstring +D.py:192:5: D203 [*] 1 blank line required before class docstring | 192 | class LeadingAndTrailingSpaceMissing: 193 | """Leading and trailing space missing.""" @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 193 194 | pass 194 195 | -./resources/test/fixtures/pydocstyle/D.py:526:5: D203 [*] 1 blank line required before class docstring +D.py:526:5: D203 [*] 1 blank line required before class docstring | 526 | # parameters as functions for Google / Numpy conventions. 527 | class Blah: # noqa: D203,D213 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap index 8f2dcacd32..9d8dc6af62 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D204_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:181:5: D204 [*] 1 blank line required after class docstring +D.py:181:5: D204 [*] 1 blank line required after class docstring | 181 | class TrailingSpace: 182 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 183 184 | 184 185 | -./resources/test/fixtures/pydocstyle/D.py:192:5: D204 [*] 1 blank line required after class docstring +D.py:192:5: D204 [*] 1 blank line required after class docstring | 192 | class LeadingAndTrailingSpaceMissing: 193 | """Leading and trailing space missing.""" diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap index f2ae84e054..bc0e009965 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D205_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:200:5: D205 1 blank line required between summary line and description +D.py:200:5: D205 1 blank line required between summary line and description | 200 | @expect('D213: Multi-line docstring summary should start at the second line') 201 | def multi_line_zero_separating_blanks(): @@ -13,7 +13,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |_______^ D205 | -./resources/test/fixtures/pydocstyle/D.py:210:5: D205 [*] 1 blank line required between summary line and description (found 2) +D.py:210:5: D205 [*] 1 blank line required between summary line and description (found 2) | 210 | @expect('D213: Multi-line docstring summary should start at the second line') 211 | def multi_line_two_separating_blanks(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap index d31d2959fc..ae3b1bcc49 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D207_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:232:1: D207 [*] Docstring is under-indented +D.py:232:1: D207 [*] Docstring is under-indented | 232 | """Summary. 233 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 234 234 | """ 235 235 | -./resources/test/fixtures/pydocstyle/D.py:244:1: D207 [*] Docstring is under-indented +D.py:244:1: D207 [*] Docstring is under-indented | 244 | Description. 245 | @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 246 246 | 247 247 | @expect('D208: Docstring is over-indented') -./resources/test/fixtures/pydocstyle/D.py:440:1: D207 [*] Docstring is under-indented +D.py:440:1: D207 [*] Docstring is under-indented | 440 | def docstring_start_in_same_line(): """First Line. 441 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 442 442 | 443 443 | -./resources/test/fixtures/pydocstyle/D.py:441:1: D207 [*] Docstring is under-indented +D.py:441:1: D207 [*] Docstring is under-indented | 441 | Second Line 442 | """ diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap index 3a14e98f6c..9bd77db2c8 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D208_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:252:1: D208 [*] Docstring is over-indented +D.py:252:1: D208 [*] Docstring is over-indented | 252 | """Summary. 253 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 254 254 | """ 255 255 | -./resources/test/fixtures/pydocstyle/D.py:264:1: D208 [*] Docstring is over-indented +D.py:264:1: D208 [*] Docstring is over-indented | 264 | Description. 265 | @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 266 266 | 267 267 | @expect('D208: Docstring is over-indented') -./resources/test/fixtures/pydocstyle/D.py:272:1: D208 [*] Docstring is over-indented +D.py:272:1: D208 [*] Docstring is over-indented | 272 | """Summary. 273 | diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap index d9bb574021..7c8099c045 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D209_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:281:5: D209 [*] Multi-line docstring closing quotes should be on a separate line +D.py:281:5: D209 [*] Multi-line docstring closing quotes should be on a separate line | 281 | @expect('D213: Multi-line docstring summary should start at the second line') 282 | def asdfljdf24(): @@ -24,7 +24,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 285 286 | 286 287 | @expect('D210: No whitespaces allowed surrounding docstring text') -./resources/test/fixtures/pydocstyle/D.py:588:5: D209 [*] Multi-line docstring closing quotes should be on a separate line +D.py:588:5: D209 [*] Multi-line docstring closing quotes should be on a separate line | 588 | @expect('D213: Multi-line docstring summary should start at the second line') 589 | def asdfljdjgf24(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap index a90c1a60a7..b6ea3afed3 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D210_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:288:5: D210 [*] No whitespaces allowed surrounding docstring text +D.py:288:5: D210 [*] No whitespaces allowed surrounding docstring text | 288 | @expect('D210: No whitespaces allowed surrounding docstring text') 289 | def endswith(): @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 290 290 | 291 291 | @expect('D210: No whitespaces allowed surrounding docstring text') -./resources/test/fixtures/pydocstyle/D.py:293:5: D210 [*] No whitespaces allowed surrounding docstring text +D.py:293:5: D210 [*] No whitespaces allowed surrounding docstring text | 293 | @expect('D210: No whitespaces allowed surrounding docstring text') 294 | def around(): @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 295 295 | 296 296 | @expect('D210: No whitespaces allowed surrounding docstring text') -./resources/test/fixtures/pydocstyle/D.py:299:5: D210 [*] No whitespaces allowed surrounding docstring text +D.py:299:5: D210 [*] No whitespaces allowed surrounding docstring text | 299 | @expect('D213: Multi-line docstring summary should start at the second line') 300 | def multiline(): @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 301 301 | This is the end. 302 302 | """ -./resources/test/fixtures/pydocstyle/D.py:581:5: D210 [*] No whitespaces allowed surrounding docstring text +D.py:581:5: D210 [*] No whitespaces allowed surrounding docstring text | 581 | "or exclamation point (not '\"')") 582 | def endswith_quote(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap index 5a7b64042f..1ab7cfe043 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D211_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:170:5: D211 [*] No blank lines allowed before class docstring +D.py:170:5: D211 [*] No blank lines allowed before class docstring | 170 | class WithLeadingSpace: 171 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 171 170 | 172 171 | -./resources/test/fixtures/pydocstyle/D.py:181:5: D211 [*] No blank lines allowed before class docstring +D.py:181:5: D211 [*] No blank lines allowed before class docstring | 181 | class TrailingSpace: 182 | diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap index e68f1f2f1f..eea0a02d09 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D212_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:129:5: D212 [*] Multi-line docstring summary should start at the first line +D.py:129:5: D212 [*] Multi-line docstring summary should start at the first line | 129 | @expect('D212: Multi-line docstring summary should start at the first line') 130 | def asdlkfasd(): @@ -24,7 +24,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 132 131 | 133 132 | -./resources/test/fixtures/pydocstyle/D.py:597:5: D212 [*] Multi-line docstring summary should start at the first line +D.py:597:5: D212 [*] Multi-line docstring summary should start at the first line | 597 | @expect('D212: Multi-line docstring summary should start at the first line') 598 | def one_liner(): @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 601 599 | 602 600 | @expect('D200: One-line docstring should fit on one line with quotes ' -./resources/test/fixtures/pydocstyle/D.py:624:5: D212 [*] Multi-line docstring summary should start at the first line +D.py:624:5: D212 [*] Multi-line docstring summary should start at the first line | 624 | @expect('D212: Multi-line docstring summary should start at the first line') 625 | def one_liner(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap index 47546296cd..30c8a0bbf3 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D213_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:200:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:200:5: D213 [*] Multi-line docstring summary should start at the second line | 200 | @expect('D213: Multi-line docstring summary should start at the second line') 201 | def multi_line_zero_separating_blanks(): @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 202 203 | 203 204 | """ -./resources/test/fixtures/pydocstyle/D.py:210:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:210:5: D213 [*] Multi-line docstring summary should start at the second line | 210 | @expect('D213: Multi-line docstring summary should start at the second line') 211 | def multi_line_two_separating_blanks(): @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 212 213 | 213 214 | Description. -./resources/test/fixtures/pydocstyle/D.py:220:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:220:5: D213 [*] Multi-line docstring summary should start at the second line | 220 | @expect('D213: Multi-line docstring summary should start at the second line') 221 | def multi_line_one_separating_blanks(): @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 222 223 | Description. 223 224 | -./resources/test/fixtures/pydocstyle/D.py:230:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:230:5: D213 [*] Multi-line docstring summary should start at the second line | 230 | @expect('D213: Multi-line docstring summary should start at the second line') 231 | def asdfsdf(): @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 232 233 | Description. 233 234 | -./resources/test/fixtures/pydocstyle/D.py:240:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:240:5: D213 [*] Multi-line docstring summary should start at the second line | 240 | @expect('D213: Multi-line docstring summary should start at the second line') 241 | def asdsdfsdffsdf(): @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 242 243 | Description. 243 244 | -./resources/test/fixtures/pydocstyle/D.py:250:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:250:5: D213 [*] Multi-line docstring summary should start at the second line | 250 | @expect('D213: Multi-line docstring summary should start at the second line') 251 | def asdfsdsdf24(): @@ -151,7 +151,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 252 253 | Description. 253 254 | -./resources/test/fixtures/pydocstyle/D.py:260:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:260:5: D213 [*] Multi-line docstring summary should start at the second line | 260 | @expect('D213: Multi-line docstring summary should start at the second line') 261 | def asdfsdsdfsdf24(): @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 262 263 | Description. 263 264 | -./resources/test/fixtures/pydocstyle/D.py:270:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:270:5: D213 [*] Multi-line docstring summary should start at the second line | 270 | @expect('D213: Multi-line docstring summary should start at the second line') 271 | def asdfsdfsdsdsdfsdf24(): @@ -201,7 +201,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 272 273 | Description. 273 274 | -./resources/test/fixtures/pydocstyle/D.py:281:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:281:5: D213 [*] Multi-line docstring summary should start at the second line | 281 | @expect('D213: Multi-line docstring summary should start at the second line') 282 | def asdfljdf24(): @@ -224,7 +224,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 283 284 | Description.""" 284 285 | -./resources/test/fixtures/pydocstyle/D.py:299:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:299:5: D213 [*] Multi-line docstring summary should start at the second line | 299 | @expect('D213: Multi-line docstring summary should start at the second line') 300 | def multiline(): @@ -248,7 +248,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 301 302 | This is the end. 302 303 | """ -./resources/test/fixtures/pydocstyle/D.py:343:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:343:5: D213 [*] Multi-line docstring summary should start at the second line | 343 | @expect('D213: Multi-line docstring summary should start at the second line') 344 | def exceptions_of_D301(): @@ -274,7 +274,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 345 346 | In particular, line continuations \ 346 347 | and unicode literals \u0394 and \N{GREEK CAPITAL LETTER DELTA}. -./resources/test/fixtures/pydocstyle/D.py:383:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:383:5: D213 [*] Multi-line docstring summary should start at the second line | 383 | @expect('D213: Multi-line docstring summary should start at the second line') 384 | def new_209(): @@ -299,7 +299,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 385 386 | More lines. 386 387 | """ -./resources/test/fixtures/pydocstyle/D.py:392:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:392:5: D213 [*] Multi-line docstring summary should start at the second line | 392 | @expect('D213: Multi-line docstring summary should start at the second line') 393 | def old_209(): @@ -324,7 +324,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 394 395 | Multi-line comments. OK to have extra blank line 395 396 | -./resources/test/fixtures/pydocstyle/D.py:438:37: D213 [*] Multi-line docstring summary should start at the second line +D.py:438:37: D213 [*] Multi-line docstring summary should start at the second line | 438 | @expect("D207: Docstring is under-indented") 439 | @expect('D213: Multi-line docstring summary should start at the second line') @@ -348,7 +348,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 440 441 | Second Line 441 442 | """ -./resources/test/fixtures/pydocstyle/D.py:450:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:450:5: D213 [*] Multi-line docstring summary should start at the second line | 450 | @expect('D213: Multi-line docstring summary should start at the second line') 451 | def a_following_valid_function(x=None): @@ -373,7 +373,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 452 453 | The assertion was caused in the next function, so this one is necessary. 453 454 | -./resources/test/fixtures/pydocstyle/D.py:526:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:526:5: D213 [*] Multi-line docstring summary should start at the second line | 526 | # parameters as functions for Google / Numpy conventions. 527 | class Blah: # noqa: D203,D213 @@ -402,7 +402,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 528 529 | Parameters 529 530 | ---------- -./resources/test/fixtures/pydocstyle/D.py:546:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:546:5: D213 [*] Multi-line docstring summary should start at the second line | 546 | def multiline_leading_space(): 547 | @@ -426,7 +426,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 548 549 | More content. 549 550 | """ -./resources/test/fixtures/pydocstyle/D.py:555:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:555:5: D213 [*] Multi-line docstring summary should start at the second line | 555 | @expect('D213: Multi-line docstring summary should start at the second line') 556 | def multiline_trailing_space(): @@ -452,7 +452,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 557 558 | More content. 558 559 | """ -./resources/test/fixtures/pydocstyle/D.py:568:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:568:5: D213 [*] Multi-line docstring summary should start at the second line | 568 | def multiline_trailing_and_leading_space(): 569 | @@ -478,7 +478,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 570 571 | More content. 571 572 | """ -./resources/test/fixtures/pydocstyle/D.py:588:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:588:5: D213 [*] Multi-line docstring summary should start at the second line | 588 | @expect('D213: Multi-line docstring summary should start at the second line') 589 | def asdfljdjgf24(): @@ -501,7 +501,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 590 591 | Description. """ 591 592 | -./resources/test/fixtures/pydocstyle/D.py:606:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:606:5: D213 [*] Multi-line docstring summary should start at the second line | 606 | @expect('D212: Multi-line docstring summary should start at the first line') 607 | def one_liner(): @@ -524,7 +524,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 608 609 | """ 609 610 | -./resources/test/fixtures/pydocstyle/D.py:615:5: D213 [*] Multi-line docstring summary should start at the second line +D.py:615:5: D213 [*] Multi-line docstring summary should start at the second line | 615 | @expect('D212: Multi-line docstring summary should start at the first line') 616 | def one_liner(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap index 4e314bd7bf..f9c383eacc 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D214_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:144:5: D214 [*] Section is over-indented ("Returns") +sections.py:144:5: D214 [*] Section is over-indented ("Returns") | 144 | @expect("D214: Section is over-indented ('Returns')") 145 | def section_overindented(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap index b8b1328a32..2f9926b382 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D215_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:156:5: D215 [*] Section underline is over-indented ("Returns") +sections.py:156:5: D215 [*] Section underline is over-indented ("Returns") | 156 | @expect("D215: Section underline is over-indented (in section 'Returns')") 157 | def section_underline_overindented(): # noqa: D416 @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 161 161 | 162 162 | """ -./resources/test/fixtures/pydocstyle/sections.py:170:5: D215 [*] Section underline is over-indented ("Returns") +sections.py:170:5: D215 [*] Section underline is over-indented ("Returns") | 170 | @expect("D414: Section has no content ('Returns')") 171 | def section_underline_overindented_and_contentless(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap index 13e86fc774..0e8b86d03c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D300_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:307:5: D300 Use triple double quotes `"""` +D.py:307:5: D300 Use triple double quotes `"""` | 307 | @expect('D300: Use """triple double quotes""" (found \'\'\'-quotes)') 308 | def triple_single_quotes_raw(): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | ^^^^^^^^^^^^^^^ D300 | -./resources/test/fixtures/pydocstyle/D.py:312:5: D300 Use triple double quotes `"""` +D.py:312:5: D300 Use triple double quotes `"""` | 312 | @expect('D300: Use """triple double quotes""" (found \'\'\'-quotes)') 313 | def triple_single_quotes_raw_uppercase(): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | ^^^^^^^^^^^^^^^ D300 | -./resources/test/fixtures/pydocstyle/D.py:317:5: D300 Use triple double quotes `"""` +D.py:317:5: D300 Use triple double quotes `"""` | 317 | @expect('D300: Use """triple double quotes""" (found \'-quotes)') 318 | def single_quotes_raw(): @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | ^^^^^^^^^^^ D300 | -./resources/test/fixtures/pydocstyle/D.py:322:5: D300 Use triple double quotes `"""` +D.py:322:5: D300 Use triple double quotes `"""` | 322 | @expect('D300: Use """triple double quotes""" (found \'-quotes)') 323 | def single_quotes_raw_uppercase(): @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | ^^^^^^^^^^^ D300 | -./resources/test/fixtures/pydocstyle/D.py:328:5: D300 Use triple double quotes `"""` +D.py:328:5: D300 Use triple double quotes `"""` | 328 | @expect('D301: Use r""" if any backslashes in a docstring') 329 | def single_quotes_raw_uppercase_backslash(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap index d1e6b35eba..9c39d236bd 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D301_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:328:5: D301 Use `r"""` if any backslashes in a docstring +D.py:328:5: D301 Use `r"""` if any backslashes in a docstring | 328 | @expect('D301: Use r""" if any backslashes in a docstring') 329 | def single_quotes_raw_uppercase_backslash(): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | ^^^^^^^^^^^^ D301 | -./resources/test/fixtures/pydocstyle/D.py:333:5: D301 Use `r"""` if any backslashes in a docstring +D.py:333:5: D301 Use `r"""` if any backslashes in a docstring | 333 | @expect('D301: Use r""" if any backslashes in a docstring') 334 | def double_quotes_backslash(): @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | ^^^^^^^^^^^^^^^^ D301 | -./resources/test/fixtures/pydocstyle/D.py:338:5: D301 Use `r"""` if any backslashes in a docstring +D.py:338:5: D301 Use `r"""` if any backslashes in a docstring | 338 | @expect('D301: Use r""" if any backslashes in a docstring') 339 | def double_quotes_backslash_uppercase(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap index fbf1ea1371..a36d32c932 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:355:5: D400 [*] First line should end with a period +D.py:355:5: D400 [*] First line should end with a period | 355 | "or exclamation point (not 'y')") 356 | def lwnlkjl(): @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 357 357 | 358 358 | @expect("D401: First line should be in imperative mood " -./resources/test/fixtures/pydocstyle/D.py:406:25: D400 [*] First line should end with a period +D.py:406:25: D400 [*] First line should end with a period | 406 | @expect("D415: First line should end with a period, question mark," 407 | " or exclamation point (not 'r')") @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 408 408 | 409 409 | def ignored_decorator(func): # noqa: D400,D401,D415 -./resources/test/fixtures/pydocstyle/D.py:410:5: D400 [*] First line should end with a period +D.py:410:5: D400 [*] First line should end with a period | 410 | def ignored_decorator(func): # noqa: D400,D401,D415 411 | """Runs something""" @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 412 412 | pass 413 413 | -./resources/test/fixtures/pydocstyle/D.py:416:5: D400 [*] First line should end with a period +D.py:416:5: D400 [*] First line should end with a period | 416 | def decorator_for_test(func): # noqa: D400,D401,D415 417 | """Runs something""" @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 418 418 | pass 419 419 | -./resources/test/fixtures/pydocstyle/D.py:422:35: D400 [*] First line should end with a period +D.py:422:35: D400 [*] First line should end with a period | 422 | @ignored_decorator 423 | def oneliner_ignored_decorator(): """One liner""" @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 424 424 | 425 425 | @decorator_for_test -./resources/test/fixtures/pydocstyle/D.py:429:49: D400 [*] First line should end with a period +D.py:429:49: D400 [*] First line should end with a period | 429 | @expect("D415: First line should end with a period, question mark," 430 | " or exclamation point (not 'r')") @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 431 431 | 432 432 | @decorator_for_test -./resources/test/fixtures/pydocstyle/D.py:470:5: D400 [*] First line should end with a period +D.py:470:5: D400 [*] First line should end with a period | 470 | "or exclamation point (not 'g')") 471 | def docstring_bad(): @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 472 472 | 473 473 | -./resources/test/fixtures/pydocstyle/D.py:475:5: D400 [*] First line should end with a period +D.py:475:5: D400 [*] First line should end with a period | 475 | def docstring_bad_ignore_all(): # noqa 476 | """Runs something""" @@ -155,7 +155,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 477 477 | 478 478 | -./resources/test/fixtures/pydocstyle/D.py:480:5: D400 [*] First line should end with a period +D.py:480:5: D400 [*] First line should end with a period | 480 | def docstring_bad_ignore_one(): # noqa: D400,D401,D415 481 | """Runs something""" @@ -174,7 +174,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 482 482 | 483 483 | -./resources/test/fixtures/pydocstyle/D.py:487:5: D400 [*] First line should end with a period +D.py:487:5: D400 [*] First line should end with a period | 487 | "(perhaps 'Run', not 'Runs')") 488 | def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415 @@ -194,7 +194,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 489 489 | 490 490 | -./resources/test/fixtures/pydocstyle/D.py:514:5: D400 [*] First line should end with a period +D.py:514:5: D400 [*] First line should end with a period | 514 | def valid_google_string(): # noqa: D400 515 | """Test a valid something!""" @@ -212,7 +212,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 516 516 | 517 517 | @expect("D415: First line should end with a period, question mark, " -./resources/test/fixtures/pydocstyle/D.py:520:5: D400 [*] First line should end with a period +D.py:520:5: D400 [*] First line should end with a period | 520 | "or exclamation point (not 'g')") 521 | def bad_google_string(): # noqa: D400 @@ -231,7 +231,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 522 522 | 523 523 | # This is reproducing a bug where AttributeError is raised when parsing class -./resources/test/fixtures/pydocstyle/D.py:581:5: D400 [*] First line should end with a period +D.py:581:5: D400 [*] First line should end with a period | 581 | "or exclamation point (not '\"')") 582 | def endswith_quote(): @@ -250,7 +250,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 583 583 | 584 584 | @expect('D209: Multi-line docstring closing quotes should be on a separate ' -./resources/test/fixtures/pydocstyle/D.py:615:5: D400 [*] First line should end with a period +D.py:615:5: D400 [*] First line should end with a period | 615 | @expect('D212: Multi-line docstring summary should start at the first line') 616 | def one_liner(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap index 4f4534e1c9..f7649a0830 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D400_D400.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D400.py:2:5: D400 [*] First line should end with a period +D400.py:2:5: D400 [*] First line should end with a period | 2 | def f(): 3 | "Here's a line without a period" @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 4 4 | 5 5 | -./resources/test/fixtures/pydocstyle/D400.py:7:5: D400 [*] First line should end with a period +D400.py:7:5: D400 [*] First line should end with a period | 7 | def f(): 8 | """Here's a line without a period""" @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 9 9 | 10 10 | -./resources/test/fixtures/pydocstyle/D400.py:12:5: D400 [*] First line should end with a period +D400.py:12:5: D400 [*] First line should end with a period | 12 | def f(): 13 | """ @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 16 16 | ... 17 17 | -./resources/test/fixtures/pydocstyle/D400.py:20:5: D400 [*] First line should end with a period +D400.py:20:5: D400 [*] First line should end with a period | 20 | def f(): 21 | """Here's a line without a period""" @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 22 22 | 23 23 | -./resources/test/fixtures/pydocstyle/D400.py:25:5: D400 [*] First line should end with a period +D400.py:25:5: D400 [*] First line should end with a period | 25 | def f(): 26 | """ @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 29 29 | 30 30 | -./resources/test/fixtures/pydocstyle/D400.py:32:5: D400 [*] First line should end with a period +D400.py:32:5: D400 [*] First line should end with a period | 32 | def f(): 33 | """ @@ -123,7 +123,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 36 36 | 37 37 | -./resources/test/fixtures/pydocstyle/D400.py:39:5: D400 [*] First line should end with a period +D400.py:39:5: D400 [*] First line should end with a period | 39 | def f(): 40 | r"Here's a line without a period" @@ -142,7 +142,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 41 41 | 42 42 | -./resources/test/fixtures/pydocstyle/D400.py:44:5: D400 [*] First line should end with a period +D400.py:44:5: D400 [*] First line should end with a period | 44 | def f(): 45 | r"""Here's a line without a period""" @@ -161,7 +161,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 46 46 | 47 47 | -./resources/test/fixtures/pydocstyle/D400.py:49:5: D400 [*] First line should end with a period +D400.py:49:5: D400 [*] First line should end with a period | 49 | def f(): 50 | r""" @@ -184,7 +184,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 53 53 | ... 54 54 | -./resources/test/fixtures/pydocstyle/D400.py:57:5: D400 [*] First line should end with a period +D400.py:57:5: D400 [*] First line should end with a period | 57 | def f(): 58 | r"""Here's a line without a period""" @@ -203,7 +203,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 59 59 | 60 60 | -./resources/test/fixtures/pydocstyle/D400.py:62:5: D400 [*] First line should end with a period +D400.py:62:5: D400 [*] First line should end with a period | 62 | def f(): 63 | r""" @@ -225,7 +225,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 66 66 | 67 67 | -./resources/test/fixtures/pydocstyle/D400.py:69:5: D400 [*] First line should end with a period +D400.py:69:5: D400 [*] First line should end with a period | 69 | def f(): 70 | r""" diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap index 3dffd649ce..c4633a0c5b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D401_D401.py.snap @@ -1,21 +1,21 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D401.py:10:5: D401 First line of docstring should be in imperative mood: "Returns foo." +D401.py:10:5: D401 First line of docstring should be in imperative mood: "Returns foo." | 10 | def bad_liouiwnlkjl(): 11 | """Returns foo.""" | ^^^^^^^^^^^^^^^^^^ D401 | -./resources/test/fixtures/pydocstyle/D401.py:14:5: D401 First line of docstring should be in imperative mood: "Constructor for a foo." +D401.py:14:5: D401 First line of docstring should be in imperative mood: "Constructor for a foo." | 14 | def bad_sdgfsdg23245(): 15 | """Constructor for a foo.""" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D401 | -./resources/test/fixtures/pydocstyle/D401.py:18:5: D401 First line of docstring should be in imperative mood: "Constructor for a boa." +D401.py:18:5: D401 First line of docstring should be in imperative mood: "Constructor for a boa." | 18 | def bad_sdgfsdg23245777(): 19 | """ @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |_______^ D401 | -./resources/test/fixtures/pydocstyle/D401.py:26:5: D401 First line of docstring should be in imperative mood: "Runs something" +D401.py:26:5: D401 First line of docstring should be in imperative mood: "Runs something" | 26 | def bad_run_something(): 27 | """Runs something""" @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 29 | def bad_nested(): | -./resources/test/fixtures/pydocstyle/D401.py:29:9: D401 First line of docstring should be in imperative mood: "Runs other things, nested" +D401.py:29:9: D401 First line of docstring should be in imperative mood: "Runs other things, nested" | 29 | def bad_nested(): 30 | """Runs other things, nested""" @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 32 | bad_nested() | -./resources/test/fixtures/pydocstyle/D401.py:35:5: D401 First line of docstring should be in imperative mood: "Writes a logical line that" +D401.py:35:5: D401 First line of docstring should be in imperative mood: "Writes a logical line that" | 35 | def multi_line(): 36 | """Writes a logical line that @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |_______^ D401 | -./resources/test/fixtures/pydocstyle/D401.py:74:9: D401 First line of docstring should be in imperative mood: "This method docstring should be written in imperative mood." +D401.py:74:9: D401 First line of docstring should be in imperative mood: "This method docstring should be written in imperative mood." | 74 | def bad_method(self): 75 | """This method docstring should be written in imperative mood.""" diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap index 7cc85bfd0f..fa93892a76 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D402_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:378:5: D402 First line should not be the function's signature +D.py:378:5: D402 First line should not be the function's signature | 378 | @expect('D402: First line should not be the function\'s "signature"') 379 | def foobar(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D403.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D403.py.snap index 65ae635453..c062e284e9 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D403.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D403_D403.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D403.py:2:5: D403 [*] First word of the first line should be capitalized: `this` -> `This` +D403.py:2:5: D403 [*] First word of the first line should be capitalized: `this` -> `This` | 2 | def bad_function(): 3 | """this docstring is not capitalized""" diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap index 299fe64d8d..31cab86b5e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D404_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:631:5: D404 First word of the docstring should not be "This" +D.py:631:5: D404 First word of the docstring should not be "This" | 631 | @expect('D404: First word of the docstring should not be "This"') 632 | def starts_with_this(): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^ D404 | -./resources/test/fixtures/pydocstyle/D.py:636:5: D404 First word of the docstring should not be "This" +D.py:636:5: D404 First word of the docstring should not be "This" | 636 | @expect('D404: First word of the docstring should not be "This"') 637 | def starts_with_space_then_this(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap index 80d75da67a..93946a3ac8 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D405_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:17:5: D405 [*] Section name should be properly capitalized ("returns") +sections.py:17:5: D405 [*] Section name should be properly capitalized ("returns") | 17 | "('Returns', not 'returns')") 18 | def not_capitalized(): # noqa: D416 @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 21 21 | A value of some sort. 22 22 | -./resources/test/fixtures/pydocstyle/sections.py:216:5: D405 [*] Section name should be properly capitalized ("Short summary") +sections.py:216:5: D405 [*] Section name should be properly capitalized ("Short summary") | 216 | @expect("D407: Missing dashed underline after section ('Raises')") 217 | def multiple_sections(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap index d22844c2f4..e101884a21 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D406_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:30:5: D406 [*] Section name should end with a newline ("Returns") +sections.py:30:5: D406 [*] Section name should end with a newline ("Returns") | 30 | "('Returns', not 'Returns:')") 31 | def superfluous_suffix(): # noqa: D416 @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 34 34 | A value of some sort. 35 35 | -./resources/test/fixtures/pydocstyle/sections.py:216:5: D406 [*] Section name should end with a newline ("Raises") +sections.py:216:5: D406 [*] Section name should end with a newline ("Raises") | 216 | @expect("D407: Missing dashed underline after section ('Raises')") 217 | def multiple_sections(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap index 0b4b726b7f..e71d11e6c1 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D407_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:42:5: D407 [*] Missing dashed underline after section ("Returns") +sections.py:42:5: D407 [*] Missing dashed underline after section ("Returns") | 42 | @expect("D407: Missing dashed underline after section ('Returns')") 43 | def no_underline(): # noqa: D416 @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 46 47 | 47 48 | """ -./resources/test/fixtures/pydocstyle/sections.py:54:5: D407 [*] Missing dashed underline after section ("Returns") +sections.py:54:5: D407 [*] Missing dashed underline after section ("Returns") | 54 | @expect("D414: Section has no content ('Returns')") 55 | def no_underline_and_no_description(): # noqa: D416 @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 58 59 | """ 59 60 | -./resources/test/fixtures/pydocstyle/sections.py:65:5: D407 [*] Missing dashed underline after section ("Returns") +sections.py:65:5: D407 [*] Missing dashed underline after section ("Returns") | 65 | @expect("D414: Section has no content ('Returns')") 66 | def no_underline_and_no_newline(): # noqa: D416 @@ -71,7 +71,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 69 70 | 70 71 | @expect(_D213) -./resources/test/fixtures/pydocstyle/sections.py:216:5: D407 [*] Missing dashed underline after section ("Raises") +sections.py:216:5: D407 [*] Missing dashed underline after section ("Raises") | 216 | @expect("D407: Missing dashed underline after section ('Raises')") 217 | def multiple_sections(): # noqa: D416 @@ -104,7 +104,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 229 230 | 230 231 | """ -./resources/test/fixtures/pydocstyle/sections.py:261:5: D407 [*] Missing dashed underline after section ("Args") +sections.py:261:5: D407 [*] Missing dashed underline after section ("Args") | 261 | @expect("D414: Section has no content ('Returns')") 262 | def valid_google_style_section(): # noqa: D406, D407 @@ -133,7 +133,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 265 266 | 266 267 | Returns: -./resources/test/fixtures/pydocstyle/sections.py:261:5: D407 [*] Missing dashed underline after section ("Returns") +sections.py:261:5: D407 [*] Missing dashed underline after section ("Returns") | 261 | @expect("D414: Section has no content ('Returns')") 262 | def valid_google_style_section(): # noqa: D406, D407 @@ -162,7 +162,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 268 269 | Raises: 269 270 | RandomError: A random error that occurs randomly. -./resources/test/fixtures/pydocstyle/sections.py:261:5: D407 [*] Missing dashed underline after section ("Raises") +sections.py:261:5: D407 [*] Missing dashed underline after section ("Raises") | 261 | @expect("D414: Section has no content ('Returns')") 262 | def valid_google_style_section(): # noqa: D406, D407 @@ -191,7 +191,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 270 271 | 271 272 | """ -./resources/test/fixtures/pydocstyle/sections.py:278:5: D407 [*] Missing dashed underline after section ("Args") +sections.py:278:5: D407 [*] Missing dashed underline after section ("Args") | 278 | "('Args:', not 'Args')") 279 | def missing_colon_google_style_section(): # noqa: D406, D407 @@ -215,7 +215,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 282 283 | 283 284 | """ -./resources/test/fixtures/pydocstyle/sections.py:293:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:293:9: D407 [*] Missing dashed underline after section ("Args") | 293 | def bar(y=2): # noqa: D207, D213, D406, D407 294 | """Nested function test for docstrings. @@ -242,7 +242,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 299 300 | that is broken. 300 301 | -./resources/test/fixtures/pydocstyle/sections.py:310:5: D407 [*] Missing dashed underline after section ("Args") +sections.py:310:5: D407 [*] Missing dashed underline after section ("Args") | 310 | "'test_missing_google_args' docstring)") 311 | def test_missing_google_args(x=1, y=2, _private=3): # noqa: D406, D407 @@ -266,7 +266,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 314 315 | 315 316 | """ -./resources/test/fixtures/pydocstyle/sections.py:322:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:322:9: D407 [*] Missing dashed underline after section ("Args") | 322 | def test_method(self, test, another_test, _): # noqa: D213, D407 323 | """Test a valid args section. @@ -292,7 +292,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 326 327 | another_test: Another parameter. 327 328 | -./resources/test/fixtures/pydocstyle/sections.py:334:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:334:9: D407 [*] Missing dashed underline after section ("Args") | 334 | "'test_missing_args' docstring)", arg_count=5) 335 | def test_missing_args(self, test, x, y, z=3, _private_arg=3): # noqa: D213, D407 @@ -318,7 +318,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 338 339 | 339 340 | """ -./resources/test/fixtures/pydocstyle/sections.py:346:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:346:9: D407 [*] Missing dashed underline after section ("Args") | 346 | "'test_missing_args_class_method' docstring)", arg_count=5) 347 | def test_missing_args_class_method(cls, test, x, y, _, z=3): # noqa: D213, D407 @@ -345,7 +345,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 350 351 | y: 351 352 | -./resources/test/fixtures/pydocstyle/sections.py:359:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:359:9: D407 [*] Missing dashed underline after section ("Args") | 359 | "'test_missing_args_static_method' docstring)", arg_count=4) 360 | def test_missing_args_static_method(a, x, y, _test, z=3): # noqa: D213, D407 @@ -371,7 +371,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 363 364 | 364 365 | """ -./resources/test/fixtures/pydocstyle/sections.py:371:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:371:9: D407 [*] Missing dashed underline after section ("Args") | 371 | "'test_missing_docstring' docstring)", arg_count=2) 372 | def test_missing_docstring(a, b): # noqa: D213, D407 @@ -397,7 +397,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 375 376 | 376 377 | """ -./resources/test/fixtures/pydocstyle/sections.py:380:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:380:9: D407 [*] Missing dashed underline after section ("Args") | 380 | @staticmethod 381 | def test_hanging_indent(skip, verbose): # noqa: D213, D407 @@ -427,7 +427,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 384 385 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 385 386 | Etiam at tellus a tellus faucibus maximus. Curabitur tellus -./resources/test/fixtures/pydocstyle/sections.py:499:9: D407 [*] Missing dashed underline after section ("Args") +sections.py:499:9: D407 [*] Missing dashed underline after section ("Args") | 499 | "'test_incorrect_indent' docstring)", arg_count=3) 500 | def test_incorrect_indent(self, x=1, y=2): # noqa: D207, D213, D407 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap index 78dad05109..ad86537a5d 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D408_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:94:5: D408 [*] Section underline should be in the line following the section's name ("Returns") +sections.py:94:5: D408 [*] Section underline should be in the line following the section's name ("Returns") | 94 | "section's name ('Returns')") 95 | def blank_line_before_underline(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap index 4b216f5dd8..ba0c8ab0c7 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D409_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:108:5: D409 [*] Section underline should match the length of its name ("Returns") +sections.py:108:5: D409 [*] Section underline should match the length of its name ("Returns") | 108 | "(Expected 7 dashes in section 'Returns', got 2)") 109 | def bad_underline_length(): # noqa: D416 @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 113 113 | 114 114 | """ -./resources/test/fixtures/pydocstyle/sections.py:216:5: D409 [*] Section underline should match the length of its name ("Returns") +sections.py:216:5: D409 [*] Section underline should match the length of its name ("Returns") | 216 | @expect("D407: Missing dashed underline after section ('Raises')") 217 | def multiple_sections(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap index c737a136a6..a951482e94 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D410_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:76:5: D410 [*] Missing blank line after section ("Returns") +sections.py:76:5: D410 [*] Missing blank line after section ("Returns") | 76 | @expect("D414: Section has no content ('Yields')") 77 | def consecutive_sections(): # noqa: D416 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 81 82 | ------ 82 83 | -./resources/test/fixtures/pydocstyle/sections.py:216:5: D410 [*] Missing blank line after section ("Returns") +sections.py:216:5: D410 [*] Missing blank line after section ("Returns") | 216 | @expect("D407: Missing dashed underline after section ('Raises')") 217 | def multiple_sections(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap index cc2435fdcb..b66f22005c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D411_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:76:5: D411 [*] Missing blank line before section ("Yields") +sections.py:76:5: D411 [*] Missing blank line before section ("Yields") | 76 | @expect("D414: Section has no content ('Yields')") 77 | def consecutive_sections(): # noqa: D416 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 81 82 | ------ 82 83 | -./resources/test/fixtures/pydocstyle/sections.py:131:5: D411 [*] Missing blank line before section ("Returns") +sections.py:131:5: D411 [*] Missing blank line before section ("Returns") | 131 | @expect("D411: Missing blank line before section ('Returns')") 132 | def no_blank_line_before_section(): # noqa: D416 @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 135 136 | ------- 136 137 | A value of some sort. -./resources/test/fixtures/pydocstyle/sections.py:216:5: D411 [*] Missing blank line before section ("Raises") +sections.py:216:5: D411 [*] Missing blank line before section ("Raises") | 216 | @expect("D407: Missing dashed underline after section ('Raises')") 217 | def multiple_sections(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap index 9d4ad2419b..fc4136ba2e 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D412_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:216:5: D412 [*] No blank lines allowed between a section header and its content ("Short summary") +sections.py:216:5: D412 [*] No blank lines allowed between a section header and its content ("Short summary") | 216 | @expect("D407: Missing dashed underline after section ('Raises')") 217 | def multiple_sections(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap index febda00d43..401296d45b 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D413_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:65:5: D413 [*] Missing blank line after last section ("Returns") +sections.py:65:5: D413 [*] Missing blank line after last section ("Returns") | 65 | @expect("D414: Section has no content ('Returns')") 66 | def no_underline_and_no_newline(): # noqa: D416 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap index 358d7da4f5..4d505e80b5 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D414_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:54:5: D414 Section has no content ("Returns") +sections.py:54:5: D414 Section has no content ("Returns") | 54 | @expect("D414: Section has no content ('Returns')") 55 | def no_underline_and_no_description(): # noqa: D416 @@ -14,7 +14,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |_______^ D414 | -./resources/test/fixtures/pydocstyle/sections.py:65:5: D414 Section has no content ("Returns") +sections.py:65:5: D414 Section has no content ("Returns") | 65 | @expect("D414: Section has no content ('Returns')") 66 | def no_underline_and_no_newline(): # noqa: D416 @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |______________^ D414 | -./resources/test/fixtures/pydocstyle/sections.py:76:5: D414 Section has no content ("Returns") +sections.py:76:5: D414 Section has no content ("Returns") | 76 | @expect("D414: Section has no content ('Yields')") 77 | def consecutive_sections(): # noqa: D416 @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |_______^ D414 | -./resources/test/fixtures/pydocstyle/sections.py:76:5: D414 Section has no content ("Yields") +sections.py:76:5: D414 Section has no content ("Yields") | 76 | @expect("D414: Section has no content ('Yields')") 77 | def consecutive_sections(): # noqa: D416 @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |_______^ D414 | -./resources/test/fixtures/pydocstyle/sections.py:170:5: D414 Section has no content ("Returns") +sections.py:170:5: D414 Section has no content ("Returns") | 170 | @expect("D414: Section has no content ('Returns')") 171 | def section_underline_overindented_and_contentless(): # noqa: D416 @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs | |_______^ D414 | -./resources/test/fixtures/pydocstyle/sections.py:261:5: D414 Section has no content ("Returns") +sections.py:261:5: D414 Section has no content ("Returns") | 261 | @expect("D414: Section has no content ('Returns')") 262 | def valid_google_style_section(): # noqa: D406, D407 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap index 0d1866cdcb..9803cf8fd0 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D415_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:355:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:355:5: D415 [*] First line should end with a period, question mark, or exclamation point | 355 | "or exclamation point (not 'y')") 356 | def lwnlkjl(): @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 357 357 | 358 358 | @expect("D401: First line should be in imperative mood " -./resources/test/fixtures/pydocstyle/D.py:406:25: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:406:25: D415 [*] First line should end with a period, question mark, or exclamation point | 406 | @expect("D415: First line should end with a period, question mark," 407 | " or exclamation point (not 'r')") @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 408 408 | 409 409 | def ignored_decorator(func): # noqa: D400,D401,D415 -./resources/test/fixtures/pydocstyle/D.py:410:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:410:5: D415 [*] First line should end with a period, question mark, or exclamation point | 410 | def ignored_decorator(func): # noqa: D400,D401,D415 411 | """Runs something""" @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 412 412 | pass 413 413 | -./resources/test/fixtures/pydocstyle/D.py:416:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:416:5: D415 [*] First line should end with a period, question mark, or exclamation point | 416 | def decorator_for_test(func): # noqa: D400,D401,D415 417 | """Runs something""" @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 418 418 | pass 419 419 | -./resources/test/fixtures/pydocstyle/D.py:422:35: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:422:35: D415 [*] First line should end with a period, question mark, or exclamation point | 422 | @ignored_decorator 423 | def oneliner_ignored_decorator(): """One liner""" @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 424 424 | 425 425 | @decorator_for_test -./resources/test/fixtures/pydocstyle/D.py:429:49: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:429:49: D415 [*] First line should end with a period, question mark, or exclamation point | 429 | @expect("D415: First line should end with a period, question mark," 430 | " or exclamation point (not 'r')") @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 431 431 | 432 432 | @decorator_for_test -./resources/test/fixtures/pydocstyle/D.py:470:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:470:5: D415 [*] First line should end with a period, question mark, or exclamation point | 470 | "or exclamation point (not 'g')") 471 | def docstring_bad(): @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 472 472 | 473 473 | -./resources/test/fixtures/pydocstyle/D.py:475:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:475:5: D415 [*] First line should end with a period, question mark, or exclamation point | 475 | def docstring_bad_ignore_all(): # noqa 476 | """Runs something""" @@ -155,7 +155,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 477 477 | 478 478 | -./resources/test/fixtures/pydocstyle/D.py:480:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:480:5: D415 [*] First line should end with a period, question mark, or exclamation point | 480 | def docstring_bad_ignore_one(): # noqa: D400,D401,D415 481 | """Runs something""" @@ -174,7 +174,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 482 482 | 483 483 | -./resources/test/fixtures/pydocstyle/D.py:487:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:487:5: D415 [*] First line should end with a period, question mark, or exclamation point | 487 | "(perhaps 'Run', not 'Runs')") 488 | def docstring_ignore_some_violations_but_catch_D401(): # noqa: E501,D400,D415 @@ -194,7 +194,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 489 489 | 490 490 | -./resources/test/fixtures/pydocstyle/D.py:520:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:520:5: D415 [*] First line should end with a period, question mark, or exclamation point | 520 | "or exclamation point (not 'g')") 521 | def bad_google_string(): # noqa: D400 @@ -213,7 +213,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 522 522 | 523 523 | # This is reproducing a bug where AttributeError is raised when parsing class -./resources/test/fixtures/pydocstyle/D.py:581:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:581:5: D415 [*] First line should end with a period, question mark, or exclamation point | 581 | "or exclamation point (not '\"')") 582 | def endswith_quote(): @@ -232,7 +232,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 583 583 | 584 584 | @expect('D209: Multi-line docstring closing quotes should be on a separate ' -./resources/test/fixtures/pydocstyle/D.py:615:5: D415 [*] First line should end with a period, question mark, or exclamation point +D.py:615:5: D415 [*] First line should end with a period, question mark, or exclamation point | 615 | @expect('D212: Multi-line docstring summary should start at the first line') 616 | def one_liner(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap index be1fbd641f..dc5b35446c 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D417_sections.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/sections.py:292:9: D417 Missing argument description in the docstring: `y` +sections.py:292:9: D417 Missing argument description in the docstring: `y` | 292 | x = 1 293 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 295 | """Nested function test for docstrings. | -./resources/test/fixtures/pydocstyle/sections.py:309:5: D417 Missing argument description in the docstring: `y` +sections.py:309:5: D417 Missing argument description in the docstring: `y` | 309 | "(argument(s) y are missing descriptions in " 310 | "'test_missing_google_args' docstring)") @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 312 | """Toggle the gizmo. | -./resources/test/fixtures/pydocstyle/sections.py:333:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` +sections.py:333:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` | 333 | "(argument(s) test, y, z are missing descriptions in " 334 | "'test_missing_args' docstring)", arg_count=5) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 336 | """Test a valid args section. | -./resources/test/fixtures/pydocstyle/sections.py:345:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` +sections.py:345:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` | 345 | "(argument(s) test, y, z are missing descriptions in " 346 | "'test_missing_args_class_method' docstring)", arg_count=5) @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 348 | """Test a valid args section. | -./resources/test/fixtures/pydocstyle/sections.py:358:9: D417 Missing argument descriptions in the docstring: `a`, `y`, `z` +sections.py:358:9: D417 Missing argument descriptions in the docstring: `a`, `y`, `z` | 358 | "(argument(s) a, y, z are missing descriptions in " 359 | "'test_missing_args_static_method' docstring)", arg_count=4) @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 361 | """Test a valid args section. | -./resources/test/fixtures/pydocstyle/sections.py:370:9: D417 Missing argument descriptions in the docstring: `a`, `b` +sections.py:370:9: D417 Missing argument descriptions in the docstring: `a`, `b` | 370 | "(argument(s) a, b are missing descriptions in " 371 | "'test_missing_docstring' docstring)", arg_count=2) @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 373 | """Test a valid args section. | -./resources/test/fixtures/pydocstyle/sections.py:398:5: D417 Missing argument description in the docstring: `y` +sections.py:398:5: D417 Missing argument description in the docstring: `y` | 398 | "(argument(s) y are missing descriptions in " 399 | "'test_missing_numpy_args' docstring)") @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 401 | """Toggle the gizmo. | -./resources/test/fixtures/pydocstyle/sections.py:434:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` +sections.py:434:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` | 434 | "(argument(s) test, y, z are missing descriptions in " 435 | "'test_missing_args' docstring)", arg_count=5) @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 437 | """Test a valid args section. | -./resources/test/fixtures/pydocstyle/sections.py:449:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` +sections.py:449:9: D417 Missing argument descriptions in the docstring: `test`, `y`, `z` | 449 | "(argument(s) test, y, z are missing descriptions in " 450 | "'test_missing_args_class_method' docstring)", arg_count=4) @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 452 | """Test a valid args section. | -./resources/test/fixtures/pydocstyle/sections.py:468:9: D417 Missing argument descriptions in the docstring: `a`, `z` +sections.py:468:9: D417 Missing argument descriptions in the docstring: `a`, `z` | 468 | "(argument(s) a, z are missing descriptions in " 469 | "'test_missing_args_static_method' docstring)", arg_count=3) @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 471 | """Test a valid args section. | -./resources/test/fixtures/pydocstyle/sections.py:498:9: D417 Missing argument description in the docstring: `y` +sections.py:498:9: D417 Missing argument description in the docstring: `y` | 498 | "(argument(s) y are missing descriptions in " 499 | "'test_incorrect_indent' docstring)", arg_count=3) diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap index c6590f57b8..2ec5c2e826 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D418_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:34:9: D418 Function decorated with `@overload` shouldn't contain a docstring +D.py:34:9: D418 Function decorated with `@overload` shouldn't contain a docstring | 34 | @overload 35 | def overloaded_method(self, a: str) -> str: @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 37 | ... | -./resources/test/fixtures/pydocstyle/D.py:90:9: D418 Function decorated with `@overload` shouldn't contain a docstring +D.py:90:9: D418 Function decorated with `@overload` shouldn't contain a docstring | 90 | @overload 91 | def nested_overloaded_func(a: str) -> str: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 93 | ... | -./resources/test/fixtures/pydocstyle/D.py:110:5: D418 Function decorated with `@overload` shouldn't contain a docstring +D.py:110:5: D418 Function decorated with `@overload` shouldn't contain a docstring | 110 | @overload 111 | def overloaded_func(a: str) -> str: diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap index 165c6c53cc..89f50d68a3 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__D419_D.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D.py:20:9: D419 Docstring is empty +D.py:20:9: D419 Docstring is empty | 20 | class meta: 21 | """""" @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 23 | @expect('D102: Missing docstring in public method') | -./resources/test/fixtures/pydocstyle/D.py:74:5: D419 Docstring is empty +D.py:74:5: D419 Docstring is empty | 74 | @expect('D419: Docstring is empty') 75 | def function(): @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 78 | pass | -./resources/test/fixtures/pydocstyle/D.py:80:9: D419 Docstring is empty +D.py:80:9: D419 Docstring is empty | 80 | @expect('D419: Docstring is empty') 81 | def nested(): diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap index c004f09ee2..6cbf9fcdd6 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__bom.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/bom.py:1:1: D300 Use triple double quotes `"""` +bom.py:1:1: D300 Use triple double quotes `"""` | 1 | ''' SAM macro definitions ''' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ D300 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap index 7b69098b27..e4e72c808a 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d209_d400.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D209_D400.py:2:5: D209 [*] Multi-line docstring closing quotes should be on a separate line +D209_D400.py:2:5: D209 [*] Multi-line docstring closing quotes should be on a separate line | 2 | def lorem(): 3 | """lorem ipsum dolor sit amet consectetur adipiscing elit @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pydocstyle/mod.rs 3 |+ sed do eiusmod tempor incididunt ut labore et dolore magna aliqua 4 |+ """ -./resources/test/fixtures/pydocstyle/D209_D400.py:2:5: D400 [*] First line should end with a period +D209_D400.py:2:5: D400 [*] First line should end with a period | 2 | def lorem(): 3 | """lorem ipsum dolor sit amet consectetur adipiscing elit diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap index 1e71e717b4..c10d594abc 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_google.snap @@ -1,63 +1,63 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D417.py:1:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:1:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 1 | def f(x, y, z): | ^ D417 2 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:14:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:14:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 14 | def f(x, y, z): | ^ D417 15 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:27:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:27:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 27 | def f(x, y, z): | ^ D417 28 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:39:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:39:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 39 | def f(x, y, z): | ^ D417 40 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:52:5: D417 Missing argument description in the docstring: `y` +D417.py:52:5: D417 Missing argument description in the docstring: `y` | 52 | def f(x, y, z): | ^ D417 53 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:65:5: D417 Missing argument description in the docstring: `y` +D417.py:65:5: D417 Missing argument description in the docstring: `y` | 65 | def f(x, y, z): | ^ D417 66 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:77:5: D417 Missing argument description in the docstring: `y` +D417.py:77:5: D417 Missing argument description in the docstring: `y` | 77 | def f(x, y, z): | ^ D417 78 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:98:5: D417 Missing argument description in the docstring: `x` +D417.py:98:5: D417 Missing argument description in the docstring: `x` | 98 | def f(x, *args, **kwargs): | ^ D417 99 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:108:5: D417 Missing argument description in the docstring: `*args` +D417.py:108:5: D417 Missing argument description in the docstring: `*args` | 108 | def f(x, *args, **kwargs): | ^ D417 diff --git a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap index 1e71e717b4..c10d594abc 100644 --- a/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap +++ b/crates/ruff/src/rules/pydocstyle/snapshots/ruff__rules__pydocstyle__tests__d417_unspecified.snap @@ -1,63 +1,63 @@ --- source: crates/ruff/src/rules/pydocstyle/mod.rs --- -./resources/test/fixtures/pydocstyle/D417.py:1:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:1:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 1 | def f(x, y, z): | ^ D417 2 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:14:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:14:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 14 | def f(x, y, z): | ^ D417 15 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:27:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:27:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 27 | def f(x, y, z): | ^ D417 28 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:39:5: D417 Missing argument descriptions in the docstring: `y`, `z` +D417.py:39:5: D417 Missing argument descriptions in the docstring: `y`, `z` | 39 | def f(x, y, z): | ^ D417 40 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:52:5: D417 Missing argument description in the docstring: `y` +D417.py:52:5: D417 Missing argument description in the docstring: `y` | 52 | def f(x, y, z): | ^ D417 53 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:65:5: D417 Missing argument description in the docstring: `y` +D417.py:65:5: D417 Missing argument description in the docstring: `y` | 65 | def f(x, y, z): | ^ D417 66 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:77:5: D417 Missing argument description in the docstring: `y` +D417.py:77:5: D417 Missing argument description in the docstring: `y` | 77 | def f(x, y, z): | ^ D417 78 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:98:5: D417 Missing argument description in the docstring: `x` +D417.py:98:5: D417 Missing argument description in the docstring: `x` | 98 | def f(x, *args, **kwargs): | ^ D417 99 | """Do something. | -./resources/test/fixtures/pydocstyle/D417.py:108:5: D417 Missing argument description in the docstring: `*args` +D417.py:108:5: D417 Missing argument description in the docstring: `*args` | 108 | def f(x, *args, **kwargs): | ^ D417 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap index 887be2735f..82184448a2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F401_0.py:2:8: F401 [*] `functools` imported but unused +F401_0.py:2:8: F401 [*] `functools` imported but unused | 2 | from __future__ import all_feature_names 3 | import functools, os @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 4 | from collections import ( 5 5 | Counter, -./resources/test/fixtures/pyflakes/F401_0.py:6:5: F401 [*] `collections.OrderedDict` imported but unused +F401_0.py:6:5: F401 [*] `collections.OrderedDict` imported but unused | 6 | from collections import ( 7 | Counter, @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 7 | ) 9 8 | import multiprocessing.pool -./resources/test/fixtures/pyflakes/F401_0.py:12:8: F401 [*] `logging.handlers` imported but unused +F401_0.py:12:8: F401 [*] `logging.handlers` imported but unused | 12 | import multiprocessing.process 13 | import logging.config @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 14 13 | TYPE_CHECKING, 15 14 | NamedTuple, -./resources/test/fixtures/pyflakes/F401_0.py:32:12: F401 [*] `shelve` imported but unused +F401_0.py:32:12: F401 [*] `shelve` imported but unused | 32 | if TYPE_CHECKING: 33 | import shelve @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 34 33 | 35 34 | if TYPE_CHECKING: -./resources/test/fixtures/pyflakes/F401_0.py:33:12: F401 [*] `importlib` imported but unused +F401_0.py:33:12: F401 [*] `importlib` imported but unused | 33 | if TYPE_CHECKING: 34 | import shelve @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 35 35 | if TYPE_CHECKING: 36 36 | """Hello, world!""" -./resources/test/fixtures/pyflakes/F401_0.py:37:12: F401 [*] `pathlib` imported but unused +F401_0.py:37:12: F401 [*] `pathlib` imported but unused | 37 | if TYPE_CHECKING: 38 | """Hello, world!""" @@ -118,7 +118,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 39 38 | z = 1 40 39 | -./resources/test/fixtures/pyflakes/F401_0.py:52:16: F401 [*] `pickle` imported but unused +F401_0.py:52:16: F401 [*] `pickle` imported but unused | 52 | def b(self) -> None: 53 | import pickle @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 54 54 | 55 55 | __all__ = ["ClassA"] + ["ClassB"] -./resources/test/fixtures/pyflakes/F401_0.py:93:16: F401 [*] `x` imported but unused +F401_0.py:93:16: F401 [*] `x` imported but unused | 93 | match *0, 1, *2: 94 | case 0,: @@ -153,7 +153,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 93 |- import x 94 93 | import y -./resources/test/fixtures/pyflakes/F401_0.py:94:16: F401 [*] `y` imported but unused +F401_0.py:94:16: F401 [*] `y` imported but unused | 94 | case 0,: 95 | import x diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap index 1f904fb7da..a20abcf698 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_10.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F401_10.py:6:16: F401 `orjson` imported but unused; consider using `importlib.util.find_spec` to test for availability +F401_10.py:6:16: F401 `orjson` imported but unused; consider using `importlib.util.find_spec` to test for availability | 6 | def module_not_found_error(): 7 | try: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 10 | return True | -./resources/test/fixtures/pyflakes/F401_10.py:15:16: F401 [*] `orjson` imported but unused +F401_10.py:15:16: F401 [*] `orjson` imported but unused | 15 | def import_error(): 16 | try: diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_11.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_11.py.snap index 51f526bc40..8b44edaab6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_11.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_11.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F401_11.py:4:27: F401 [*] `pathlib.PurePath` imported but unused +F401_11.py:4:27: F401 [*] `pathlib.PurePath` imported but unused | 4 | from typing import List 5 | from pathlib import Path, PurePath diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap index 0083d4e700..e04ea8415a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_5.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F401_5.py:2:17: F401 [*] `a.b.c` imported but unused +F401_5.py:2:17: F401 [*] `a.b.c` imported but unused | 2 | """Test: removal of multi-segment and aliases imports.""" 3 | from a.b import c @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 3 | import h.i 5 4 | import j.k as l -./resources/test/fixtures/pyflakes/F401_5.py:3:17: F401 [*] `d.e.f` imported but unused +F401_5.py:3:17: F401 [*] `d.e.f` imported but unused | 3 | """Test: removal of multi-segment and aliases imports.""" 4 | from a.b import c @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 3 | import h.i 5 4 | import j.k as l -./resources/test/fixtures/pyflakes/F401_5.py:4:8: F401 [*] `h.i` imported but unused +F401_5.py:4:8: F401 [*] `h.i` imported but unused | 4 | from a.b import c 5 | from d.e import f as g @@ -53,7 +53,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 |-import h.i 5 4 | import j.k as l -./resources/test/fixtures/pyflakes/F401_5.py:5:8: F401 [*] `j.k` imported but unused +F401_5.py:5:8: F401 [*] `j.k` imported but unused | 5 | from d.e import f as g 6 | import h.i diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap index db17e6a648..06ef1e3b67 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_6.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F401_6.py:7:25: F401 [*] `.background.BackgroundTasks` imported but unused +F401_6.py:7:25: F401 [*] `.background.BackgroundTasks` imported but unused | 7 | # F401 `background.BackgroundTasks` imported but unused 8 | from .background import BackgroundTasks @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 9 8 | # F401 `datastructures.UploadFile` imported but unused 10 9 | from .datastructures import UploadFile as FileUpload -./resources/test/fixtures/pyflakes/F401_6.py:10:29: F401 [*] `.datastructures.UploadFile` imported but unused +F401_6.py:10:29: F401 [*] `.datastructures.UploadFile` imported but unused | 10 | # F401 `datastructures.UploadFile` imported but unused 11 | from .datastructures import UploadFile as FileUpload @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 12 11 | # OK 13 12 | import applications as applications -./resources/test/fixtures/pyflakes/F401_6.py:16:8: F401 [*] `background` imported but unused +F401_6.py:16:8: F401 [*] `background` imported but unused | 16 | # F401 `background` imported but unused 17 | import background @@ -58,7 +58,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 18 17 | # F401 `datastructures` imported but unused 19 18 | import datastructures as structures -./resources/test/fixtures/pyflakes/F401_6.py:19:8: F401 [*] `datastructures` imported but unused +F401_6.py:19:8: F401 [*] `datastructures` imported but unused | 19 | # F401 `datastructures` imported but unused 20 | import datastructures as structures diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap index f37f2c7641..e570321d49 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_7.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F401_7.py:30:5: F401 [*] `typing.Union` imported but unused +F401_7.py:30:5: F401 [*] `typing.Union` imported but unused | 30 | from typing import ( 31 | Mapping, # noqa: F401 @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 33 32 | # This should ignore both errors. 34 33 | from typing import ( # noqa -./resources/test/fixtures/pyflakes/F401_7.py:66:20: F401 [*] `typing.Awaitable` imported but unused +F401_7.py:66:20: F401 [*] `typing.Awaitable` imported but unused | 66 | # This should mark F501 as unused. 67 | from typing import Awaitable, AwaitableGenerator # noqa: F501 @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 65 65 | # This should mark F501 as unused. 66 |-from typing import Awaitable, AwaitableGenerator # noqa: F501 -./resources/test/fixtures/pyflakes/F401_7.py:66:31: F401 [*] `typing.AwaitableGenerator` imported but unused +F401_7.py:66:31: F401 [*] `typing.AwaitableGenerator` imported but unused | 66 | # This should mark F501 as unused. 67 | from typing import Awaitable, AwaitableGenerator # noqa: F501 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap index 9e2e9e3a60..3db808aa99 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F401_F401_9.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F401_9.py:4:22: F401 [*] `foo.baz` imported but unused +F401_9.py:4:22: F401 [*] `foo.baz` imported but unused | 4 | __all__ = ("bar",) 5 | from foo import bar, baz diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap index 00bcb00771..d161bb4f1c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F402_F402.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F402.py:5:5: F402 Import `os` from line 1 shadowed by loop variable +F402.py:5:5: F402 Import `os` from line 1 shadowed by loop variable | 5 | for os in range(3): | ^^ F402 6 | pass | -./resources/test/fixtures/pyflakes/F402.py:8:5: F402 Import `path` from line 2 shadowed by loop variable +F402.py:8:5: F402 Import `path` from line 2 shadowed by loop variable | 8 | pass 9 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap index 60789531d0..e992be61c2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F403_F403.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F403.py:1:1: F403 `from F634 import *` used; unable to detect undefined names +F403.py:1:1: F403 `from F634 import *` used; unable to detect undefined names | 1 | from F634 import * | ^^^^^^^^^^^^^^^^^^ F403 2 | from F634 import * # noqa: E501 | -./resources/test/fixtures/pyflakes/F403.py:2:1: F403 `from F634 import *` used; unable to detect undefined names +F403.py:2:1: F403 `from F634 import *` used; unable to detect undefined names | 2 | from F634 import * 3 | from F634 import * # noqa: E501 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap index 1d6952f436..7fd07fce72 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F404_F404.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F404.py:6:1: F404 `from __future__` imports must occur at the beginning of the file +F404.py:6:1: F404 `from __future__` imports must occur at the beginning of the file | 6 | from collections import namedtuple 7 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 10 | import __future__ | -./resources/test/fixtures/pyflakes/F404.py:8:1: F404 `from __future__` imports must occur at the beginning of the file +F404.py:8:1: F404 `from __future__` imports must occur at the beginning of the file | 8 | from __future__ import print_function 9 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap index b406e7fb77..30219fcc05 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F405_F405.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F405.py:5:11: F405 `name` may be undefined, or defined from star imports: `mymodule` +F405.py:5:11: F405 `name` may be undefined, or defined from star imports: `mymodule` | 5 | def print_name(): 6 | print(name) | ^^^^ F405 | -./resources/test/fixtures/pyflakes/F405.py:11:1: F405 `a` may be undefined, or defined from star imports: `mymodule` +F405.py:11:1: F405 `a` may be undefined, or defined from star imports: `mymodule` | 11 | print(name) 12 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap index 0e3ae78a64..45ba1e31f9 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F406_F406.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F406.py:5:5: F406 `from F634 import *` only allowed at module level +F406.py:5:5: F406 `from F634 import *` only allowed at module level | 5 | def f(): 6 | from F634 import * | ^^^^^^^^^^^^^^^^^^ F406 | -./resources/test/fixtures/pyflakes/F406.py:9:5: F406 `from F634 import *` only allowed at module level +F406.py:9:5: F406 `from F634 import *` only allowed at module level | 9 | class F: 10 | from F634 import * diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap index eba0ec4f93..7813127706 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F407_F407.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F407.py:2:24: F407 Future feature `non_existent_feature` is not defined +F407.py:2:24: F407 Future feature `non_existent_feature` is not defined | 2 | from __future__ import print_function 3 | from __future__ import non_existent_feature diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap index 54b263661b..013a8d5a4b 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F501_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:1:1: F501 `%`-format string has invalid format string: incomplete format +F50x.py:1:1: F501 `%`-format string has invalid format string: incomplete format | 1 | '%(foo)' % {'foo': 'bar'} # F501 | ^^^^^^^^^^^^^^^^^^^^^^^^^ F501 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap index 4d626fd376..8a713f7206 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F502.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F502.py:6:1: F502 `%`-format string expected mapping but got sequence +F502.py:6:1: F502 `%`-format string expected mapping but got sequence | 6 | "%(bob)s" % {"bob": "bob"} 7 | "%(bob)s" % {**{"bob": "bob"}} @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 10 | "%(bob)s" % {"bob"} # F202 | -./resources/test/fixtures/pyflakes/F502.py:7:1: F502 `%`-format string expected mapping but got sequence +F502.py:7:1: F502 `%`-format string expected mapping but got sequence | 7 | "%(bob)s" % {**{"bob": "bob"}} 8 | "%(bob)s" % ["bob"] # F202 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 11 | "%(bob)s" % [*["bob"]] # F202 | -./resources/test/fixtures/pyflakes/F502.py:8:1: F502 `%`-format string expected mapping but got sequence +F502.py:8:1: F502 `%`-format string expected mapping but got sequence | 8 | "%(bob)s" % ["bob"] # F202 9 | "%(bob)s" % ("bob",) # F202 @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 12 | "%(bob)s" % {"bob": "bob" for _ in range(1)} | -./resources/test/fixtures/pyflakes/F502.py:9:1: F502 `%`-format string expected mapping but got sequence +F502.py:9:1: F502 `%`-format string expected mapping but got sequence | 9 | "%(bob)s" % ("bob",) # F202 10 | "%(bob)s" % {"bob"} # F202 @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 13 | "%(bob)s" % ["bob" for _ in range(1)] # F202 | -./resources/test/fixtures/pyflakes/F502.py:11:1: F502 `%`-format string expected mapping but got sequence +F502.py:11:1: F502 `%`-format string expected mapping but got sequence | 11 | "%(bob)s" % [*["bob"]] # F202 12 | "%(bob)s" % {"bob": "bob" for _ in range(1)} @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 | "%(bob)s" % {"bob" for _ in range(1)} # F202 | -./resources/test/fixtures/pyflakes/F502.py:12:1: F502 `%`-format string expected mapping but got sequence +F502.py:12:1: F502 `%`-format string expected mapping but got sequence | 12 | "%(bob)s" % {"bob": "bob" for _ in range(1)} 13 | "%(bob)s" % ["bob" for _ in range(1)] # F202 @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 | "%(bob)s" % {"bob" for _ in range(1)} # F202 | -./resources/test/fixtures/pyflakes/F502.py:13:1: F502 `%`-format string expected mapping but got sequence +F502.py:13:1: F502 `%`-format string expected mapping but got sequence | 13 | "%(bob)s" % ["bob" for _ in range(1)] # F202 14 | "%(bob)s" % ("bob" for _ in range(1)) # F202 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap index b8d593930c..70ef35b0a2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F502_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:9:1: F502 `%`-format string expected mapping but got sequence +F50x.py:9:1: F502 `%`-format string expected mapping but got sequence | 9 | '%(bar)s' % {} # F505 10 | '%(bar)s' % {'bar': 1, 'baz': 2} # F504 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap index a2c7f19f5e..df3bccfa6a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F503.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F503.py:17:1: F503 `%`-format string expected sequence but got mapping +F503.py:17:1: F503 `%`-format string expected sequence but got mapping | 17 | # Multiple placeholders 18 | "%s %s" % dog @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 21 | "%s %s" % ["bob"] | -./resources/test/fixtures/pyflakes/F503.py:18:1: F503 `%`-format string expected sequence but got mapping +F503.py:18:1: F503 `%`-format string expected sequence but got mapping | 18 | "%s %s" % dog 19 | "%s %s" % {"bob": "bob"} # F503 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 22 | "%s %s" % ("bob",) | -./resources/test/fixtures/pyflakes/F503.py:23:1: F503 `%`-format string expected sequence but got mapping +F503.py:23:1: F503 `%`-format string expected sequence but got mapping | 23 | "%s %s" % {"bob"} 24 | "%s %s" % [*["bob"]] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap index 2c2043979a..25ed2a054c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F503_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:10:1: F503 `%`-format string expected sequence but got mapping +F50x.py:10:1: F503 `%`-format string expected sequence but got mapping | 10 | '%(bar)s' % {'bar': 1, 'baz': 2} # F504 11 | '%(bar)s' % (1, 2, 3) # F502 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap index b174e37811..8ab0155101 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F504.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F504.py:3:1: F504 [*] `%`-format string has unused named argument(s): b +F504.py:3:1: F504 [*] `%`-format string has unused named argument(s): b | 3 | # Ruff has no way of knowing if the following are F505s 4 | a = "wrong" @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 5 | hidden = {"a": "!"} 6 6 | "%(a)s %(c)s" % {"x": 1, **hidden} # Ok (cannot see through splat) -./resources/test/fixtures/pyflakes/F504.py:8:1: F504 [*] `%`-format string has unused named argument(s): b +F504.py:8:1: F504 [*] `%`-format string has unused named argument(s): b | 8 | "%(a)s %(c)s" % {"x": 1, **hidden} # Ok (cannot see through splat) 9 | @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 |+"%(a)s" % {"a": 1, } # F504 ("b" not used) 9 9 | "%(a)s" % {'a': 1, u"b": "!"} # F504 ("b" not used) -./resources/test/fixtures/pyflakes/F504.py:9:1: F504 [*] `%`-format string has unused named argument(s): b +F504.py:9:1: F504 [*] `%`-format string has unused named argument(s): b | 9 | "%(a)s" % {"a": 1, r"b": "!"} # F504 ("b" not used) 10 | "%(a)s" % {'a': 1, u"b": "!"} # F504 ("b" not used) diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap index 53d88ec960..94960c3067 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F504_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:8:1: F504 [*] `%`-format string has unused named argument(s): baz +F50x.py:8:1: F504 [*] `%`-format string has unused named argument(s): baz | 8 | '%s %s' % (1, 2, 3) # F507 9 | '%(bar)s' % {} # F505 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap index 9d29b37349..c2e09068ca 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F505_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:7:1: F505 `%`-format string is missing argument(s) for placeholder(s): bar +F50x.py:7:1: F505 `%`-format string is missing argument(s) for placeholder(s): bar | 7 | '%s %s' % (1,) # F507 8 | '%s %s' % (1, 2, 3) # F507 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap index 0921cb0da5..be07c43a64 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F506_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:2:1: F506 `%`-format string has mixed positional and named placeholders +F50x.py:2:1: F506 `%`-format string has mixed positional and named placeholders | 2 | '%(foo)' % {'foo': 'bar'} # F501 3 | '%s %(foo)s' % {'foo': 'bar'} # F506 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 | '%j' % (1,) # F509 | -./resources/test/fixtures/pyflakes/F50x.py:3:1: F506 `%`-format string has mixed positional and named placeholders +F50x.py:3:1: F506 `%`-format string has mixed positional and named placeholders | 3 | '%(foo)' % {'foo': 'bar'} # F501 4 | '%s %(foo)s' % {'foo': 'bar'} # F506 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 7 | '%s %s' % (1,) # F507 | -./resources/test/fixtures/pyflakes/F50x.py:11:1: F506 `%`-format string has mixed positional and named placeholders +F50x.py:11:1: F506 `%`-format string has mixed positional and named placeholders | 11 | '%(bar)s' % (1, 2, 3) # F502 12 | '%s %s' % {'k': 'v'} # F503 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap index 799b42ff1e..43a1f8e69a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F507_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:5:1: F507 `%`-format string has 2 placeholder(s) but 1 substitution(s) +F50x.py:5:1: F507 `%`-format string has 2 placeholder(s) but 1 substitution(s) | 5 | '%(foo)s %s' % {'foo': 'bar'} # F506 6 | '%j' % (1,) # F509 @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 9 | '%(bar)s' % {} # F505 | -./resources/test/fixtures/pyflakes/F50x.py:6:1: F507 `%`-format string has 2 placeholder(s) but 3 substitution(s) +F50x.py:6:1: F507 `%`-format string has 2 placeholder(s) but 3 substitution(s) | 6 | '%j' % (1,) # F509 7 | '%s %s' % (1,) # F507 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap index 06d820de37..d948894fe6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F508_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:11:1: F508 `%`-format string `*` specifier requires sequence +F50x.py:11:1: F508 `%`-format string `*` specifier requires sequence | 11 | '%(bar)s' % (1, 2, 3) # F502 12 | '%s %s' % {'k': 'v'} # F503 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap index fc5db2e647..24e1d24c6b 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F509_F50x.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F50x.py:4:1: F509 `%`-format string has unsupported format character `j` +F50x.py:4:1: F509 `%`-format string has unsupported format character `j` | 4 | '%s %(foo)s' % {'foo': 'bar'} # F506 5 | '%(foo)s %s' % {'foo': 'bar'} # F506 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap index af6ac678d5..37d47231bd 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F521_F521.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F521.py:1:1: F521 `.format` call has invalid format string: Single '{' encountered in format string +F521.py:1:1: F521 `.format` call has invalid format string: Single '{' encountered in format string | 1 | "{".format(1) | ^^^^^^^^^^^^^ F521 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 3 | "{foo[}".format(foo=1) | -./resources/test/fixtures/pyflakes/F521.py:2:1: F521 `.format` call has invalid format string: Single '}' encountered in format string +F521.py:2:1: F521 `.format` call has invalid format string: Single '}' encountered in format string | 2 | "{".format(1) 3 | "}".format(1) @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 | # too much string recursion (placeholder-in-placeholder) | -./resources/test/fixtures/pyflakes/F521.py:3:1: F521 `.format` call has invalid format string: Expected '}' before end of string +F521.py:3:1: F521 `.format` call has invalid format string: Expected '}' before end of string | 3 | "{".format(1) 4 | "}".format(1) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 7 | "{:{:{}}}".format(1, 2, 3) | -./resources/test/fixtures/pyflakes/F521.py:5:1: F521 `.format` call has invalid format string: Max string recursion exceeded +F521.py:5:1: F521 `.format` call has invalid format string: Max string recursion exceeded | 5 | "{foo[}".format(foo=1) 6 | # too much string recursion (placeholder-in-placeholder) @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 9 | "{foo[]}".format(foo={"": 1}) | -./resources/test/fixtures/pyflakes/F521.py:7:1: F521 `.format` call has invalid format string: Empty attribute in format string +F521.py:7:1: F521 `.format` call has invalid format string: Empty attribute in format string | 7 | "{:{:{}}}".format(1, 2, 3) 8 | # ruff picks these issues up, but flake8 doesn't @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 11 | "{foo..bar}".format(foo=1) | -./resources/test/fixtures/pyflakes/F521.py:8:1: F521 `.format` call has invalid format string: Empty attribute in format string +F521.py:8:1: F521 `.format` call has invalid format string: Empty attribute in format string | 8 | # ruff picks these issues up, but flake8 doesn't 9 | "{foo[]}".format(foo={"": 1}) @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 11 | "{foo..bar}".format(foo=1) | -./resources/test/fixtures/pyflakes/F521.py:9:1: F521 `.format` call has invalid format string: Empty attribute in format string +F521.py:9:1: F521 `.format` call has invalid format string: Empty attribute in format string | 9 | "{foo[]}".format(foo={"": 1}) 10 | "{foo..}".format(foo=1) diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap index c795bdb30d..2779b22c72 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F522_F522.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F522.py:1:1: F522 [*] `.format` call has unused named argument(s): bar +F522.py:1:1: F522 [*] `.format` call has unused named argument(s): bar | 1 | "{}".format(1, bar=2) # F522 | ^^^^^^^^^^^^^^^^^^^^^ F522 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 3 3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues 4 4 | "{bar:{spam}}".format(bar=2, spam=3, eggs=4, ham=5) # F522 -./resources/test/fixtures/pyflakes/F522.py:2:1: F522 [*] `.format` call has unused named argument(s): spam +F522.py:2:1: F522 [*] `.format` call has unused named argument(s): spam | 2 | "{}".format(1, bar=2) # F522 3 | "{bar}{}".format(1, bar=2, spam=3) # F522 @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 3 3 | "{bar:{spam}}".format(bar=2, spam=3) # No issues 4 4 | "{bar:{spam}}".format(bar=2, spam=3, eggs=4, ham=5) # F522 -./resources/test/fixtures/pyflakes/F522.py:4:1: F522 [*] `.format` call has unused named argument(s): eggs, ham +F522.py:4:1: F522 [*] `.format` call has unused named argument(s): eggs, ham | 4 | "{bar}{}".format(1, bar=2, spam=3) # F522 5 | "{bar:{spam}}".format(bar=2, spam=3) # No issues diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap index 31233d08d8..51163b5e06 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F523_F523.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F523.py:2:1: F523 [*] `.format` call has unused arguments at position(s): 1 +F523.py:2:1: F523 [*] `.format` call has unused arguments at position(s): 1 | 2 | # With indexes 3 | "{0}".format(1, 2) # F523 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 4 | "{1:{0}}".format(1, 2) # No issues 5 5 | "{1:{0}}".format(1, 2, 3) # F523 -./resources/test/fixtures/pyflakes/F523.py:3:1: F523 [*] `.format` call has unused arguments at position(s): 0, 2 +F523.py:3:1: F523 [*] `.format` call has unused arguments at position(s): 0, 2 | 3 | # With indexes 4 | "{0}".format(1, 2) # F523 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 5 | "{1:{0}}".format(1, 2, 3) # F523 6 6 | "{0}{2}".format(1, 2) # F523, # F524 -./resources/test/fixtures/pyflakes/F523.py:5:1: F523 [*] `.format` call has unused arguments at position(s): 2 +F523.py:5:1: F523 [*] `.format` call has unused arguments at position(s): 2 | 5 | "{1}".format(1, 2, 3) # F523 6 | "{1:{0}}".format(1, 2) # No issues @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 7 7 | "{1.arg[1]!r:0{2['arg']}{1}}".format(1, 2, 3, 4) # F523 8 8 | -./resources/test/fixtures/pyflakes/F523.py:6:1: F523 [*] `.format` call has unused arguments at position(s): 1 +F523.py:6:1: F523 [*] `.format` call has unused arguments at position(s): 1 | 6 | "{1:{0}}".format(1, 2) # No issues 7 | "{1:{0}}".format(1, 2, 3) # F523 @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 8 | 9 9 | # With no indexes -./resources/test/fixtures/pyflakes/F523.py:7:1: F523 [*] `.format` call has unused arguments at position(s): 0, 3 +F523.py:7:1: F523 [*] `.format` call has unused arguments at position(s): 0, 3 | 7 | "{1:{0}}".format(1, 2, 3) # F523 8 | "{0}{2}".format(1, 2) # F523, # F524 @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 9 9 | # With no indexes 10 10 | "{}".format(1, 2) # F523 -./resources/test/fixtures/pyflakes/F523.py:10:1: F523 [*] `.format` call has unused arguments at position(s): 1 +F523.py:10:1: F523 [*] `.format` call has unused arguments at position(s): 1 | 10 | # With no indexes 11 | "{}".format(1, 2) # F523 @@ -121,7 +121,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 12 12 | "{:{}}".format(1, 2) # No issues 13 13 | "{:{}}".format(1, 2, 3) # F523 -./resources/test/fixtures/pyflakes/F523.py:11:1: F523 [*] `.format` call has unused arguments at position(s): 1, 2 +F523.py:11:1: F523 [*] `.format` call has unused arguments at position(s): 1, 2 | 11 | # With no indexes 12 | "{}".format(1, 2) # F523 @@ -142,7 +142,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 13 13 | "{:{}}".format(1, 2, 3) # F523 14 14 | -./resources/test/fixtures/pyflakes/F523.py:13:1: F523 [*] `.format` call has unused arguments at position(s): 2 +F523.py:13:1: F523 [*] `.format` call has unused arguments at position(s): 2 | 13 | "{}".format(1, 2, 3) # F523 14 | "{:{}}".format(1, 2) # No issues @@ -163,7 +163,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 15 | # With *args 16 16 | "{0}{1}".format(*args) # No issues -./resources/test/fixtures/pyflakes/F523.py:19:1: F523 [*] `.format` call has unused arguments at position(s): 2 +F523.py:19:1: F523 [*] `.format` call has unused arguments at position(s): 2 | 19 | "{0}{1}".format(1, *args) # No issues 20 | "{0}{1}".format(1, 2, *args) # No issues diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap index 2c8bf54ec8..d4abbf0a61 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F524_F524.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F524.py:1:1: F524 `.format` call is missing argument(s) for placeholder(s): 1 +F524.py:1:1: F524 `.format` call is missing argument(s) for placeholder(s): 1 | 1 | "{} {}".format(1) # F524 | ^^^^^^^^^^^^^^^^^ F524 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 3 | "{bar}".format() # F524 | -./resources/test/fixtures/pyflakes/F524.py:2:1: F524 `.format` call is missing argument(s) for placeholder(s): 2 +F524.py:2:1: F524 `.format` call is missing argument(s) for placeholder(s): 2 | 2 | "{} {}".format(1) # F524 3 | "{2}".format() # F524 @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 | "{0} {bar}".format(1) # F524 | -./resources/test/fixtures/pyflakes/F524.py:3:1: F524 `.format` call is missing argument(s) for placeholder(s): bar +F524.py:3:1: F524 `.format` call is missing argument(s) for placeholder(s): bar | 3 | "{} {}".format(1) # F524 4 | "{2}".format() # F524 @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 7 | "{0} {bar}".format() # F524 | -./resources/test/fixtures/pyflakes/F524.py:4:1: F524 `.format` call is missing argument(s) for placeholder(s): bar +F524.py:4:1: F524 `.format` call is missing argument(s) for placeholder(s): bar | 4 | "{2}".format() # F524 5 | "{bar}".format() # F524 @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 | "{bar} {0}".format() # F524 | -./resources/test/fixtures/pyflakes/F524.py:5:1: F524 `.format` call is missing argument(s) for placeholder(s): 0, bar +F524.py:5:1: F524 `.format` call is missing argument(s) for placeholder(s): 0, bar | 5 | "{bar}".format() # F524 6 | "{0} {bar}".format(1) # F524 @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 | "{bar} {0}".format() # F524 | -./resources/test/fixtures/pyflakes/F524.py:6:1: F524 `.format` call is missing argument(s) for placeholder(s): 0, bar +F524.py:6:1: F524 `.format` call is missing argument(s) for placeholder(s): 0, bar | 6 | "{0} {bar}".format(1) # F524 7 | "{0} {bar}".format() # F524 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap index 4e4a7b4900..10b6d95f13 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F525_F525.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F525.py:1:1: F525 `.format` string mixes automatic and manual numbering +F525.py:1:1: F525 `.format` string mixes automatic and manual numbering | 1 | "{} {1}".format(1, 2) # F525 | ^^^^^^^^^^^^^^^^^^^^^ F525 2 | "{0} {}".format(1, 2) # F523, F525 | -./resources/test/fixtures/pyflakes/F525.py:2:1: F525 `.format` string mixes automatic and manual numbering +F525.py:2:1: F525 `.format` string mixes automatic and manual numbering | 2 | "{} {1}".format(1, 2) # F525 3 | "{0} {}".format(1, 2) # F523, F525 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap index e7dec2e6f0..620f331a09 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F541_F541.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F541.py:6:5: F541 [*] f-string without any placeholders +F541.py:6:5: F541 [*] f-string without any placeholders | 6 | # Errors 7 | c = f"def" @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 8 | e = ( 9 9 | f"def" + -./resources/test/fixtures/pyflakes/F541.py:7:5: F541 [*] f-string without any placeholders +F541.py:7:5: F541 [*] f-string without any placeholders | 7 | # Errors 8 | c = f"def" @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 9 9 | f"def" + 10 10 | "ghi" -./resources/test/fixtures/pyflakes/F541.py:9:5: F541 [*] f-string without any placeholders +F541.py:9:5: F541 [*] f-string without any placeholders | 9 | d = f"def" + "ghi" 10 | e = ( @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 11 11 | ) 12 12 | f = ( -./resources/test/fixtures/pyflakes/F541.py:13:5: F541 [*] f-string without any placeholders +F541.py:13:5: F541 [*] f-string without any placeholders | 13 | ) 14 | f = ( @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 15 | "c" 16 16 | rf"d" -./resources/test/fixtures/pyflakes/F541.py:14:5: F541 [*] f-string without any placeholders +F541.py:14:5: F541 [*] f-string without any placeholders | 14 | f = ( 15 | f"a" @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 16 16 | rf"d" 17 17 | fr"e" -./resources/test/fixtures/pyflakes/F541.py:16:5: F541 [*] f-string without any placeholders +F541.py:16:5: F541 [*] f-string without any placeholders | 16 | F"b" 17 | "c" @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 18 18 | ) 19 19 | g = f"" -./resources/test/fixtures/pyflakes/F541.py:17:5: F541 [*] f-string without any placeholders +F541.py:17:5: F541 [*] f-string without any placeholders | 17 | "c" 18 | rf"d" @@ -147,7 +147,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 19 19 | g = f"" 20 20 | -./resources/test/fixtures/pyflakes/F541.py:19:5: F541 [*] f-string without any placeholders +F541.py:19:5: F541 [*] f-string without any placeholders | 19 | fr"e" 20 | ) @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 21 21 | # OK 22 22 | g = f"ghi{123:{45}}" -./resources/test/fixtures/pyflakes/F541.py:25:13: F541 [*] f-string without any placeholders +F541.py:25:13: F541 [*] f-string without any placeholders | 25 | # Error 26 | h = "x" "y" f"z" @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 27 27 | v = 23.234234 28 28 | -./resources/test/fixtures/pyflakes/F541.py:34:7: F541 [*] f-string without any placeholders +F541.py:34:7: F541 [*] f-string without any placeholders | 34 | # Errors 35 | f"{v:{f'0.2f'}}" @@ -208,7 +208,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 36 36 | f"{{test}}" 37 37 | f'{{ 40 }}' -./resources/test/fixtures/pyflakes/F541.py:35:4: F541 [*] f-string without any placeholders +F541.py:35:4: F541 [*] f-string without any placeholders | 35 | # Errors 36 | f"{v:{f'0.2f'}}" @@ -229,7 +229,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 37 37 | f'{{ 40 }}' 38 38 | f"{{a {{x}}" -./resources/test/fixtures/pyflakes/F541.py:36:1: F541 [*] f-string without any placeholders +F541.py:36:1: F541 [*] f-string without any placeholders | 36 | f"{v:{f'0.2f'}}" 37 | f"{f''}" @@ -250,7 +250,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 38 38 | f"{{a {{x}}" 39 39 | f"{{{{x}}}}" -./resources/test/fixtures/pyflakes/F541.py:37:1: F541 [*] f-string without any placeholders +F541.py:37:1: F541 [*] f-string without any placeholders | 37 | f"{f''}" 38 | f"{{test}}" @@ -271,7 +271,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 39 39 | f"{{{{x}}}}" 40 40 | -./resources/test/fixtures/pyflakes/F541.py:38:1: F541 [*] f-string without any placeholders +F541.py:38:1: F541 [*] f-string without any placeholders | 38 | f"{{test}}" 39 | f'{{ 40 }}' @@ -291,7 +291,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 40 40 | 41 41 | # To be fixed -./resources/test/fixtures/pyflakes/F541.py:39:1: F541 [*] f-string without any placeholders +F541.py:39:1: F541 [*] f-string without any placeholders | 39 | f'{{ 40 }}' 40 | f"{{a {{x}}" diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap index f83fe08cf7..168c9df79a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F601_F601.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F601.py:3:5: F601 Dictionary key literal `"a"` repeated +F601.py:3:5: F601 Dictionary key literal `"a"` repeated | 3 | x = { 4 | "a": 1, @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 7 | ("a", "b"): 3, | -./resources/test/fixtures/pyflakes/F601.py:9:5: F601 Dictionary key literal `1` repeated +F601.py:9:5: F601 Dictionary key literal `1` repeated | 9 | 1.0: 2, 10 | 1: 0, @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 13 | b"123": 4, | -./resources/test/fixtures/pyflakes/F601.py:11:5: F601 Dictionary key literal `b"123"` repeated +F601.py:11:5: F601 Dictionary key literal `b"123"` repeated | 11 | 1: 3, 12 | b"123": 1, @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 14 | } | -./resources/test/fixtures/pyflakes/F601.py:16:5: F601 Dictionary key literal `"a"` repeated +F601.py:16:5: F601 Dictionary key literal `"a"` repeated | 16 | x = { 17 | "a": 1, @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 20 | "a": 3, | -./resources/test/fixtures/pyflakes/F601.py:17:5: F601 Dictionary key literal `"a"` repeated +F601.py:17:5: F601 Dictionary key literal `"a"` repeated | 17 | "a": 1, 18 | "a": 2, @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 21 | } | -./resources/test/fixtures/pyflakes/F601.py:18:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:18:5: F601 [*] Dictionary key literal `"a"` repeated | 18 | "a": 2, 19 | "a": 3, @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 20 19 | 21 20 | x = { -./resources/test/fixtures/pyflakes/F601.py:23:5: F601 Dictionary key literal `"a"` repeated +F601.py:23:5: F601 Dictionary key literal `"a"` repeated | 23 | x = { 24 | "a": 1, @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 27 | "a": 3, | -./resources/test/fixtures/pyflakes/F601.py:24:5: F601 Dictionary key literal `"a"` repeated +F601.py:24:5: F601 Dictionary key literal `"a"` repeated | 24 | "a": 1, 25 | "a": 2, @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 28 | "a": 4, | -./resources/test/fixtures/pyflakes/F601.py:25:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:25:5: F601 [*] Dictionary key literal `"a"` repeated | 25 | "a": 2, 26 | "a": 3, @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 27 26 | } 28 27 | -./resources/test/fixtures/pyflakes/F601.py:26:5: F601 Dictionary key literal `"a"` repeated +F601.py:26:5: F601 Dictionary key literal `"a"` repeated | 26 | "a": 3, 27 | "a": 3, @@ -118,7 +118,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 29 | } | -./resources/test/fixtures/pyflakes/F601.py:31:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:31:5: F601 [*] Dictionary key literal `"a"` repeated | 31 | x = { 32 | "a": 1, @@ -138,7 +138,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 33 32 | "a": 3, 34 33 | "a": 4, -./resources/test/fixtures/pyflakes/F601.py:32:5: F601 Dictionary key literal `"a"` repeated +F601.py:32:5: F601 Dictionary key literal `"a"` repeated | 32 | "a": 1, 33 | "a": 1, @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 36 | "a": 4, | -./resources/test/fixtures/pyflakes/F601.py:33:5: F601 Dictionary key literal `"a"` repeated +F601.py:33:5: F601 Dictionary key literal `"a"` repeated | 33 | "a": 1, 34 | "a": 2, @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 37 | } | -./resources/test/fixtures/pyflakes/F601.py:34:5: F601 Dictionary key literal `"a"` repeated +F601.py:34:5: F601 Dictionary key literal `"a"` repeated | 34 | "a": 2, 35 | "a": 3, @@ -167,7 +167,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 37 | } | -./resources/test/fixtures/pyflakes/F601.py:41:5: F601 Dictionary key literal `"a"` repeated +F601.py:41:5: F601 Dictionary key literal `"a"` repeated | 41 | "a": 1, 42 | a: 1, @@ -177,7 +177,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 45 | "a": 3, | -./resources/test/fixtures/pyflakes/F601.py:43:5: F601 Dictionary key literal `"a"` repeated +F601.py:43:5: F601 Dictionary key literal `"a"` repeated | 43 | "a": 2, 44 | a: 2, @@ -187,7 +187,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 47 | "a": 3, | -./resources/test/fixtures/pyflakes/F601.py:45:5: F601 [*] Dictionary key literal `"a"` repeated +F601.py:45:5: F601 [*] Dictionary key literal `"a"` repeated | 45 | "a": 3, 46 | a: 3, @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 47 46 | } 48 47 | -./resources/test/fixtures/pyflakes/F601.py:49:14: F601 [*] Dictionary key literal `"a"` repeated +F601.py:49:14: F601 [*] Dictionary key literal `"a"` repeated | 49 | } 50 | @@ -225,7 +225,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 49 |+x = {"a": 1} 50 50 | x = {"a": 1, "b": 2, "a": 1} -./resources/test/fixtures/pyflakes/F601.py:50:22: F601 [*] Dictionary key literal `"a"` repeated +F601.py:50:22: F601 [*] Dictionary key literal `"a"` repeated | 50 | x = {"a": 1, "a": 1} 51 | x = {"a": 1, "b": 2, "a": 1} diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap index 1699ba17b7..10ac0b8b64 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F602_F602.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F602.py:5:5: F602 Dictionary key `a` repeated +F602.py:5:5: F602 Dictionary key `a` repeated | 5 | x = { 6 | a: 1, @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 9 | } | -./resources/test/fixtures/pyflakes/F602.py:11:5: F602 Dictionary key `a` repeated +F602.py:11:5: F602 Dictionary key `a` repeated | 11 | x = { 12 | a: 1, @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 | a: 3, | -./resources/test/fixtures/pyflakes/F602.py:12:5: F602 Dictionary key `a` repeated +F602.py:12:5: F602 Dictionary key `a` repeated | 12 | a: 1, 13 | a: 2, @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 16 | } | -./resources/test/fixtures/pyflakes/F602.py:13:5: F602 [*] Dictionary key `a` repeated +F602.py:13:5: F602 [*] Dictionary key `a` repeated | 13 | a: 2, 14 | a: 3, @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 14 | 16 15 | x = { -./resources/test/fixtures/pyflakes/F602.py:18:5: F602 Dictionary key `a` repeated +F602.py:18:5: F602 Dictionary key `a` repeated | 18 | x = { 19 | a: 1, @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 22 | a: 3, | -./resources/test/fixtures/pyflakes/F602.py:19:5: F602 Dictionary key `a` repeated +F602.py:19:5: F602 Dictionary key `a` repeated | 19 | a: 1, 20 | a: 2, @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 23 | a: 4, | -./resources/test/fixtures/pyflakes/F602.py:20:5: F602 [*] Dictionary key `a` repeated +F602.py:20:5: F602 [*] Dictionary key `a` repeated | 20 | a: 2, 21 | a: 3, @@ -90,7 +90,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 22 21 | } 23 22 | -./resources/test/fixtures/pyflakes/F602.py:21:5: F602 Dictionary key `a` repeated +F602.py:21:5: F602 Dictionary key `a` repeated | 21 | a: 3, 22 | a: 3, @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 24 | } | -./resources/test/fixtures/pyflakes/F602.py:26:5: F602 [*] Dictionary key `a` repeated +F602.py:26:5: F602 [*] Dictionary key `a` repeated | 26 | x = { 27 | a: 1, @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 28 27 | a: 3, 29 28 | a: 4, -./resources/test/fixtures/pyflakes/F602.py:27:5: F602 Dictionary key `a` repeated +F602.py:27:5: F602 Dictionary key `a` repeated | 27 | a: 1, 28 | a: 1, @@ -129,7 +129,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 31 | a: 4, | -./resources/test/fixtures/pyflakes/F602.py:28:5: F602 Dictionary key `a` repeated +F602.py:28:5: F602 Dictionary key `a` repeated | 28 | a: 1, 29 | a: 2, @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 32 | } | -./resources/test/fixtures/pyflakes/F602.py:29:5: F602 Dictionary key `a` repeated +F602.py:29:5: F602 Dictionary key `a` repeated | 29 | a: 2, 30 | a: 3, @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 32 | } | -./resources/test/fixtures/pyflakes/F602.py:35:5: F602 [*] Dictionary key `a` repeated +F602.py:35:5: F602 [*] Dictionary key `a` repeated | 35 | a: 1, 36 | "a": 1, @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 37 36 | a: 2, 38 37 | "a": 3, -./resources/test/fixtures/pyflakes/F602.py:37:5: F602 Dictionary key `a` repeated +F602.py:37:5: F602 Dictionary key `a` repeated | 37 | a: 1, 38 | "a": 2, @@ -178,7 +178,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 41 | a: 3, | -./resources/test/fixtures/pyflakes/F602.py:39:5: F602 Dictionary key `a` repeated +F602.py:39:5: F602 Dictionary key `a` repeated | 39 | a: 2, 40 | "a": 3, @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 43 | a: 4, | -./resources/test/fixtures/pyflakes/F602.py:41:5: F602 Dictionary key `a` repeated +F602.py:41:5: F602 Dictionary key `a` repeated | 41 | a: 3, 42 | "a": 3, @@ -197,7 +197,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 44 | } | -./resources/test/fixtures/pyflakes/F602.py:44:12: F602 [*] Dictionary key `a` repeated +F602.py:44:12: F602 [*] Dictionary key `a` repeated | 44 | } 45 | @@ -215,7 +215,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 44 |+x = {a: 1} 45 45 | x = {a: 1, b: 2, a: 1} -./resources/test/fixtures/pyflakes/F602.py:45:18: F602 [*] Dictionary key `a` repeated +F602.py:45:18: F602 [*] Dictionary key `a` repeated | 45 | x = {a: 1, a: 1} 46 | x = {a: 1, b: 2, a: 1} diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap index 341f7e09c8..4c1e3173b8 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F622_F622.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F622.py:1:1: F622 Two starred expressions in assignment +F622.py:1:1: F622 Two starred expressions in assignment | 1 | *a, *b, c = (1, 2, 3) | ^^^^^^^^^ F622 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap index d00873ac1c..7cb0a6d114 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F631_F631.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F631.py:1:1: F631 Assert test is a non-empty tuple, which is always `True` +F631.py:1:1: F631 Assert test is a non-empty tuple, which is always `True` | 1 | assert (False, "x") | ^^^^^^^^^^^^^^^^^^^ F631 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 3 | assert () | -./resources/test/fixtures/pyflakes/F631.py:2:1: F631 Assert test is a non-empty tuple, which is always `True` +F631.py:2:1: F631 Assert test is a non-empty tuple, which is always `True` | 2 | assert (False, "x") 3 | assert (False,) diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap index ff20576f97..7b1af9143a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F632_F632.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F632.py:1:4: F632 [*] Use `==` to compare constant literals +F632.py:1:4: F632 [*] Use `==` to compare constant literals | 1 | if x is "abc": | ^^^^^^^^^^ F632 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 3 3 | 4 4 | if 123 is not y: -./resources/test/fixtures/pyflakes/F632.py:4:4: F632 [*] Use `!=` to compare constant literals +F632.py:4:4: F632 [*] Use `!=` to compare constant literals | 4 | pass 5 | @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 6 6 | 7 7 | if 123 is \ -./resources/test/fixtures/pyflakes/F632.py:7:4: F632 [*] Use `!=` to compare constant literals +F632.py:7:4: F632 [*] Use `!=` to compare constant literals | 7 | pass 8 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 10 9 | 11 10 | if "123" is x < 3: -./resources/test/fixtures/pyflakes/F632.py:11:4: F632 [*] Use `==` to compare constant literals +F632.py:11:4: F632 [*] Use `==` to compare constant literals | 11 | pass 12 | @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 13 13 | 14 14 | if "123" != x is 3: -./resources/test/fixtures/pyflakes/F632.py:14:4: F632 [*] Use `==` to compare constant literals +F632.py:14:4: F632 [*] Use `==` to compare constant literals | 14 | pass 15 | @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 16 16 | 17 17 | if ("123" != x) is 3: -./resources/test/fixtures/pyflakes/F632.py:17:4: F632 [*] Use `==` to compare constant literals +F632.py:17:4: F632 [*] Use `==` to compare constant literals | 17 | pass 18 | @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 19 19 | 20 20 | if "123" != (x is 3): -./resources/test/fixtures/pyflakes/F632.py:20:14: F632 [*] Use `==` to compare constant literals +F632.py:20:14: F632 [*] Use `==` to compare constant literals | 20 | pass 21 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap index 344e879804..107510690f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F633_F633.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F633.py:4:1: F633 Use of `>>` is invalid with `print` function +F633.py:4:1: F633 Use of `>>` is invalid with `print` function | 4 | import sys 5 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap index d6a32cdd50..d8078b90a2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F634_F634.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F634.py:1:1: F634 If test is a tuple, which is always `True` +F634.py:1:1: F634 If test is a tuple, which is always `True` | 1 | / if (1, 2): 2 | | pass @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 | for _ in range(5): | -./resources/test/fixtures/pyflakes/F634.py:7:5: F634 If test is a tuple, which is always `True` +F634.py:7:5: F634 If test is a tuple, which is always `True` | 7 | if True: 8 | pass diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap index da9a7f2327..aaa976308c 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F701_F701.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F701.py:4:5: F701 `break` outside loop +F701.py:4:5: F701 `break` outside loop | 4 | break 5 | else: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 | i = 0 | -./resources/test/fixtures/pyflakes/F701.py:16:5: F701 `break` outside loop +F701.py:16:5: F701 `break` outside loop | 16 | break 17 | @@ -19,14 +19,14 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | ^^^^^ F701 | -./resources/test/fixtures/pyflakes/F701.py:20:5: F701 `break` outside loop +F701.py:20:5: F701 `break` outside loop | 20 | class Foo: 21 | break | ^^^^^ F701 | -./resources/test/fixtures/pyflakes/F701.py:23:1: F701 `break` outside loop +F701.py:23:1: F701 `break` outside loop | 23 | break | ^^^^^ F701 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap index 34c9de0a14..e944781752 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F702_F702.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F702.py:4:5: F702 `continue` not properly in loop +F702.py:4:5: F702 `continue` not properly in loop | 4 | continue 5 | else: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 | i = 0 | -./resources/test/fixtures/pyflakes/F702.py:16:5: F702 `continue` not properly in loop +F702.py:16:5: F702 `continue` not properly in loop | 16 | continue 17 | @@ -19,14 +19,14 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | ^^^^^^^^ F702 | -./resources/test/fixtures/pyflakes/F702.py:20:5: F702 `continue` not properly in loop +F702.py:20:5: F702 `continue` not properly in loop | 20 | class Foo: 21 | continue | ^^^^^^^^ F702 | -./resources/test/fixtures/pyflakes/F702.py:23:1: F702 `continue` not properly in loop +F702.py:23:1: F702 `continue` not properly in loop | 23 | continue | ^^^^^^^^ F702 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap index de03ff3bef..f96607bf44 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F704_F704.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F704.py:6:5: F704 `yield` statement outside of a function +F704.py:6:5: F704 `yield` statement outside of a function | 6 | class Foo: 7 | yield 2 | ^^^^^^^ F704 | -./resources/test/fixtures/pyflakes/F704.py:9:1: F704 `yield` statement outside of a function +F704.py:9:1: F704 `yield` statement outside of a function | 9 | yield 3 | ^^^^^^^ F704 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 11 | await f() | -./resources/test/fixtures/pyflakes/F704.py:10:1: F704 `yield from` statement outside of a function +F704.py:10:1: F704 `yield from` statement outside of a function | 10 | yield 3 11 | yield from 3 @@ -24,7 +24,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 12 | await f() | -./resources/test/fixtures/pyflakes/F704.py:11:1: F704 `await` statement outside of a function +F704.py:11:1: F704 `await` statement outside of a function | 11 | yield 3 12 | yield from 3 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap index 80771c7ce4..3f421150ee 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F706_F706.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F706.py:6:5: F706 `return` statement outside of a function/method +F706.py:6:5: F706 `return` statement outside of a function/method | 6 | class Foo: 7 | return 2 | ^^^^^^^^ F706 | -./resources/test/fixtures/pyflakes/F706.py:9:1: F706 `return` statement outside of a function/method +F706.py:9:1: F706 `return` statement outside of a function/method | 9 | return 3 | ^^^^^^^^ F706 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap index 80ab065547..3c4d2357e2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F707_F707.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F707.py:3:1: F707 An `except` block as not the last exception handler +F707.py:3:1: F707 An `except` block as not the last exception handler | 3 | try: 4 | pass @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 7 | except ValueError: | -./resources/test/fixtures/pyflakes/F707.py:10:1: F707 An `except` block as not the last exception handler +F707.py:10:1: F707 An `except` block as not the last exception handler | 10 | try: 11 | pass @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 14 | except ValueError: | -./resources/test/fixtures/pyflakes/F707.py:19:1: F707 An `except` block as not the last exception handler +F707.py:19:1: F707 An `except` block as not the last exception handler | 19 | try: 20 | pass diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap index a919f5187e..adfe2caae0 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F722_F722.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F722.py:9:12: F722 Syntax error in forward annotation: `///` +F722.py:9:12: F722 Syntax error in forward annotation: `///` | 9 | def g() -> "///": | ^^^^^ F722 10 | pass | -./resources/test/fixtures/pyflakes/F722.py:13:4: F722 Syntax error in forward annotation: `List[int]☃` +F722.py:13:4: F722 Syntax error in forward annotation: `List[int]☃` | 13 | X: """List[int]"""'☃' = [] | ^^^^^^^^^^^^^^^^^^ F722 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap index 83fbbdcf58..c4665ab15a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_0.py:10:5: F811 Redefinition of unused `bar` from line 6 +F811_0.py:10:5: F811 Redefinition of unused `bar` from line 6 | 10 | def bar(): | ^^^ F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap index bb38c89de1..6f08dc26a2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_1.py:1:18: F811 Redefinition of unused `FU` from line 1 +F811_1.py:1:18: F811 Redefinition of unused `FU` from line 1 | 1 | import fu as FU, bar as FU | ^^^^^^^^^ F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap index 1f57da0118..7bc05b1eec 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_12.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_12.py:6:20: F811 Redefinition of unused `mixer` from line 2 +F811_12.py:6:20: F811 Redefinition of unused `mixer` from line 2 | 6 | pass 7 | else: diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap index eea3184d61..90a61472ce 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_15.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_15.py:4:5: F811 Redefinition of unused `fu` from line 1 +F811_15.py:4:5: F811 Redefinition of unused `fu` from line 1 | 4 | def fu(): | ^^ F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap index e87c0939ec..7d9129b4df 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_16.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_16.py:8:13: F811 Redefinition of unused `fu` from line 3 +F811_16.py:8:13: F811 Redefinition of unused `fu` from line 3 | 8 | def bar(): 9 | def baz(): diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap index 4901e0557f..67ebc281d0 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_17.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_17.py:6:12: F811 Redefinition of unused `fu` from line 2 +F811_17.py:6:12: F811 Redefinition of unused `fu` from line 2 | 6 | def bar(): 7 | import fu @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 9 | def baz(): | -./resources/test/fixtures/pyflakes/F811_17.py:9:13: F811 Redefinition of unused `fu` from line 6 +F811_17.py:9:13: F811 Redefinition of unused `fu` from line 6 | 9 | def baz(): 10 | def fu(): diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap index 379869d60e..55c6dc663f 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_2.py:1:27: F811 Redefinition of unused `FU` from line 1 +F811_2.py:1:27: F811 Redefinition of unused `FU` from line 1 | 1 | from moo import fu as FU, bar as FU | ^^^^^^^^^ F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap index 2790d4513a..d13e204d42 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_21.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_21.py:32:5: F811 Redefinition of unused `Sequence` from line 26 +F811_21.py:32:5: F811 Redefinition of unused `Sequence` from line 26 | 32 | from typing import ( 33 | List, # noqa: F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap index 6878864516..3f65d958a5 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_3.py:1:12: F811 Redefinition of unused `fu` from line 1 +F811_3.py:1:12: F811 Redefinition of unused `fu` from line 1 | 1 | import fu; fu = 3 | ^^ F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap index 73c218db1d..015e0ff8d3 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_4.py:1:12: F811 Redefinition of unused `fu` from line 1 +F811_4.py:1:12: F811 Redefinition of unused `fu` from line 1 | 1 | import fu; fu, bar = 3 | ^^ F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap index 344218c04d..ce7897f921 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_5.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_5.py:1:13: F811 Redefinition of unused `fu` from line 1 +F811_5.py:1:13: F811 Redefinition of unused `fu` from line 1 | 1 | import fu; [fu, bar] = 3 | ^^ F811 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap index b2fed238fb..72373d1c28 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_6.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_6.py:6:12: F811 Redefinition of unused `os` from line 5 +F811_6.py:6:12: F811 Redefinition of unused `os` from line 5 | 6 | if i == 1: 7 | import os diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap index 18c9a4cc39..2305b93af5 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F811_F811_8.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F811_8.py:5:12: F811 Redefinition of unused `os` from line 4 +F811_8.py:5:12: F811 Redefinition of unused `os` from line 4 | 5 | try: 6 | import os diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap index ef1ccb1f07..5c4b971abf 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_0.py.snap @@ -1,35 +1,35 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_0.py:2:12: F821 Undefined name `self` +F821_0.py:2:12: F821 Undefined name `self` | 2 | def get_name(): 3 | return self.name | ^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_0.py:6:13: F821 Undefined name `self` +F821_0.py:6:13: F821 Undefined name `self` | 6 | def get_name(): 7 | return (self.name,) | ^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_0.py:10:9: F821 Undefined name `self` +F821_0.py:10:9: F821 Undefined name `self` | 10 | def get_name(): 11 | del self.name | ^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_0.py:21:12: F821 Undefined name `numeric_string` +F821_0.py:21:12: F821 Undefined name `numeric_string` | 21 | def randdec(maxprec, maxexp): 22 | return numeric_string(maxprec, maxexp) | ^^^^^^^^^^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_0.py:58:5: F821 Undefined name `Bar` +F821_0.py:58:5: F821 Undefined name `Bar` | 58 | y: int = 1 59 | @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 62 | [first] = ["yup"] | -./resources/test/fixtures/pyflakes/F821_0.py:83:11: F821 Undefined name `TOMATO` +F821_0.py:83:11: F821 Undefined name `TOMATO` | 83 | def update_tomato(): 84 | print(TOMATO) @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 85 | TOMATO = "cherry tomato" | -./resources/test/fixtures/pyflakes/F821_0.py:87:8: F821 Undefined name `B` +F821_0.py:87:8: F821 Undefined name `B` | 87 | A = f'{B}' | ^ F821 @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 89 | f'B' | -./resources/test/fixtures/pyflakes/F821_0.py:90:8: F821 Undefined name `B` +F821_0.py:90:8: F821 Undefined name `B` | 90 | A = ( 91 | f'B' @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 94 | C = f'{A:{B}}' | -./resources/test/fixtures/pyflakes/F821_0.py:92:11: F821 Undefined name `B` +F821_0.py:92:11: F821 Undefined name `B` | 92 | f'{B}' 93 | ) @@ -74,7 +74,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 95 | C = f'{A:{f"{B}"}}' | -./resources/test/fixtures/pyflakes/F821_0.py:93:14: F821 Undefined name `B` +F821_0.py:93:14: F821 Undefined name `B` | 93 | ) 94 | C = f'{A:{B}}' @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 97 | from typing import Annotated, Literal | -./resources/test/fixtures/pyflakes/F821_0.py:115:10: F821 Undefined name `PEP593Test123` +F821_0.py:115:10: F821 Undefined name `PEP593Test123` | 115 | ] 116 | field_with_undefined_stringified_type: Annotated[ @@ -94,7 +94,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 119 | ] | -./resources/test/fixtures/pyflakes/F821_0.py:123:15: F821 Undefined name `foo` +F821_0.py:123:15: F821 Undefined name `foo` | 123 | ] 124 | field_with_undefined_nested_subscript: Annotated[ @@ -104,7 +104,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 127 | ] | -./resources/test/fixtures/pyflakes/F821_0.py:123:22: F821 Undefined name `bar` +F821_0.py:123:22: F821 Undefined name `bar` | 123 | ] 124 | field_with_undefined_nested_subscript: Annotated[ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap index 6ef1e32104..ac46868671 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_1.py.snap @@ -1,28 +1,28 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_1.py:11:11: F821 Undefined name `Model` +F821_1.py:11:11: F821 Undefined name `Model` | 11 | # F821 Undefined name `Model` 12 | x = cast("Model", x) | ^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_1.py:18:18: F821 Undefined name `Model` +F821_1.py:18:18: F821 Undefined name `Model` | 18 | # F821 Undefined name `Model` 19 | x = typing.cast("Model", x) | ^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_1.py:24:14: F821 Undefined name `Model` +F821_1.py:24:14: F821 Undefined name `Model` | 24 | # F821 Undefined name `Model` 25 | x = Pattern["Model"] | ^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_1.py:30:12: F821 Undefined name `Model` +F821_1.py:30:12: F821 Undefined name `Model` | 30 | # F821 Undefined name `Model` 31 | x = Match["Model"] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap index f8fdacb1c5..bd70af7d4a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_11.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_11.py:18:28: F821 Undefined name `os` +F821_11.py:18:28: F821 Undefined name `os` | 18 | def f(x: Callable[[VarArg("os")], None]): # F821 | ^^ F821 19 | pass | -./resources/test/fixtures/pyflakes/F821_11.py:23:14: F821 Undefined name `Baz` +F821_11.py:23:14: F821 Undefined name `Baz` | 23 | f(Callable[["Bar"], None]) 24 | f(Callable[["Baz"], None]) diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap index 690e432598..1a355e19bc 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_12.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_12.py:20:28: F821 Undefined name `os` +F821_12.py:20:28: F821 Undefined name `os` | 20 | def f(x: Callable[[VarArg("os")], None]): # F821 | ^^ F821 21 | pass | -./resources/test/fixtures/pyflakes/F821_12.py:25:14: F821 Undefined name `Baz` +F821_12.py:25:14: F821 Undefined name `Baz` | 25 | f(Callable[["Bar"], None]) 26 | f(Callable[["Baz"], None]) diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_13.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_13.py.snap index 5c98ae20af..a62ca30786 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_13.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_13.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_13.py:8:19: F821 Undefined name `List` +F821_13.py:8:19: F821 Undefined name `List` | 8 | Y: ForwardRef("List[int]") 9 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap index 4410a114de..c267751ca0 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_2.py:5:13: F821 Undefined name `Model` +F821_2.py:5:13: F821 Undefined name `Model` | 5 | # F821 Undefined name `Model` 6 | x: Literal["Model"] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap index c39e42bab0..66cd02b6f6 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_3.py:11:10: F821 Undefined name `key` +F821_3.py:11:10: F821 Undefined name `key` | 11 | # F821 Undefined name `key` 12 | # F821 Undefined name `value` @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 | # OK | -./resources/test/fixtures/pyflakes/F821_3.py:11:17: F821 Undefined name `value` +F821_3.py:11:17: F821 Undefined name `value` | 11 | # F821 Undefined name `key` 12 | # F821 Undefined name `value` diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap index 806372bb62..8ae8a5b2a1 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_4.py:4:11: F821 Undefined name `Model` +F821_4.py:4:11: F821 Undefined name `Model` | 4 | from typing import List 5 | @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | ^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_4.py:9:12: F821 Undefined name `Model` +F821_4.py:9:12: F821 Undefined name `Model` | 9 | from typing import List as IList 10 | @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | ^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_4.py:14:16: F821 Undefined name `Model` +F821_4.py:14:16: F821 Undefined name `Model` | 14 | from collections.abc import ItemsView 15 | @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | ^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_4.py:19:32: F821 Undefined name `Model` +F821_4.py:19:32: F821 Undefined name `Model` | 19 | import collections.abc 20 | @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | ^^^^^ F821 | -./resources/test/fixtures/pyflakes/F821_4.py:24:20: F821 Undefined name `Model` +F821_4.py:24:20: F821 Undefined name `Model` | 24 | from collections import abc 25 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap index 094d30c2ef..6f16b49258 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_5.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_5.py:5:31: F821 Undefined name `InnerClass` +F821_5.py:5:31: F821 Undefined name `InnerClass` | 5 | class RandomClass: 6 | def random_func(self) -> "InnerClass": diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap index 1c67768556..c0d5967cd8 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_7.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_7.py:11:22: F821 Undefined name `Undefined` +F821_7.py:11:22: F821 Undefined name `Undefined` | 11 | # Not OK 12 | _ = DefaultNamedArg("Undefined", name="some_prop_name") @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 14 | _ = DefaultNamedArg("Undefined", "some_prop_name") | -./resources/test/fixtures/pyflakes/F821_7.py:12:27: F821 Undefined name `Undefined` +F821_7.py:12:27: F821 Undefined name `Undefined` | 12 | # Not OK 13 | _ = DefaultNamedArg("Undefined", name="some_prop_name") @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 | _ = DefaultNamedArg("Undefined", "some_prop_name") | -./resources/test/fixtures/pyflakes/F821_7.py:13:22: F821 Undefined name `Undefined` +F821_7.py:13:22: F821 Undefined name `Undefined` | 13 | _ = DefaultNamedArg("Undefined", name="some_prop_name") 14 | _ = DefaultNamedArg(type="Undefined", name="some_prop_name") diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap index e1491b39d2..d7eb7ce76b 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F821_F821_9.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F821_9.py:22:20: F821 Undefined name `captured` +F821_9.py:22:20: F821 Undefined name `captured` | 22 | match provided: 23 | case True: diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap index 72a98ef3b5..31a9abc05a 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F822_0.py:3:1: F822 Undefined name `b` in `__all__` +F822_0.py:3:1: F822 Undefined name `b` in `__all__` | 3 | a = 1 4 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap index a7e4eda553..91153f5fea 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F822_F822_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F822_1.py:3:1: F822 Undefined name `b` in `__all__` +F822_1.py:3:1: F822 Undefined name `b` in `__all__` | 3 | a = 1 4 | diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap index d9ff4bf0c8..1fc86bc5d2 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F823_F823.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F823.py:6:5: F823 Local variable `my_var` referenced before assignment +F823.py:6:5: F823 Local variable `my_var` referenced before assignment | 6 | def foo(): 7 | my_var += 1 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap index 9006961162..a3ed914c1e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used +F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used | 3 | try: 4 | 1 / 0 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 5 | 6 6 | -./resources/test/fixtures/pyflakes/F841_0.py:16:5: F841 [*] Local variable `z` is assigned to but never used +F841_0.py:16:5: F841 [*] Local variable `z` is assigned to but never used | 16 | x = 1 17 | y = 2 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 18 18 | 19 19 | def f(): -./resources/test/fixtures/pyflakes/F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used +F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used | 20 | def f(): 21 | foo = (1, 2) @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 22 21 | 23 22 | bar = (1, 2) -./resources/test/fixtures/pyflakes/F841_0.py:21:6: F841 [*] Local variable `a` is assigned to but never used +F841_0.py:21:6: F841 [*] Local variable `a` is assigned to but never used | 21 | def f(): 22 | foo = (1, 2) @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `a` -./resources/test/fixtures/pyflakes/F841_0.py:21:9: F841 [*] Local variable `b` is assigned to but never used +F841_0.py:21:9: F841 [*] Local variable `b` is assigned to but never used | 21 | def f(): 22 | foo = (1, 2) @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `b` -./resources/test/fixtures/pyflakes/F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used +F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used | 26 | (c, d) = bar 27 | @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 28 28 | 29 29 | def f(): -./resources/test/fixtures/pyflakes/F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used +F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used | 51 | def c(): 52 | # F841 @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 53 53 | def d(): 54 54 | nonlocal b -./resources/test/fixtures/pyflakes/F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used | 79 | def f(): 80 | with open("file") as my_file, open("") as ((this, that)): @@ -138,7 +138,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 81 81 | 82 82 | -./resources/test/fixtures/pyflakes/F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used | 85 | def f(): 86 | with ( @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 87 87 | ): 88 88 | print("hello") -./resources/test/fixtures/pyflakes/F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used +F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used | 102 | msg1 = "Hello, world!" 103 | msg2 = "Hello, world!" @@ -179,7 +179,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 104 103 | case 1: 105 104 | print(msg1) -./resources/test/fixtures/pyflakes/F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used +F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used | 115 | Foo = enum.Enum("Foo", "A B") 116 | Bar = enum.Enum("Bar", "A B") @@ -200,7 +200,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 117 117 | match x: 118 118 | case (Foo.A): -./resources/test/fixtures/pyflakes/F841_0.py:122:14: F841 [*] Local variable `y` is assigned to but never used +F841_0.py:122:14: F841 [*] Local variable `y` is assigned to but never used | 122 | case [Bar.A, *_]: 123 | print("A") diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap index c9b1725555..171acd5e18 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F841_1.py:6:5: F841 [*] Local variable `x` is assigned to but never used +F841_1.py:6:5: F841 [*] Local variable `x` is assigned to but never used | 6 | def f(): 7 | x, y = 1, 2 # this triggers F841 as it's just a simple assignment where unpacking isn't needed @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `x` -./resources/test/fixtures/pyflakes/F841_1.py:6:8: F841 [*] Local variable `y` is assigned to but never used +F841_1.py:6:8: F841 [*] Local variable `y` is assigned to but never used | 6 | def f(): 7 | x, y = 1, 2 # this triggers F841 as it's just a simple assignment where unpacking isn't needed @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `y` -./resources/test/fixtures/pyflakes/F841_1.py:16:14: F841 [*] Local variable `coords` is assigned to but never used +F841_1.py:16:14: F841 [*] Local variable `coords` is assigned to but never used | 16 | def f(): 17 | (x, y) = coords = 1, 2 # this triggers F841 on coords @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 18 18 | 19 19 | def f(): -./resources/test/fixtures/pyflakes/F841_1.py:20:5: F841 [*] Local variable `coords` is assigned to but never used +F841_1.py:20:5: F841 [*] Local variable `coords` is assigned to but never used | 20 | def f(): 21 | coords = (x, y) = 1, 2 # this triggers F841 on coords @@ -53,7 +53,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 22 22 | 23 23 | def f(): -./resources/test/fixtures/pyflakes/F841_1.py:24:6: F841 [*] Local variable `a` is assigned to but never used +F841_1.py:24:6: F841 [*] Local variable `a` is assigned to but never used | 24 | def f(): 25 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `a` -./resources/test/fixtures/pyflakes/F841_1.py:24:9: F841 [*] Local variable `b` is assigned to but never used +F841_1.py:24:9: F841 [*] Local variable `b` is assigned to but never used | 24 | def f(): 25 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `b` -./resources/test/fixtures/pyflakes/F841_1.py:24:15: F841 [*] Local variable `x` is assigned to but never used +F841_1.py:24:15: F841 [*] Local variable `x` is assigned to but never used | 24 | def f(): 25 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `x` -./resources/test/fixtures/pyflakes/F841_1.py:24:18: F841 [*] Local variable `y` is assigned to but never used +F841_1.py:24:18: F841 [*] Local variable `y` is assigned to but never used | 24 | def f(): 25 | (a, b) = (x, y) = 1, 2 # this triggers F841 on everything diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap index 2d2f291aae..a04fb11f5e 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F841_F841_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F841_3.py:5:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:5:5: F841 [*] Local variable `x` is assigned to but never used | 5 | def f(): 6 | x = 1 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 7 6 | 8 7 | z = 3 -./resources/test/fixtures/pyflakes/F841_3.py:6:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:6:5: F841 [*] Local variable `y` is assigned to but never used | 6 | def f(): 7 | x = 1 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 8 7 | z = 3 9 8 | print(z) -./resources/test/fixtures/pyflakes/F841_3.py:13:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:13:5: F841 [*] Local variable `x` is assigned to but never used | 13 | def f(): 14 | x: int = 1 @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 15 14 | 16 15 | z: int = 3 -./resources/test/fixtures/pyflakes/F841_3.py:14:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:14:5: F841 [*] Local variable `y` is assigned to but never used | 14 | def f(): 15 | x: int = 1 @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 16 15 | z: int = 3 17 16 | print(z) -./resources/test/fixtures/pyflakes/F841_3.py:21:19: F841 [*] Local variable `x1` is assigned to but never used +F841_3.py:21:19: F841 [*] Local variable `x1` is assigned to but never used | 21 | def f(): 22 | with foo() as x1: @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 23 23 | 24 24 | with foo() as (x2, y2): -./resources/test/fixtures/pyflakes/F841_3.py:27:20: F841 [*] Local variable `x3` is assigned to but never used +F841_3.py:27:20: F841 [*] Local variable `x3` is assigned to but never used | 27 | pass 28 | @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 29 29 | 30 30 | -./resources/test/fixtures/pyflakes/F841_3.py:27:33: F841 [*] Local variable `y3` is assigned to but never used +F841_3.py:27:33: F841 [*] Local variable `y3` is assigned to but never used | 27 | pass 28 | @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 29 29 | 30 30 | -./resources/test/fixtures/pyflakes/F841_3.py:27:46: F841 [*] Local variable `z3` is assigned to but never used +F841_3.py:27:46: F841 [*] Local variable `z3` is assigned to but never used | 27 | pass 28 | @@ -156,7 +156,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 29 29 | 30 30 | -./resources/test/fixtures/pyflakes/F841_3.py:32:6: F841 [*] Local variable `x1` is assigned to but never used +F841_3.py:32:6: F841 [*] Local variable `x1` is assigned to but never used | 32 | def f(): 33 | (x1, y1) = (1, 2) @@ -166,7 +166,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `x1` -./resources/test/fixtures/pyflakes/F841_3.py:32:10: F841 [*] Local variable `y1` is assigned to but never used +F841_3.py:32:10: F841 [*] Local variable `y1` is assigned to but never used | 32 | def f(): 33 | (x1, y1) = (1, 2) @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `y1` -./resources/test/fixtures/pyflakes/F841_3.py:33:16: F841 [*] Local variable `coords2` is assigned to but never used +F841_3.py:33:16: F841 [*] Local variable `coords2` is assigned to but never used | 33 | def f(): 34 | (x1, y1) = (1, 2) @@ -196,7 +196,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 35 35 | 36 36 | -./resources/test/fixtures/pyflakes/F841_3.py:34:5: F841 [*] Local variable `coords3` is assigned to but never used +F841_3.py:34:5: F841 [*] Local variable `coords3` is assigned to but never used | 34 | (x1, y1) = (1, 2) 35 | (x2, y2) = coords2 = (1, 2) @@ -215,7 +215,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 36 36 | 37 37 | def f(): -./resources/test/fixtures/pyflakes/F841_3.py:40:26: F841 [*] Local variable `x1` is assigned to but never used +F841_3.py:40:26: F841 [*] Local variable `x1` is assigned to but never used | 40 | try: 41 | 1 / 0 @@ -235,7 +235,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 42 42 | 43 43 | try: -./resources/test/fixtures/pyflakes/F841_3.py:45:47: F841 [*] Local variable `x2` is assigned to but never used +F841_3.py:45:47: F841 [*] Local variable `x2` is assigned to but never used | 45 | try: 46 | 1 / 0 @@ -255,7 +255,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 47 47 | 48 48 | -./resources/test/fixtures/pyflakes/F841_3.py:50:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:50:5: F841 [*] Local variable `x` is assigned to but never used | 50 | def f(a, b): 51 | x = ( @@ -275,7 +275,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 52 52 | if a is not None 53 53 | else b -./resources/test/fixtures/pyflakes/F841_3.py:56:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:56:5: F841 [*] Local variable `y` is assigned to but never used | 56 | ) 57 | @@ -296,7 +296,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 59 58 | 60 59 | def f(a, b): -./resources/test/fixtures/pyflakes/F841_3.py:61:5: F841 [*] Local variable `x` is assigned to but never used +F841_3.py:61:5: F841 [*] Local variable `x` is assigned to but never used | 61 | def f(a, b): 62 | x = ( @@ -320,7 +320,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 67 63 | y = \ 68 64 | a if a is not None else b -./resources/test/fixtures/pyflakes/F841_3.py:67:5: F841 [*] Local variable `y` is assigned to but never used +F841_3.py:67:5: F841 [*] Local variable `y` is assigned to but never used | 67 | ) 68 | @@ -340,7 +340,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 70 68 | 71 69 | def f(): -./resources/test/fixtures/pyflakes/F841_3.py:72:24: F841 [*] Local variable `cm` is assigned to but never used +F841_3.py:72:24: F841 [*] Local variable `cm` is assigned to but never used | 72 | def f(): 73 | with Nested(m) as (cm): @@ -359,7 +359,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 74 74 | 75 75 | -./resources/test/fixtures/pyflakes/F841_3.py:77:25: F841 [*] Local variable `cm` is assigned to but never used +F841_3.py:77:25: F841 [*] Local variable `cm` is assigned to but never used | 77 | def f(): 78 | with (Nested(m) as (cm),): @@ -378,7 +378,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 79 79 | 80 80 | -./resources/test/fixtures/pyflakes/F841_3.py:87:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:87:5: F841 [*] Local variable `toplevel` is assigned to but never used | 87 | def f(): 88 | toplevel = tt = lexer.get_token() @@ -398,7 +398,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 89 89 | break 90 90 | -./resources/test/fixtures/pyflakes/F841_3.py:93:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:93:5: F841 [*] Local variable `toplevel` is assigned to but never used | 93 | def f(): 94 | toplevel = tt = lexer.get_token() @@ -416,7 +416,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 95 95 | 96 96 | def f(): -./resources/test/fixtures/pyflakes/F841_3.py:93:16: F841 [*] Local variable `tt` is assigned to but never used +F841_3.py:93:16: F841 [*] Local variable `tt` is assigned to but never used | 93 | def f(): 94 | toplevel = tt = lexer.get_token() @@ -434,7 +434,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 95 95 | 96 96 | def f(): -./resources/test/fixtures/pyflakes/F841_3.py:97:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:97:5: F841 [*] Local variable `toplevel` is assigned to but never used | 97 | def f(): 98 | toplevel = (a, b) = lexer.get_token() @@ -452,7 +452,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 99 99 | 100 100 | def f(): -./resources/test/fixtures/pyflakes/F841_3.py:101:14: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:101:14: F841 [*] Local variable `toplevel` is assigned to but never used | 101 | def f(): 102 | (a, b) = toplevel = lexer.get_token() @@ -470,7 +470,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 103 103 | 104 104 | def f(): -./resources/test/fixtures/pyflakes/F841_3.py:105:5: F841 [*] Local variable `toplevel` is assigned to but never used +F841_3.py:105:5: F841 [*] Local variable `toplevel` is assigned to but never used | 105 | def f(): 106 | toplevel = tt = 1 @@ -485,7 +485,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 105 |- toplevel = tt = 1 105 |+ tt = 1 -./resources/test/fixtures/pyflakes/F841_3.py:105:16: F841 [*] Local variable `tt` is assigned to but never used +F841_3.py:105:16: F841 [*] Local variable `tt` is assigned to but never used | 105 | def f(): 106 | toplevel = tt = 1 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap index 07ed364ab1..6c15b46108 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F842_F842.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F842.py:2:5: F842 Local variable `name` is annotated but never used +F842.py:2:5: F842 Local variable `name` is annotated but never used | 2 | def f(): 3 | name: str @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 | age: int | -./resources/test/fixtures/pyflakes/F842.py:3:5: F842 Local variable `age` is annotated but never used +F842.py:3:5: F842 Local variable `age` is annotated but never used | 3 | def f(): 4 | name: str diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap index 31e233753b..844ac58fbe 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__F901_F901.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F901.py:2:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedError` +F901.py:2:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedError` | 2 | def f() -> None: 3 | raise NotImplemented() @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 4 4 | 5 5 | def g() -> None: -./resources/test/fixtures/pyflakes/F901.py:6:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedError` +F901.py:6:11: F901 [*] `raise NotImplemented` should be `raise NotImplementedError` | 6 | def g() -> None: 7 | raise NotImplemented diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap index c8bfa5c859..0ba1ffc048 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_builtins.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/builtins.py:1:1: F821 Undefined name `_` +builtins.py:1:1: F821 Undefined name `_` | 1 | _("Translations") | ^ F821 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap index 160e08da3f..71270c7714 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__default_typing_modules.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/typing_modules.py:6:36: F821 Undefined name `db` +typing_modules.py:6:36: F821 Undefined name `db` | 6 | X = Union[Literal[False], Literal["db"]] | ^^ F821 diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap index a6d8e86c85..304bb3aaa1 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__extra_typing_modules.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/typing_modules.py:7:15: F821 Undefined name `Class` +typing_modules.py:7:15: F821 Undefined name `Class` | 7 | X = Union[Literal[False], Literal["db"]] 8 | y = Optional["Class"] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap index 03ced2edf7..cb7da80550 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__f841_dummy_variable_rgx.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used +F841_0.py:3:22: F841 [*] Local variable `e` is assigned to but never used | 3 | try: 4 | 1 / 0 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 5 | 6 6 | -./resources/test/fixtures/pyflakes/F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used +F841_0.py:20:5: F841 [*] Local variable `foo` is assigned to but never used | 20 | def f(): 21 | foo = (1, 2) @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 22 21 | 23 22 | bar = (1, 2) -./resources/test/fixtures/pyflakes/F841_0.py:21:6: F841 [*] Local variable `a` is assigned to but never used +F841_0.py:21:6: F841 [*] Local variable `a` is assigned to but never used | 21 | def f(): 22 | foo = (1, 2) @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `a` -./resources/test/fixtures/pyflakes/F841_0.py:21:9: F841 [*] Local variable `b` is assigned to but never used +F841_0.py:21:9: F841 [*] Local variable `b` is assigned to but never used | 21 | def f(): 22 | foo = (1, 2) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs | = help: Remove assignment to unused variable `b` -./resources/test/fixtures/pyflakes/F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used +F841_0.py:26:14: F841 [*] Local variable `baz` is assigned to but never used | 26 | (c, d) = bar 27 | @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 28 28 | 29 29 | def f(): -./resources/test/fixtures/pyflakes/F841_0.py:35:5: F841 [*] Local variable `_` is assigned to but never used +F841_0.py:35:5: F841 [*] Local variable `_` is assigned to but never used | 35 | def f(): 36 | _ = 1 @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 37 36 | _discarded = 1 38 37 | -./resources/test/fixtures/pyflakes/F841_0.py:36:5: F841 [*] Local variable `__` is assigned to but never used +F841_0.py:36:5: F841 [*] Local variable `__` is assigned to but never used | 36 | def f(): 37 | _ = 1 @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 38 37 | 39 38 | -./resources/test/fixtures/pyflakes/F841_0.py:37:5: F841 [*] Local variable `_discarded` is assigned to but never used +F841_0.py:37:5: F841 [*] Local variable `_discarded` is assigned to but never used | 37 | _ = 1 38 | __ = 1 @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 39 39 | 40 40 | a = 1 -./resources/test/fixtures/pyflakes/F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used +F841_0.py:51:9: F841 [*] Local variable `b` is assigned to but never used | 51 | def c(): 52 | # F841 @@ -157,7 +157,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 53 53 | def d(): 54 54 | nonlocal b -./resources/test/fixtures/pyflakes/F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:79:26: F841 [*] Local variable `my_file` is assigned to but never used | 79 | def f(): 80 | with open("file") as my_file, open("") as ((this, that)): @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 81 81 | 82 82 | -./resources/test/fixtures/pyflakes/F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used +F841_0.py:85:25: F841 [*] Local variable `my_file` is assigned to but never used | 85 | def f(): 86 | with ( @@ -197,7 +197,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 87 87 | ): 88 88 | print("hello") -./resources/test/fixtures/pyflakes/F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used +F841_0.py:102:5: F841 [*] Local variable `msg3` is assigned to but never used | 102 | msg1 = "Hello, world!" 103 | msg2 = "Hello, world!" @@ -217,7 +217,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 104 103 | case 1: 105 104 | print(msg1) -./resources/test/fixtures/pyflakes/F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used +F841_0.py:115:5: F841 [*] Local variable `Baz` is assigned to but never used | 115 | Foo = enum.Enum("Foo", "A B") 116 | Bar = enum.Enum("Bar", "A B") @@ -238,7 +238,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 117 117 | match x: 118 118 | case (Foo.A): -./resources/test/fixtures/pyflakes/F841_0.py:122:14: F841 [*] Local variable `y` is assigned to but never used +F841_0.py:122:14: F841 [*] Local variable `y` is assigned to but never used | 122 | case [Bar.A, *_]: 123 | print("A") diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap index ffde30e2d6..4f4798bbc5 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__future_annotations.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/future_annotations.py:8:5: F401 [*] `models.Nut` imported but unused +future_annotations.py:8:5: F401 [*] `models.Nut` imported but unused | 8 | from models import ( 9 | Fruit, @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 10 9 | 11 10 | -./resources/test/fixtures/pyflakes/future_annotations.py:26:19: F821 Undefined name `Bar` +future_annotations.py:26:19: F821 Undefined name `Bar` | 26 | @classmethod 27 | def c(cls) -> Bar: diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap index 792f6aa848..c64d795112 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__multi_statement_lines.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/multi_statement_lines.py:3:12: F401 [*] `foo1` imported but unused +multi_statement_lines.py:3:12: F401 [*] `foo1` imported but unused | 3 | if True: 4 | import foo1; x = 1 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 5 5 | 6 6 | if True: -./resources/test/fixtures/pyflakes/multi_statement_lines.py:4:12: F401 [*] `foo2` imported but unused +multi_statement_lines.py:4:12: F401 [*] `foo2` imported but unused | 4 | if True: 5 | import foo1; x = 1 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 6 6 | if True: 7 7 | import foo3; \ -./resources/test/fixtures/pyflakes/multi_statement_lines.py:7:12: F401 [*] `foo3` imported but unused +multi_statement_lines.py:7:12: F401 [*] `foo3` imported but unused | 7 | if True: 8 | import foo3; \ @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 10 9 | if True: 11 10 | import foo4 \ -./resources/test/fixtures/pyflakes/multi_statement_lines.py:11:12: F401 [*] `foo4` imported but unused +multi_statement_lines.py:11:12: F401 [*] `foo4` imported but unused | 11 | if True: 12 | import foo4 \ @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 14 13 | 15 14 | if True: -./resources/test/fixtures/pyflakes/multi_statement_lines.py:16:19: F401 [*] `foo5` imported but unused +multi_statement_lines.py:16:19: F401 [*] `foo5` imported but unused | 16 | if True: 17 | x = 1; import foo5 @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 18 18 | 19 19 | if True: -./resources/test/fixtures/pyflakes/multi_statement_lines.py:21:17: F401 [*] `foo6` imported but unused +multi_statement_lines.py:21:17: F401 [*] `foo6` imported but unused | 21 | if True: 22 | x = 1; \ @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 23 23 | 24 24 | if True: -./resources/test/fixtures/pyflakes/multi_statement_lines.py:26:18: F401 [*] `foo7` imported but unused +multi_statement_lines.py:26:18: F401 [*] `foo7` imported but unused | 26 | if True: 27 | x = 1 \ @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 28 28 | 29 29 | if True: -./resources/test/fixtures/pyflakes/multi_statement_lines.py:30:19: F401 [*] `foo8` imported but unused +multi_statement_lines.py:30:19: F401 [*] `foo8` imported but unused | 30 | if True: 31 | x = 1; import foo8; x = 1 @@ -155,7 +155,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 32 32 | 33 33 | if True: -./resources/test/fixtures/pyflakes/multi_statement_lines.py:31:23: F401 [*] `foo9` imported but unused +multi_statement_lines.py:31:23: F401 [*] `foo9` imported but unused | 31 | if True: 32 | x = 1; import foo8; x = 1 @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 33 33 | if True: 34 34 | x = 1; \ -./resources/test/fixtures/pyflakes/multi_statement_lines.py:35:16: F401 [*] `foo10` imported but unused +multi_statement_lines.py:35:16: F401 [*] `foo10` imported but unused | 35 | if True: 36 | x = 1; \ @@ -197,7 +197,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 38 37 | if True: 39 38 | x = 1 \ -./resources/test/fixtures/pyflakes/multi_statement_lines.py:40:17: F401 [*] `foo11` imported but unused +multi_statement_lines.py:40:17: F401 [*] `foo11` imported but unused | 40 | if True: 41 | x = 1 \ @@ -216,7 +216,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 42 41 | 43 42 | -./resources/test/fixtures/pyflakes/multi_statement_lines.py:46:8: F401 [*] `foo12` imported but unused +multi_statement_lines.py:46:8: F401 [*] `foo12` imported but unused | 46 | # Continuation, but not as the last content in the file. 47 | x = 1; \ @@ -238,7 +238,7 @@ source: crates/ruff/src/rules/pyflakes/mod.rs 49 49 | # error.) 50 50 | x = 1; \ -./resources/test/fixtures/pyflakes/multi_statement_lines.py:51:8: F401 [*] `foo13` imported but unused +multi_statement_lines.py:51:8: F401 [*] `foo13` imported but unused | 51 | # error.) 52 | x = 1; \ diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap index 60650e502c..f695f7a80d 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__nested_relative_typing_module.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/project/foo/bop/baz.py:26:17: F821 Undefined name `foo` +baz.py:26:17: F821 Undefined name `foo` | 26 | # F821 27 | x: Literal["foo"] | ^^^ F821 | -./resources/test/fixtures/pyflakes/project/foo/bop/baz.py:33:17: F821 Undefined name `foo` +baz.py:33:17: F821 Undefined name `foo` | 33 | # F821 34 | x: Literal["foo"] diff --git a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap index 0d4dd9335b..5dae6dda47 100644 --- a/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap +++ b/crates/ruff/src/rules/pyflakes/snapshots/ruff__rules__pyflakes__tests__relative_typing_module.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyflakes/mod.rs --- -./resources/test/fixtures/pyflakes/project/foo/bar.py:26:17: F821 Undefined name `foo` +bar.py:26:17: F821 Undefined name `foo` | 26 | # F821 27 | x: Literal["foo"] diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap index 2d010e76a2..e86e87f5e4 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH001_PGH001_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pygrep_hooks/mod.rs --- -./resources/test/fixtures/pygrep-hooks/PGH001_0.py:3:1: PGH001 No builtin `eval()` allowed +PGH001_0.py:3:1: PGH001 No builtin `eval()` allowed | 3 | from ast import literal_eval 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 7 | literal_eval({1: 2}) | -./resources/test/fixtures/pygrep-hooks/PGH001_0.py:9:5: PGH001 No builtin `eval()` allowed +PGH001_0.py:9:5: PGH001 No builtin `eval()` allowed | 9 | def fn() -> None: 10 | eval("3 + 4") diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap index 5a0de12695..fc802665f6 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH002_PGH002_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pygrep_hooks/mod.rs --- -./resources/test/fixtures/pygrep-hooks/PGH002_1.py:4:1: PGH002 `warn` is deprecated in favor of `warning` +PGH002_1.py:4:1: PGH002 `warn` is deprecated in favor of `warning` | 4 | from logging import warn 5 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 7 | warn("not ok") | -./resources/test/fixtures/pygrep-hooks/PGH002_1.py:5:1: PGH002 `warn` is deprecated in favor of `warning` +PGH002_1.py:5:1: PGH002 `warn` is deprecated in favor of `warning` | 5 | logging.warn("this is not ok") 6 | warn("not ok") diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap index f51c8a6433..12f724586a 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH003_PGH003_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pygrep_hooks/mod.rs --- -./resources/test/fixtures/pygrep-hooks/PGH003_0.py:1:8: PGH003 Use specific rule codes when ignoring type issues +PGH003_0.py:1:8: PGH003 Use specific rule codes when ignoring type issues | 1 | x = 1 # type: ignore | ^^^^^^^^^^^^^^ PGH003 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 3 | x = 1 # type:ignore | -./resources/test/fixtures/pygrep-hooks/PGH003_0.py:2:8: PGH003 Use specific rule codes when ignoring type issues +PGH003_0.py:2:8: PGH003 Use specific rule codes when ignoring type issues | 2 | x = 1 # type: ignore 3 | x = 1 # type ignore @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 4 | x = 1 # type:ignore | -./resources/test/fixtures/pygrep-hooks/PGH003_0.py:3:8: PGH003 Use specific rule codes when ignoring type issues +PGH003_0.py:3:8: PGH003 Use specific rule codes when ignoring type issues | 3 | x = 1 # type: ignore 4 | x = 1 # type ignore diff --git a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap index 776da338f8..b27e3a5577 100644 --- a/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap +++ b/crates/ruff/src/rules/pygrep_hooks/snapshots/ruff__rules__pygrep_hooks__tests__PGH004_PGH004_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pygrep_hooks/mod.rs --- -./resources/test/fixtures/pygrep-hooks/PGH004_0.py:1:8: PGH004 Use specific rule codes when using `noqa` +PGH004_0.py:1:8: PGH004 Use specific rule codes when using `noqa` | 1 | x = 1 # noqa | ^^^^^^ PGH004 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 3 | # noqa | -./resources/test/fixtures/pygrep-hooks/PGH004_0.py:2:8: PGH004 Use specific rule codes when using `noqa` +PGH004_0.py:2:8: PGH004 Use specific rule codes when using `noqa` | 2 | x = 1 # noqa 3 | x = 1 # NOQA:F401,W203 @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 5 | # NOQA | -./resources/test/fixtures/pygrep-hooks/PGH004_0.py:3:1: PGH004 Use specific rule codes when using `noqa` +PGH004_0.py:3:1: PGH004 Use specific rule codes when using `noqa` | 3 | x = 1 # noqa 4 | x = 1 # NOQA:F401,W203 @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 7 | # noqa:F401 | -./resources/test/fixtures/pygrep-hooks/PGH004_0.py:4:1: PGH004 Use specific rule codes when using `noqa` +PGH004_0.py:4:1: PGH004 Use specific rule codes when using `noqa` | 4 | x = 1 # NOQA:F401,W203 5 | # noqa @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 8 | # noqa:F401,W203 | -./resources/test/fixtures/pygrep-hooks/PGH004_0.py:5:1: PGH004 Use specific rule codes when using `noqa` +PGH004_0.py:5:1: PGH004 Use specific rule codes when using `noqa` | 5 | # noqa 6 | # NOQA @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/pygrep_hooks/mod.rs 8 | # noqa:F401,W203 | -./resources/test/fixtures/pygrep-hooks/PGH004_0.py:6:1: PGH004 Use specific rule codes when using `noqa` +PGH004_0.py:6:1: PGH004 Use specific rule codes when using `noqa` | 6 | # NOQA 7 | # noqa:F401 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap index e9385613b7..990a77d6c5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC0414_import_aliasing.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/import_aliasing.py:6:8: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:6:8: PLC0414 [*] Import alias does not rename original package | 6 | # 2. consider-using-from-import 7 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 8 | from collections import OrderedDict as o_dict 9 9 | import os.path as path # [consider-using-from-import] -./resources/test/fixtures/pylint/import_aliasing.py:7:25: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:7:25: PLC0414 [*] Import alias does not rename original package | 7 | import collections as collections # [useless-import-alias] 8 | from collections import OrderedDict as OrderedDict # [useless-import-alias] @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 9 | import os.path as path # [consider-using-from-import] 10 10 | import os.path as p -./resources/test/fixtures/pylint/import_aliasing.py:16:15: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:16:15: PLC0414 [*] Import alias does not rename original package | 16 | import os as OS 17 | from sys import version @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 18 18 | from . import bar 19 19 | from ..foo import bar as bar # [useless-import-alias] -./resources/test/fixtures/pylint/import_aliasing.py:19:19: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:19:19: PLC0414 [*] Import alias does not rename original package | 19 | from . import bar as Bar 20 | from . import bar @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 21 21 | from ..foo.bar import foobar as anotherfoobar 22 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias] -./resources/test/fixtures/pylint/import_aliasing.py:20:23: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:20:23: PLC0414 [*] Import alias does not rename original package | 20 | from . import bar 21 | from ..foo import bar as bar # [useless-import-alias] @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 22 22 | from . import foo as foo, foo2 as bar2 # [useless-import-alias] 23 23 | from . import foo as bar, foo2 as foo2 # [useless-import-alias] -./resources/test/fixtures/pylint/import_aliasing.py:22:15: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:22:15: PLC0414 [*] Import alias does not rename original package | 22 | from ..foo.bar import foobar as foobar # [useless-import-alias] 23 | from ..foo.bar import foobar as anotherfoobar @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 24 24 | from . import foo as bar, foo2 as bar2 25 25 | from foo.bar import foobar as foobar # [useless-import-alias] -./resources/test/fixtures/pylint/import_aliasing.py:23:27: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:23:27: PLC0414 [*] Import alias does not rename original package | 23 | from ..foo.bar import foobar as anotherfoobar 24 | from . import foo as foo, foo2 as bar2 # [useless-import-alias] @@ -147,7 +147,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 25 25 | from foo.bar import foobar as foobar # [useless-import-alias] 26 26 | from foo.bar import foobar as foo -./resources/test/fixtures/pylint/import_aliasing.py:25:21: PLC0414 [*] Import alias does not rename original package +import_aliasing.py:25:21: PLC0414 [*] Import alias does not rename original package | 25 | from . import foo as bar, foo2 as foo2 # [useless-import-alias] 26 | from . import foo as bar, foo2 as bar2 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap index 4f501b12ca..ed4f6ad32f 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC1901_compare_to_empty_string.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/compare_to_empty_string.py:7:13: PLC1901 `x is ""` can be simplified to `not x` as an empty string is falsey +compare_to_empty_string.py:7:13: PLC1901 `x is ""` can be simplified to `not x` as an empty string is falsey | 7 | def errors(): 8 | if x is "" or x == "": @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | print("x is an empty string") | -./resources/test/fixtures/pylint/compare_to_empty_string.py:7:24: PLC1901 `x == ""` can be simplified to `not x` as an empty string is falsey +compare_to_empty_string.py:7:24: PLC1901 `x == ""` can be simplified to `not x` as an empty string is falsey | 7 | def errors(): 8 | if x is "" or x == "": @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | print("x is an empty string") | -./resources/test/fixtures/pylint/compare_to_empty_string.py:10:17: PLC1901 `y is not ""` can be simplified to `y` as an empty string is falsey +compare_to_empty_string.py:10:17: PLC1901 `y is not ""` can be simplified to `y` as an empty string is falsey | 10 | print("x is an empty string") 11 | @@ -26,7 +26,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 | print("y is not an empty string") | -./resources/test/fixtures/pylint/compare_to_empty_string.py:10:28: PLC1901 `y != ""` can be simplified to `y` as an empty string is falsey +compare_to_empty_string.py:10:28: PLC1901 `y != ""` can be simplified to `y` as an empty string is falsey | 10 | print("x is an empty string") 11 | @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 | print("y is not an empty string") | -./resources/test/fixtures/pylint/compare_to_empty_string.py:13:8: PLC1901 `"" != z` can be simplified to `z` as an empty string is falsey +compare_to_empty_string.py:13:8: PLC1901 `"" != z` can be simplified to `z` as an empty string is falsey | 13 | print("y is not an empty string") 14 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap index 89bf904eff..58d9abf8af 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLC3002_unnecessary_direct_lambda_call.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/unnecessary_direct_lambda_call.py:4:5: PLC3002 Lambda expression called directly. Execute the expression inline instead. +unnecessary_direct_lambda_call.py:4:5: PLC3002 Lambda expression called directly. Execute the expression inline instead. | 4 | # pylint: disable=undefined-variable, line-too-long 5 | @@ -10,14 +10,14 @@ source: crates/ruff/src/rules/pylint/mod.rs 7 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call] | -./resources/test/fixtures/pylint/unnecessary_direct_lambda_call.py:5:9: PLC3002 Lambda expression called directly. Execute the expression inline instead. +unnecessary_direct_lambda_call.py:5:9: PLC3002 Lambda expression called directly. Execute the expression inline instead. | 5 | y = (lambda x: x**2 + 2*x + 1)(a) # [unnecessary-direct-lambda-call] 6 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call] | ^^^^^^^^^^^^^^^^^^^ PLC3002 | -./resources/test/fixtures/pylint/unnecessary_direct_lambda_call.py:5:30: PLC3002 Lambda expression called directly. Execute the expression inline instead. +unnecessary_direct_lambda_call.py:5:30: PLC3002 Lambda expression called directly. Execute the expression inline instead. | 5 | y = (lambda x: x**2 + 2*x + 1)(a) # [unnecessary-direct-lambda-call] 6 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a)) # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call] diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap index d3fab1131a..25cad6b522 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0100_yield_in_init.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/yield_in_init.py:9:9: PLE0100 `__init__` method is a generator +yield_in_init.py:9:9: PLE0100 `__init__` method is a generator | 9 | class A: 10 | def __init__(self): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | ^^^^^ PLE0100 | -./resources/test/fixtures/pylint/yield_in_init.py:14:9: PLE0100 `__init__` method is a generator +yield_in_init.py:14:9: PLE0100 `__init__` method is a generator | 14 | class B: 15 | def __init__(self): diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap index e7dd79853c..d90c7380dc 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0101_return_in_init.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/return_in_init.py:14:9: PLE0101 Explicit return in `__init__` +return_in_init.py:14:9: PLE0101 Explicit return in `__init__` | 14 | class B: 15 | def __init__(self): @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 18 | def gen(self): | -./resources/test/fixtures/pylint/return_in_init.py:22:9: PLE0101 Explicit return in `__init__` +return_in_init.py:22:9: PLE0101 Explicit return in `__init__` | 22 | def __init__(self): 23 | return 1 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap index 0933249296..cc14b207dc 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0117_nonlocal_without_binding.py.snap @@ -1,21 +1,21 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/nonlocal_without_binding.py:5:14: PLE0117 Nonlocal name `x` found without binding +nonlocal_without_binding.py:5:14: PLE0117 Nonlocal name `x` found without binding | 5 | def f(): 6 | nonlocal x | ^ PLE0117 | -./resources/test/fixtures/pylint/nonlocal_without_binding.py:9:14: PLE0117 Nonlocal name `y` found without binding +nonlocal_without_binding.py:9:14: PLE0117 Nonlocal name `y` found without binding | 9 | def f(): 10 | nonlocal y | ^ PLE0117 | -./resources/test/fixtures/pylint/nonlocal_without_binding.py:19:18: PLE0117 Nonlocal name `y` found without binding +nonlocal_without_binding.py:19:18: PLE0117 Nonlocal name `y` found without binding | 19 | def f(): 20 | nonlocal y diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap index 41fd1dfbee..a949dcfc5e 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0118_load_before_global_declaration.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/load_before_global_declaration.py:5:11: PLE0118 Name `x` is used prior to global declaration on line 7 +load_before_global_declaration.py:5:11: PLE0118 Name `x` is used prior to global declaration on line 7 | 5 | ### 6 | def f(): @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | global x | -./resources/test/fixtures/pylint/load_before_global_declaration.py:15:11: PLE0118 Name `x` is used prior to global declaration on line 17 +load_before_global_declaration.py:15:11: PLE0118 Name `x` is used prior to global declaration on line 17 | 15 | global x 16 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 19 | global x | -./resources/test/fixtures/pylint/load_before_global_declaration.py:23:11: PLE0118 Name `x` is used prior to global declaration on line 25 +load_before_global_declaration.py:23:11: PLE0118 Name `x` is used prior to global declaration on line 25 | 23 | def f(): 24 | print(x) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 26 | global x, y | -./resources/test/fixtures/pylint/load_before_global_declaration.py:33:11: PLE0118 Name `x` is used prior to global declaration on line 35 +load_before_global_declaration.py:33:11: PLE0118 Name `x` is used prior to global declaration on line 35 | 33 | global x, y 34 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 37 | global x, y | -./resources/test/fixtures/pylint/load_before_global_declaration.py:41:5: PLE0118 Name `x` is used prior to global declaration on line 43 +load_before_global_declaration.py:41:5: PLE0118 Name `x` is used prior to global declaration on line 43 | 41 | def f(): 42 | x = 1 @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 44 | global x | -./resources/test/fixtures/pylint/load_before_global_declaration.py:51:5: PLE0118 Name `x` is used prior to global declaration on line 53 +load_before_global_declaration.py:51:5: PLE0118 Name `x` is used prior to global declaration on line 53 | 51 | global x 52 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 55 | global x | -./resources/test/fixtures/pylint/load_before_global_declaration.py:59:9: PLE0118 Name `x` is used prior to global declaration on line 61 +load_before_global_declaration.py:59:9: PLE0118 Name `x` is used prior to global declaration on line 61 | 59 | def f(): 60 | del x @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 62 | global x, y | -./resources/test/fixtures/pylint/load_before_global_declaration.py:69:9: PLE0118 Name `x` is used prior to global declaration on line 71 +load_before_global_declaration.py:69:9: PLE0118 Name `x` is used prior to global declaration on line 71 | 69 | global x, y 70 | @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 73 | global x, y | -./resources/test/fixtures/pylint/load_before_global_declaration.py:77:9: PLE0118 Name `x` is used prior to global declaration on line 79 +load_before_global_declaration.py:77:9: PLE0118 Name `x` is used prior to global declaration on line 79 | 77 | def f(): 78 | del x @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 80 | global x | -./resources/test/fixtures/pylint/load_before_global_declaration.py:87:9: PLE0118 Name `x` is used prior to global declaration on line 89 +load_before_global_declaration.py:87:9: PLE0118 Name `x` is used prior to global declaration on line 89 | 87 | global x 88 | @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 91 | global x | -./resources/test/fixtures/pylint/load_before_global_declaration.py:95:9: PLE0118 Name `x` is used prior to global declaration on line 97 +load_before_global_declaration.py:95:9: PLE0118 Name `x` is used prior to global declaration on line 97 | 95 | def f(): 96 | del x @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 98 | global x, y | -./resources/test/fixtures/pylint/load_before_global_declaration.py:105:9: PLE0118 Name `x` is used prior to global declaration on line 107 +load_before_global_declaration.py:105:9: PLE0118 Name `x` is used prior to global declaration on line 107 | 105 | global x, y 106 | @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 109 | global x, y | -./resources/test/fixtures/pylint/load_before_global_declaration.py:113:14: PLE0118 Name `x` is used prior to global declaration on line 114 +load_before_global_declaration.py:113:14: PLE0118 Name `x` is used prior to global declaration on line 114 | 113 | def f(): 114 | print(f"{x=}") diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap index 1029ea06b6..579cf49850 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0604_invalid_all_object.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_all_object.py:1:1: PLE0604 Invalid object in `__all__`, must contain only strings +invalid_all_object.py:1:1: PLE0604 Invalid object in `__all__`, must contain only strings | 1 | __all__ = ( | ^^^^^^^ PLE0604 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 3 | Fruit, | -./resources/test/fixtures/pylint/invalid_all_object.py:7:1: PLE0604 Invalid object in `__all__`, must contain only strings +invalid_all_object.py:7:1: PLE0604 Invalid object in `__all__`, must contain only strings | 7 | ) 8 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap index 27476a8c56..6810d72ac1 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE0605_invalid_all_format.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_all_format.py:1:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:1:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 1 | __all__ = "CONST" # [invalid-all-format] | ^^^^^^^ PLE0605 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 3 | __all__ = ["Hello"] + {"world"} # [invalid-all-format] | -./resources/test/fixtures/pylint/invalid_all_format.py:3:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:3:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 3 | __all__ = "CONST" # [invalid-all-format] 4 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 7 | __all__ += {"world"} # [invalid-all-format] | -./resources/test/fixtures/pylint/invalid_all_format.py:5:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:5:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 5 | __all__ = ["Hello"] + {"world"} # [invalid-all-format] 6 | @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | __all__ = {"world"} + ["Hello"] # [invalid-all-format] | -./resources/test/fixtures/pylint/invalid_all_format.py:7:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:7:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 7 | __all__ += {"world"} # [invalid-all-format] 8 | @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 11 | __all__ = {"world"} + list(["Hello"]) # [invalid-all-format] | -./resources/test/fixtures/pylint/invalid_all_format.py:9:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:9:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 9 | __all__ = {"world"} + ["Hello"] # [invalid-all-format] 10 | @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 | __all__ = list(["Hello"]) + {"world"} # [invalid-all-format] | -./resources/test/fixtures/pylint/invalid_all_format.py:11:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:11:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 11 | __all__ = {"world"} + list(["Hello"]) # [invalid-all-format] 12 | @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 15 | __all__ = (x for x in ["Hello", "world"]) # [invalid-all-format] | -./resources/test/fixtures/pylint/invalid_all_format.py:13:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:13:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 13 | __all__ = list(["Hello"]) + {"world"} # [invalid-all-format] 14 | @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 17 | __all__ = {x for x in ["Hello", "world"]} # [invalid-all-format] | -./resources/test/fixtures/pylint/invalid_all_format.py:15:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` +invalid_all_format.py:15:1: PLE0605 Invalid format for `__all__`, must be `tuple` or `list` | 15 | __all__ = (x for x in ["Hello", "world"]) # [invalid-all-format] 16 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap index a42fd79ab4..27a6968d1d 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1142_await_outside_async.py.snap @@ -1,14 +1,14 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/await_outside_async.py:12:11: PLE1142 `await` should be used within an async function +await_outside_async.py:12:11: PLE1142 `await` should be used within an async function | 12 | def not_async(): 13 | print(await nested()) # [await-outside-async] | ^^^^^^^^^^^^^^ PLE1142 | -./resources/test/fixtures/pylint/await_outside_async.py:25:9: PLE1142 `await` should be used within an async function +await_outside_async.py:25:9: PLE1142 `await` should be used within an async function | 25 | async def func2(): 26 | def inner_func(): diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap index bed49615ff..b7b4b69f6d 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1205_logging_too_many_args.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/logging_too_many_args.py:3:1: PLE1205 Too many arguments for `logging` format string +logging_too_many_args.py:3:1: PLE1205 Too many arguments for `logging` format string | 3 | import logging 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 7 | logging.warning("Hello %s", "World!", "again", something="else") | -./resources/test/fixtures/pylint/logging_too_many_args.py:5:1: PLE1205 Too many arguments for `logging` format string +logging_too_many_args.py:5:1: PLE1205 Too many arguments for `logging` format string | 5 | logging.warning("Hello %s", "World!", "again") # [logging-too-many-args] 6 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap index fd2c5f0d54..11a0aaeabc 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1206_logging_too_few_args.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/logging_too_few_args.py:3:1: PLE1206 Not enough arguments for `logging` format string +logging_too_few_args.py:3:1: PLE1206 Not enough arguments for `logging` format string | 3 | import logging 4 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap index a0adc5ead7..16046563f9 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1307_bad_string_format_type.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/bad_string_format_type.py:2:7: PLE1307 Format type does not match argument type +bad_string_format_type.py:2:7: PLE1307 Format type does not match argument type | 2 | # Errors 3 | print("foo %(foo)d bar %(bar)d" % {"foo": "1", "bar": "2"}) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 5 | "foo %e bar %s" % ("1", 2) | -./resources/test/fixtures/pylint/bad_string_format_type.py:4:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:4:1: PLE1307 Format type does not match argument type | 4 | print("foo %(foo)d bar %(bar)d" % {"foo": "1", "bar": "2"}) 5 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 | "%d" % "1" | -./resources/test/fixtures/pylint/bad_string_format_type.py:6:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:6:1: PLE1307 Format type does not match argument type | 6 | "foo %e bar %s" % ("1", 2) 7 | @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 10 | "%(key)d" % {"key": "1"} | -./resources/test/fixtures/pylint/bad_string_format_type.py:7:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:7:1: PLE1307 Format type does not match argument type | 7 | "%d" % "1" 8 | "%o" % "1" @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 10 | "%x" % 1.1 | -./resources/test/fixtures/pylint/bad_string_format_type.py:8:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:8:1: PLE1307 Format type does not match argument type | 8 | "%d" % "1" 9 | "%o" % "1" @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 12 | "%(key)x" % {"key": 1.1} | -./resources/test/fixtures/pylint/bad_string_format_type.py:9:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:9:1: PLE1307 Format type does not match argument type | 9 | "%o" % "1" 10 | "%(key)d" % {"key": "1"} @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 | "%d" % [] | -./resources/test/fixtures/pylint/bad_string_format_type.py:10:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:10:1: PLE1307 Format type does not match argument type | 10 | "%(key)d" % {"key": "1"} 11 | "%x" % 1.1 @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 14 | "%d" % ([],) | -./resources/test/fixtures/pylint/bad_string_format_type.py:12:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:12:1: PLE1307 Format type does not match argument type | 12 | "%(key)x" % {"key": 1.1} 13 | "%d" % [] @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 16 | print("%d" % ("%s" % ("nested",),)) | -./resources/test/fixtures/pylint/bad_string_format_type.py:13:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:13:1: PLE1307 Format type does not match argument type | 13 | "%d" % [] 14 | "%d" % ([],) @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 17 | "%d" % ((1, 2, 3),) | -./resources/test/fixtures/pylint/bad_string_format_type.py:14:7: PLE1307 Format type does not match argument type +bad_string_format_type.py:14:7: PLE1307 Format type does not match argument type | 14 | "%d" % ([],) 15 | "%(key)d" % {"key": []} @@ -98,7 +98,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 17 | "%d" % ((1, 2, 3),) | -./resources/test/fixtures/pylint/bad_string_format_type.py:15:1: PLE1307 Format type does not match argument type +bad_string_format_type.py:15:1: PLE1307 Format type does not match argument type | 15 | "%(key)d" % {"key": []} 16 | print("%d" % ("%s" % ("nested",),)) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap index b0923df41a..db307e11d2 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1310_bad_str_strip_call.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/bad_str_strip_call.py:2:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:2:21: PLE1310 String `strip` call contains duplicate characters | 2 | # PLE1310 3 | "Hello World".strip("Hello") @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 5 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:5:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:5:21: PLE1310 String `strip` call contains duplicate characters | 5 | # PLE1310 6 | "Hello World".strip("Hello") @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:8:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:8:21: PLE1310 String `strip` call contains duplicate characters | 8 | # PLE1310 9 | "Hello World".strip(u"Hello") @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 11 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:11:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:11:21: PLE1310 String `strip` call contains duplicate characters | 11 | # PLE1310 12 | "Hello World".strip(r"Hello") @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 14 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:14:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:14:21: PLE1310 String `strip` call contains duplicate characters | 14 | # PLE1310 15 | "Hello World".strip("Hello\t") @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 17 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:17:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:17:21: PLE1310 String `strip` call contains duplicate characters | 17 | # PLE1310 18 | "Hello World".strip(r"Hello\t") @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 20 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:20:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:20:21: PLE1310 String `strip` call contains duplicate characters | 20 | # PLE1310 21 | "Hello World".strip("Hello\\") @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 23 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:23:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:23:21: PLE1310 String `strip` call contains duplicate characters | 23 | # PLE1310 24 | "Hello World".strip(r"Hello\\") @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 26 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:26:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:26:21: PLE1310 String `strip` call contains duplicate characters | 26 | # PLE1310 27 | "Hello World".strip("🤣🤣🤣🤣🙃👀😀") @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 29 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:30:5: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:30:5: PLE1310 String `strip` call contains duplicate characters | 30 | # PLE1310 31 | "Hello World".strip( @@ -94,7 +94,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 35 | ) | -./resources/test/fixtures/pylint/bad_str_strip_call.py:36:21: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:36:21: PLE1310 String `strip` call contains duplicate characters | 36 | # PLE1310 37 | "Hello World".strip("can we get a long " \ @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 41 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:42:5: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:42:5: PLE1310 String `strip` call contains duplicate characters | 42 | # PLE1310 43 | "Hello World".strip( @@ -118,7 +118,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 47 | ) | -./resources/test/fixtures/pylint/bad_str_strip_call.py:49:5: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:49:5: PLE1310 String `strip` call contains duplicate characters | 49 | # PLE1310 50 | "Hello World".strip( @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 54 | ) | -./resources/test/fixtures/pylint/bad_str_strip_call.py:61:11: PLE1310 String `strip` call contains duplicate characters +bad_str_strip_call.py:61:11: PLE1310 String `strip` call contains duplicate characters | 61 | # PLE1310 62 | u''.strip('http://') @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 64 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:64:12: PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?) +bad_str_strip_call.py:64:12: PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?) | 64 | # PLE1310 65 | u''.lstrip('http://') @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 67 | # PLE1310 | -./resources/test/fixtures/pylint/bad_str_strip_call.py:67:12: PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?) +bad_str_strip_call.py:67:12: PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?) | 67 | # PLE1310 68 | b''.rstrip('http://') diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap index fc1405dd12..3163f55a86 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE1507_invalid_envvar_value.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_envvar_value.py:3:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` +invalid_envvar_value.py:3:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` | 3 | import os 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 7 | os.getenv("test") | -./resources/test/fixtures/pylint/invalid_envvar_value.py:7:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` +invalid_envvar_value.py:7:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` | 7 | os.getenv("test") 8 | os.getenv(key="testingAgain") @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 11 | os.getenv(key="foo", default="bar") | -./resources/test/fixtures/pylint/invalid_envvar_value.py:8:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` +invalid_envvar_value.py:8:11: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` | 8 | os.getenv(key="testingAgain") 9 | os.getenv(key=11) # [invalid-envvar-value] @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 12 | os.getenv(key=f"foo", default="bar") | -./resources/test/fixtures/pylint/invalid_envvar_value.py:12:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` +invalid_envvar_value.py:12:15: PLE1507 Invalid type for initial `os.getenv` argument; expected `str` | 12 | os.getenv(key=f"foo", default="bar") 13 | os.getenv(key="foo" + "bar", default=1) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap index 2ca8e92689..7a864594d9 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2502_bidirectional_unicode.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/bidirectional_unicode.py:2:1: PLE2502 Contains control characters that can permit obfuscated code +bidirectional_unicode.py:2:1: PLE2502 Contains control characters that can permit obfuscated code | 2 | # E2502 3 | / print("שלום‬") @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 | example = "x‏" * 100 # "‏x" is assigned | -./resources/test/fixtures/pylint/bidirectional_unicode.py:5:1: PLE2502 Contains control characters that can permit obfuscated code +bidirectional_unicode.py:5:1: PLE2502 Contains control characters that can permit obfuscated code | 5 | # E2502 6 | / example = "x‏" * 100 # "‏x" is assigned @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | if access_level != "none‮⁦": # Check if admin ⁩⁦' and access_level != 'user | -./resources/test/fixtures/pylint/bidirectional_unicode.py:8:1: PLE2502 Contains control characters that can permit obfuscated code +bidirectional_unicode.py:8:1: PLE2502 Contains control characters that can permit obfuscated code | 8 | # E2502 9 | / if access_level != "none‮⁦": # Check if admin ⁩⁦' and access_level != 'user @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | |_^ PLE2502 | -./resources/test/fixtures/pylint/bidirectional_unicode.py:14:1: PLE2502 Contains control characters that can permit obfuscated code +bidirectional_unicode.py:14:1: PLE2502 Contains control characters that can permit obfuscated code | 14 | # E2502 15 | def subtract_funds(account: str, amount: int): diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2510_invalid_characters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2510_invalid_characters.py.snap index 0720fe31b8..9777f4a8e6 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2510_invalid_characters.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2510_invalid_characters.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_characters.py:15:6: PLE2510 [*] Invalid unescaped character backspace, use "\b" instead +invalid_characters.py:15:6: PLE2510 [*] Invalid unescaped character backspace, use "\b" instead | 15 | # (Pylint, "C3002") => Rule::UnnecessaryDirectLambdaCall, 16 | #foo = 'hi' diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2512_invalid_characters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2512_invalid_characters.py.snap index f278577db3..914115bb4b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2512_invalid_characters.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2512_invalid_characters.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_characters.py:21:12: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead +invalid_characters.py:21:12: PLE2512 [*] Invalid unescaped character SUB, use "\x1A" instead | 21 | cr_ok = '\\r' 22 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2513_invalid_characters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2513_invalid_characters.py.snap index d076c3810a..19e17e7779 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2513_invalid_characters.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2513_invalid_characters.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_characters.py:25:16: PLE2513 [*] Invalid unescaped character ESC, use "\x1B" instead +invalid_characters.py:25:16: PLE2513 [*] Invalid unescaped character ESC, use "\x1B" instead | 25 | sub_ok = '\x1a' 26 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2514_invalid_characters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2514_invalid_characters.py.snap index 773a99db83..8e6e7eda81 100644 Binary files a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2514_invalid_characters.py.snap and b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2514_invalid_characters.py.snap differ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2515_invalid_characters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2515_invalid_characters.py.snap index 7c1fa28613..a4fd01f198 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2515_invalid_characters.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLE2515_invalid_characters.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_characters.py:34:13: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead +invalid_characters.py:34:13: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead | 34 | nul_ok = '\0' 35 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 36 36 | zwsp_ok = '\u200b' 37 37 | -./resources/test/fixtures/pylint/invalid_characters.py:38:36: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead +invalid_characters.py:38:36: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead | 38 | zwsp_ok = '\u200b' 39 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 38 |+zwsp_after_multibyte_character = "ಫ\u200b" 39 39 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​" -./resources/test/fixtures/pylint/invalid_characters.py:39:60: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead +invalid_characters.py:39:60: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead | 39 | zwsp_after_multibyte_character = "ಫ​" 40 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​" @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 39 |-zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​" 39 |+zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ \u200b​" -./resources/test/fixtures/pylint/invalid_characters.py:39:61: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead +invalid_characters.py:39:61: PLE2515 [*] Invalid unescaped character zero-width-space, use "\u200B" instead | 39 | zwsp_after_multibyte_character = "ಫ​" 40 | zwsp_after_multicharacter_grapheme_cluster = "ಫ್ರಾನ್ಸಿಸ್ಕೊ ​​" diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap index 25d7351ecf..c0fc283ef6 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0133_comparison_of_constant.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/comparison_of_constant.py:3:4: PLR0133 Two constants compared in a comparison, consider replacing `100 == 100` +comparison_of_constant.py:3:4: PLR0133 Two constants compared in a comparison, consider replacing `100 == 100` | 3 | """Check that magic values are not used in comparisons""" 4 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:6:4: PLR0133 Two constants compared in a comparison, consider replacing `1 == 3` +comparison_of_constant.py:6:4: PLR0133 Two constants compared in a comparison, consider replacing `1 == 3` | 6 | pass 7 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:9:4: PLR0133 Two constants compared in a comparison, consider replacing `1 != 3` +comparison_of_constant.py:9:4: PLR0133 Two constants compared in a comparison, consider replacing `1 != 3` | 9 | pass 10 | @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 12 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:13:4: PLR0133 Two constants compared in a comparison, consider replacing `4 == 3` +comparison_of_constant.py:13:4: PLR0133 Two constants compared in a comparison, consider replacing `4 == 3` | 13 | x = 0 14 | if 4 == 3 == x: # [comparison-of-constants] @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 15 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:23:4: PLR0133 Two constants compared in a comparison, consider replacing `1 > 0` +comparison_of_constant.py:23:4: PLR0133 Two constants compared in a comparison, consider replacing `1 > 0` | 23 | pass 24 | @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 26 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:29:4: PLR0133 Two constants compared in a comparison, consider replacing `1 >= 0` +comparison_of_constant.py:29:4: PLR0133 Two constants compared in a comparison, consider replacing `1 >= 0` | 29 | pass 30 | @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 32 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:35:4: PLR0133 Two constants compared in a comparison, consider replacing `1 < 0` +comparison_of_constant.py:35:4: PLR0133 Two constants compared in a comparison, consider replacing `1 < 0` | 35 | pass 36 | @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 38 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:41:4: PLR0133 Two constants compared in a comparison, consider replacing `1 <= 0` +comparison_of_constant.py:41:4: PLR0133 Two constants compared in a comparison, consider replacing `1 <= 0` | 41 | pass 42 | @@ -72,7 +72,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 44 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:51:4: PLR0133 Two constants compared in a comparison, consider replacing `"hello" == ""` +comparison_of_constant.py:51:4: PLR0133 Two constants compared in a comparison, consider replacing `"hello" == ""` | 51 | pass 52 | @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 54 | pass | -./resources/test/fixtures/pylint/comparison_of_constant.py:58:4: PLR0133 Two constants compared in a comparison, consider replacing `True == False` +comparison_of_constant.py:58:4: PLR0133 Two constants compared in a comparison, consider replacing `True == False` | 58 | pass 59 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap index 557a288d11..328f4f9f51 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0206_property_with_parameters.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/property_with_parameters.py:7:9: PLR0206 Cannot have defined parameters for properties +property_with_parameters.py:7:9: PLR0206 Cannot have defined parameters for properties | 7 | class Cls: 8 | @property @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 10 | return param + param1 | -./resources/test/fixtures/pylint/property_with_parameters.py:11:9: PLR0206 Cannot have defined parameters for properties +property_with_parameters.py:11:9: PLR0206 Cannot have defined parameters for properties | 11 | @property 12 | def attribute_keyword_only(self, *, param, param1): # [property-with-parameters] @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 | return param + param1 | -./resources/test/fixtures/pylint/property_with_parameters.py:15:9: PLR0206 Cannot have defined parameters for properties +property_with_parameters.py:15:9: PLR0206 Cannot have defined parameters for properties | 15 | @property 16 | def attribute_positional_only(self, param, param1, /): # [property-with-parameters] diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap index 06ddf4d378..32a35232d5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0402_import_aliasing.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/import_aliasing.py:9:8: PLR0402 [*] Use `from os import path` in lieu of alias +import_aliasing.py:9:8: PLR0402 [*] Use `from os import path` in lieu of alias | 9 | from collections import OrderedDict as OrderedDict # [useless-import-alias] 10 | from collections import OrderedDict as o_dict @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 11 11 | import foo.bar.foobar as foobar # [consider-using-from-import] 12 12 | import foo.bar.foobar as foobar, sys # [consider-using-from-import] -./resources/test/fixtures/pylint/import_aliasing.py:11:8: PLR0402 [*] Use `from foo.bar import foobar` in lieu of alias +import_aliasing.py:11:8: PLR0402 [*] Use `from foo.bar import foobar` in lieu of alias | 11 | import os.path as path # [consider-using-from-import] 12 | import os.path as p @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 13 | import os 14 14 | import os as OS -./resources/test/fixtures/pylint/import_aliasing.py:12:8: PLR0402 Use `from foo.bar import foobar` in lieu of alias +import_aliasing.py:12:8: PLR0402 Use `from foo.bar import foobar` in lieu of alias | 12 | import os.path as p 13 | import foo.bar.foobar as foobar # [consider-using-from-import] diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap index f1da93befe..52ed14fa10 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0911_too_many_return_statements.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_return_statements.py:4:5: PLR0911 Too many return statements (11 > 6) +too_many_return_statements.py:4:5: PLR0911 Too many return statements (11 > 6) | 4 | https://github.com/PyCQA/pylint/blob/69eca9b3f9856c3033957b769358803ee48e8e47/tests/functional/t/too/too_many_return_statements.py 5 | """ diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap index a4c9a40e6c..2dd290e459 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0912_too_many_branches.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_branches.py:6:5: PLR0912 Too many branches (13 > 12) +too_many_branches.py:6:5: PLR0912 Too many branches (13 > 12) | 6 | """ 7 | # pylint: disable=using-constant-test diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap index f2529c45dc..edc3842afb 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0913_too_many_arguments.py.snap @@ -1,21 +1,21 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_arguments.py:1:5: PLR0913 Too many arguments to function call (8 > 5) +too_many_arguments.py:1:5: PLR0913 Too many arguments to function call (8 > 5) | 1 | def f(x, y, z, t, u, v, w, r): # Too many arguments (8/5) | ^ PLR0913 2 | pass | -./resources/test/fixtures/pylint/too_many_arguments.py:17:5: PLR0913 Too many arguments to function call (6 > 5) +too_many_arguments.py:17:5: PLR0913 Too many arguments to function call (6 > 5) | 17 | def f(x, y, z, u=1, v=1, r=1): # Too many arguments (6/5) | ^ PLR0913 18 | pass | -./resources/test/fixtures/pylint/too_many_arguments.py:33:5: PLR0913 Too many arguments to function call (6 > 5) +too_many_arguments.py:33:5: PLR0913 Too many arguments to function call (6 > 5) | 33 | def f(x, y, z, a, b, c, *, u, v, w): # Too many arguments (6/5) | ^ PLR0913 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap index 4e33709c28..8bf44746fb 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR0915_too_many_statements.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_statements.py:5:11: PLR0915 Too many statements (52 > 50) +too_many_statements.py:5:11: PLR0915 Too many statements (52 > 50) | 5 | async def f(): # Too many statements (52/50) | ^ PLR0915 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_repeated_isinstance_calls.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_repeated_isinstance_calls.py.snap index d7351d98e3..725ccd6cfe 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_repeated_isinstance_calls.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1701_repeated_isinstance_calls.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/repeated_isinstance_calls.py:15:8: PLR1701 Merge these isinstance calls: `isinstance(var[3], (float, int))` +repeated_isinstance_calls.py:15:8: PLR1701 Merge these isinstance calls: `isinstance(var[3], (float, int))` | 15 | # not merged 16 | if isinstance(var[3], int) or isinstance(var[3], float) or isinstance(var[3], list) and True: # [consider-merging-isinstance] @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 18 | result = isinstance(var[4], int) or isinstance(var[4], float) or isinstance(var[5], list) and False # [consider-merging-isinstance] | -./resources/test/fixtures/pylint/repeated_isinstance_calls.py:17:14: PLR1701 Merge these isinstance calls: `isinstance(var[4], (float, int))` +repeated_isinstance_calls.py:17:14: PLR1701 Merge these isinstance calls: `isinstance(var[4], (float, int))` | 17 | if isinstance(var[3], int) or isinstance(var[3], float) or isinstance(var[3], list) and True: # [consider-merging-isinstance] 18 | pass @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 21 | result = isinstance(var[5], int) or True or isinstance(var[5], float) # [consider-merging-isinstance] | -./resources/test/fixtures/pylint/repeated_isinstance_calls.py:19:14: PLR1701 Merge these isinstance calls: `isinstance(var[5], (float, int))` +repeated_isinstance_calls.py:19:14: PLR1701 Merge these isinstance calls: `isinstance(var[5], (float, int))` | 19 | result = isinstance(var[4], int) or isinstance(var[4], float) or isinstance(var[5], list) and False # [consider-merging-isinstance] 20 | @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 23 | inferred_isinstance = isinstance | -./resources/test/fixtures/pylint/repeated_isinstance_calls.py:23:14: PLR1701 Merge these isinstance calls: `isinstance(var[10], (list, str))` +repeated_isinstance_calls.py:23:14: PLR1701 Merge these isinstance calls: `isinstance(var[10], (list, str))` | 23 | inferred_isinstance = isinstance 24 | result = inferred_isinstance(var[6], int) or inferred_isinstance(var[6], float) or inferred_isinstance(var[6], list) and False # [consider-merging-isinstance] @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 26 | result = isinstance(var[11], int) or isinstance(var[11], int) or isinstance(var[11], float) # [consider-merging-isinstance] | -./resources/test/fixtures/pylint/repeated_isinstance_calls.py:24:14: PLR1701 Merge these isinstance calls: `isinstance(var[11], (float, int))` +repeated_isinstance_calls.py:24:14: PLR1701 Merge these isinstance calls: `isinstance(var[11], (float, int))` | 24 | result = inferred_isinstance(var[6], int) or inferred_isinstance(var[6], float) or inferred_isinstance(var[6], list) and False # [consider-merging-isinstance] 25 | result = isinstance(var[10], str) or isinstance(var[10], int) and var[8] * 14 or isinstance(var[10], float) and var[5] * 14.4 or isinstance(var[10], list) # [consider-merging-isinstance] @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 28 | result = isinstance(var[20]) | -./resources/test/fixtures/pylint/repeated_isinstance_calls.py:30:14: PLR1701 Merge these isinstance calls: `isinstance(var[12], (float, int, list))` +repeated_isinstance_calls.py:30:14: PLR1701 Merge these isinstance calls: `isinstance(var[12], (float, int, list))` | 30 | # Combination merged and not merged 31 | result = isinstance(var[12], (int, float)) or isinstance(var[12], list) # [consider-merging-isinstance] diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1711_useless_return.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1711_useless_return.py.snap index 046b7f7a5b..6a8d8cb1cb 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1711_useless_return.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1711_useless_return.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/useless_return.py:6:5: PLR1711 [*] Useless `return` statement at end of function +useless_return.py:6:5: PLR1711 [*] Useless `return` statement at end of function | 6 | def print_python_version(): 7 | print(sys.version) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 7 | 9 8 | def print_python_version(): -./resources/test/fixtures/pylint/useless_return.py:11:5: PLR1711 [*] Useless `return` statement at end of function +useless_return.py:11:5: PLR1711 [*] Useless `return` statement at end of function | 11 | def print_python_version(): 12 | print(sys.version) @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 12 | 14 13 | def print_python_version(): -./resources/test/fixtures/pylint/useless_return.py:16:5: PLR1711 [*] Useless `return` statement at end of function +useless_return.py:16:5: PLR1711 [*] Useless `return` statement at end of function | 16 | def print_python_version(): 17 | print(sys.version) @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 18 17 | 19 18 | class SomeClass: -./resources/test/fixtures/pylint/useless_return.py:22:9: PLR1711 [*] Useless `return` statement at end of function +useless_return.py:22:9: PLR1711 [*] Useless `return` statement at end of function | 22 | def print_python_version(self): 23 | print(sys.version) @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 24 23 | 25 24 | def print_python_version(): -./resources/test/fixtures/pylint/useless_return.py:50:5: PLR1711 [*] Useless `return` statement at end of function +useless_return.py:50:5: PLR1711 [*] Useless `return` statement at end of function | 50 | """This function returns None.""" 51 | print(sys.version) @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 52 51 | 53 52 | class BaseCache: -./resources/test/fixtures/pylint/useless_return.py:60:9: PLR1711 [*] Useless `return` statement at end of function +useless_return.py:60:9: PLR1711 [*] Useless `return` statement at end of function | 60 | def get(self, key: str) -> None: 61 | print(f"{key} not found") diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap index 100ff37bf1..cb1f2641ad 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/sys_exit_alias_0.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_0.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` | 1 | exit(0) | ^^^^ PLR1722 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 3 4 | 4 5 | -./resources/test/fixtures/pylint/sys_exit_alias_0.py:2:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_0.py:2:1: PLR1722 [*] Use `sys.exit()` instead of `quit` | 2 | exit(0) 3 | quit(0) @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 4 5 | 5 6 | def main(): -./resources/test/fixtures/pylint/sys_exit_alias_0.py:6:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_0.py:6:5: PLR1722 [*] Use `sys.exit()` instead of `exit` | 6 | def main(): 7 | exit(2) @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 7 |+ sys.exit(2) 7 8 | quit(2) -./resources/test/fixtures/pylint/sys_exit_alias_0.py:7:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_0.py:7:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 7 | def main(): 8 | exit(2) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap index e1a542eb92..609269cabb 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/sys_exit_alias_1.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_1.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` | 3 | import sys 4 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 5 5 | 6 6 | -./resources/test/fixtures/pylint/sys_exit_alias_1.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_1.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` | 4 | exit(0) 5 | quit(0) @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 6 | 7 7 | def main(): -./resources/test/fixtures/pylint/sys_exit_alias_1.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_1.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` | 8 | def main(): 9 | exit(1) @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 10 10 | 11 11 | -./resources/test/fixtures/pylint/sys_exit_alias_1.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_1.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 9 | def main(): 10 | exit(1) @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 11 11 | 12 12 | def main(): -./resources/test/fixtures/pylint/sys_exit_alias_1.py:15:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_1.py:15:5: PLR1722 [*] Use `sys.exit()` instead of `exit` | 15 | sys = 1 16 | @@ -86,7 +86,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | = help: Replace `exit` with `sys.exit()` -./resources/test/fixtures/pylint/sys_exit_alias_1.py:16:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_1.py:16:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 16 | exit(1) 17 | quit(1) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap index 9098f3bb95..bb6050e15c 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/sys_exit_alias_2.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_2.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` | 3 | import sys as sys2 4 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 5 5 | 6 6 | -./resources/test/fixtures/pylint/sys_exit_alias_2.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_2.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` | 4 | exit(0) 5 | quit(0) @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 6 | 7 7 | def main(): -./resources/test/fixtures/pylint/sys_exit_alias_2.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_2.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` | 8 | def main(): 9 | exit(1) @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 |+ sys2.exit(1) 9 9 | quit(1) -./resources/test/fixtures/pylint/sys_exit_alias_2.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_2.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 9 | def main(): 10 | exit(1) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap index 9971056d62..0e26708d37 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/sys_exit_alias_3.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_3.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` | 4 | exit(0) 5 | quit(0) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 6 | 7 7 | def main(): -./resources/test/fixtures/pylint/sys_exit_alias_3.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_3.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 9 | def main(): 10 | exit(1) @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 11 11 | 12 12 | def main(): -./resources/test/fixtures/pylint/sys_exit_alias_3.py:16:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_3.py:16:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 16 | exit(1) 17 | quit(1) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap index 4d6013d47a..dc40ea7a7c 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/sys_exit_alias_4.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_4.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` | 3 | from sys import exit as exit2 4 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 5 5 | 6 6 | -./resources/test/fixtures/pylint/sys_exit_alias_4.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_4.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` | 4 | exit(0) 5 | quit(0) @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 6 | 7 7 | def main(): -./resources/test/fixtures/pylint/sys_exit_alias_4.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_4.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` | 8 | def main(): 9 | exit(1) @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 |+ exit2(1) 9 9 | quit(1) -./resources/test/fixtures/pylint/sys_exit_alias_4.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_4.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 9 | def main(): 10 | exit(1) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap index 422fa6351b..6669d3fa5d 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_5.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/sys_exit_alias_5.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_5.py:3:1: PLR1722 [*] Use `sys.exit()` instead of `exit` | 3 | from sys import * 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | = help: Replace `exit` with `sys.exit()` -./resources/test/fixtures/pylint/sys_exit_alias_5.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_5.py:4:1: PLR1722 [*] Use `sys.exit()` instead of `quit` | 4 | exit(0) 5 | quit(0) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | = help: Replace `quit` with `sys.exit()` -./resources/test/fixtures/pylint/sys_exit_alias_5.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_5.py:8:5: PLR1722 [*] Use `sys.exit()` instead of `exit` | 8 | def main(): 9 | exit(1) @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | = help: Replace `exit` with `sys.exit()` -./resources/test/fixtures/pylint/sys_exit_alias_5.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_5.py:9:5: PLR1722 [*] Use `sys.exit()` instead of `quit` | 9 | def main(): 10 | exit(1) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap index a7a2e42799..35a19c1c25 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR1722_sys_exit_alias_6.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/sys_exit_alias_6.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` +sys_exit_alias_6.py:1:1: PLR1722 [*] Use `sys.exit()` instead of `exit` | 1 | exit(0) | ^^^^ PLR1722 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 3 4 | 4 5 | -./resources/test/fixtures/pylint/sys_exit_alias_6.py:2:1: PLR1722 [*] Use `sys.exit()` instead of `quit` +sys_exit_alias_6.py:2:1: PLR1722 [*] Use `sys.exit()` instead of `quit` | 2 | exit(0) 3 | quit(0) diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap index e729dfc78f..674165ae79 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR2004_magic_value_comparison.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/magic_value_comparison.py:5:4: PLR2004 Magic value used in comparison, consider replacing 10 with a constant variable +magic_value_comparison.py:5:4: PLR2004 Magic value used in comparison, consider replacing 10 with a constant variable | 5 | user_input = 10 6 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 | pass | -./resources/test/fixtures/pylint/magic_value_comparison.py:38:12: PLR2004 Magic value used in comparison, consider replacing 2 with a constant variable +magic_value_comparison.py:38:12: PLR2004 Magic value used in comparison, consider replacing 2 with a constant variable | 38 | pass 39 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 41 | pass | -./resources/test/fixtures/pylint/magic_value_comparison.py:41:12: PLR2004 Magic value used in comparison, consider replacing -2 with a constant variable +magic_value_comparison.py:41:12: PLR2004 Magic value used in comparison, consider replacing -2 with a constant variable | 41 | pass 42 | @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 44 | pass | -./resources/test/fixtures/pylint/magic_value_comparison.py:44:12: PLR2004 Magic value used in comparison, consider replacing +2 with a constant variable +magic_value_comparison.py:44:12: PLR2004 Magic value used in comparison, consider replacing +2 with a constant variable | 44 | pass 45 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 47 | pass | -./resources/test/fixtures/pylint/magic_value_comparison.py:65:21: PLR2004 Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable +magic_value_comparison.py:65:21: PLR2004 Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable | 65 | pi_estimation = 3.14 66 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap index f2520e4b77..59d16efdea 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLR5501_collapsible_else_if.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/collapsible_else_if.py:38:9: PLR5501 Consider using `elif` instead of `else` then `if` to remove one indentation level +collapsible_else_if.py:38:9: PLR5501 Consider using `elif` instead of `else` then `if` to remove one indentation level | 38 | pass 39 | else: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | |________________^ PLR5501 | -./resources/test/fixtures/pylint/collapsible_else_if.py:46:9: PLR5501 Consider using `elif` instead of `else` then `if` to remove one indentation level +collapsible_else_if.py:46:9: PLR5501 Consider using `elif` instead of `else` then `if` to remove one indentation level | 46 | pass 47 | else: diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap index 2c89e69c5a..9415d8ee29 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0120_useless_else_on_loop.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/useless_else_on_loop.py:9:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it +useless_else_on_loop.py:9:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | 9 | if i % 2: 10 | return i @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 13 | return None | -./resources/test/fixtures/pylint/useless_else_on_loop.py:18:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it +useless_else_on_loop.py:18:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | 18 | while True: 19 | return 1 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 22 | return None | -./resources/test/fixtures/pylint/useless_else_on_loop.py:30:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it +useless_else_on_loop.py:30:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | 30 | break 31 | @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 33 | print("or else!") | -./resources/test/fixtures/pylint/useless_else_on_loop.py:37:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it +useless_else_on_loop.py:37:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | 37 | while False: 38 | break @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 40 | print("or else!") | -./resources/test/fixtures/pylint/useless_else_on_loop.py:42:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it +useless_else_on_loop.py:42:1: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | 42 | for j in range(10): 43 | pass @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 46 | for j in range(10): | -./resources/test/fixtures/pylint/useless_else_on_loop.py:88:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it +useless_else_on_loop.py:88:5: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | 88 | else: 89 | print("all right") @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 92 | return False | -./resources/test/fixtures/pylint/useless_else_on_loop.py:98:9: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it +useless_else_on_loop.py:98:9: PLW0120 `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it | 98 | for _ in range(3): 99 | pass diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap index 9da82c1175..0b1a118ac8 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0129_assert_on_string_literal.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/assert_on_string_literal.py:3:12: PLW0129 Asserting on a non-empty string literal will always pass +assert_on_string_literal.py:3:12: PLW0129 Asserting on a non-empty string literal will always pass | 3 | def test_division(): 4 | a = 9 / 3 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PLW0129 | -./resources/test/fixtures/pylint/assert_on_string_literal.py:12:12: PLW0129 Asserting on a non-empty string literal will always pass +assert_on_string_literal.py:12:12: PLW0129 Asserting on a non-empty string literal will always pass | 12 | try: 13 | assert "bad" # [assert-on-string-literal] @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 15 | assert "bad again" # [assert-on-string-literal] | -./resources/test/fixtures/pylint/assert_on_string_literal.py:14:12: PLW0129 Asserting on a non-empty string literal will always pass +assert_on_string_literal.py:14:12: PLW0129 Asserting on a non-empty string literal will always pass | 14 | assert "bad" # [assert-on-string-literal] 15 | except: @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 18 | a = 12 | -./resources/test/fixtures/pylint/assert_on_string_literal.py:17:8: PLW0129 Asserting on a non-empty string literal will always pass +assert_on_string_literal.py:17:8: PLW0129 Asserting on a non-empty string literal will always pass | 17 | a = 12 18 | assert f"hello {a}" # [assert-on-string-literal] @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 20 | assert f"" # [assert-on-string-literal] | -./resources/test/fixtures/pylint/assert_on_string_literal.py:18:8: PLW0129 Asserting on a string literal may have unintended results +assert_on_string_literal.py:18:8: PLW0129 Asserting on a string literal may have unintended results | 18 | a = 12 19 | assert f"hello {a}" # [assert-on-string-literal] @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 22 | assert "" # [assert-on-string-literal] | -./resources/test/fixtures/pylint/assert_on_string_literal.py:19:8: PLW0129 Asserting on an empty string literal will never pass +assert_on_string_literal.py:19:8: PLW0129 Asserting on an empty string literal will never pass | 19 | assert f"hello {a}" # [assert-on-string-literal] 20 | assert f"{a}" # [assert-on-string-literal] @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 23 | assert b"hello" # [assert-on-string-literal] | -./resources/test/fixtures/pylint/assert_on_string_literal.py:20:8: PLW0129 Asserting on an empty string literal will never pass +assert_on_string_literal.py:20:8: PLW0129 Asserting on an empty string literal will never pass | 20 | assert f"{a}" # [assert-on-string-literal] 21 | assert f"" # [assert-on-string-literal] @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 24 | assert "", b"hi" # [assert-on-string-literal] | -./resources/test/fixtures/pylint/assert_on_string_literal.py:21:8: PLW0129 Asserting on a non-empty string literal will always pass +assert_on_string_literal.py:21:8: PLW0129 Asserting on a non-empty string literal will always pass | 21 | assert f"" # [assert-on-string-literal] 22 | assert "" # [assert-on-string-literal] @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 25 | assert "WhyNotHere?", "HereIsOk" # [assert-on-string-literal] | -./resources/test/fixtures/pylint/assert_on_string_literal.py:22:8: PLW0129 Asserting on an empty string literal will never pass +assert_on_string_literal.py:22:8: PLW0129 Asserting on an empty string literal will never pass | 22 | assert "" # [assert-on-string-literal] 23 | assert b"hello" # [assert-on-string-literal] @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 26 | assert 12, "ok here" | -./resources/test/fixtures/pylint/assert_on_string_literal.py:23:8: PLW0129 Asserting on a non-empty string literal will always pass +assert_on_string_literal.py:23:8: PLW0129 Asserting on a non-empty string literal will always pass | 23 | assert b"hello" # [assert-on-string-literal] 24 | assert "", b"hi" # [assert-on-string-literal] diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap index 9df9154ec4..6a357a3231 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0602_global_variable_not_assigned.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/global_variable_not_assigned.py:5:12: PLW0602 Using global for `X` but no assignment is done +global_variable_not_assigned.py:5:12: PLW0602 Using global for `X` but no assignment is done | 5 | ### 6 | def f(): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | ^ PLW0602 | -./resources/test/fixtures/pylint/global_variable_not_assigned.py:9:12: PLW0602 Using global for `X` but no assignment is done +global_variable_not_assigned.py:9:12: PLW0602 Using global for `X` but no assignment is done | 9 | def f(): 10 | global X diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap index ddb9610508..eae15b8134 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0603_global_statement.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/global_statement.py:17:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged +global_statement.py:17:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged | 17 | def fix_constant(value): 18 | """All this is ok, but try not to use `global` ;)""" @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 21 | CONSTANT = value | -./resources/test/fixtures/pylint/global_statement.py:24:5: PLW0603 Using the global statement to update `sys` is discouraged +global_statement.py:24:5: PLW0603 Using the global statement to update `sys` is discouraged | 24 | def global_with_import(): 25 | """Should only warn for global-statement when using `Import` node""" @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 27 | import sys | -./resources/test/fixtures/pylint/global_statement.py:30:5: PLW0603 Using the global statement to update `namedtuple` is discouraged +global_statement.py:30:5: PLW0603 Using the global statement to update `namedtuple` is discouraged | 30 | def global_with_import_from(): 31 | """Should only warn for global-statement when using `ImportFrom` node""" @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 33 | from collections import namedtuple | -./resources/test/fixtures/pylint/global_statement.py:36:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged +global_statement.py:36:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged | 36 | def global_del(): 37 | """Deleting the global name prevents `global-variable-not-assigned`""" @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 40 | del CONSTANT | -./resources/test/fixtures/pylint/global_statement.py:43:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged +global_statement.py:43:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged | 43 | def global_operator_assign(): 44 | """Operator assigns should only throw a global statement error""" @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 47 | CONSTANT += 1 | -./resources/test/fixtures/pylint/global_statement.py:50:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged +global_statement.py:50:5: PLW0603 Using the global statement to update `CONSTANT` is discouraged | 50 | def global_function_assign(): 51 | """Function assigns should only throw a global statement error""" @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 54 | def CONSTANT(): | -./resources/test/fixtures/pylint/global_statement.py:60:5: PLW0603 Using the global statement to update `FUNC` is discouraged +global_statement.py:60:5: PLW0603 Using the global statement to update `FUNC` is discouraged | 60 | def override_func(): 61 | """Overriding a function should only throw a global statement error""" @@ -69,7 +69,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 64 | def FUNC(): | -./resources/test/fixtures/pylint/global_statement.py:70:5: PLW0603 Using the global statement to update `CLASS` is discouraged +global_statement.py:70:5: PLW0603 Using the global statement to update `CLASS` is discouraged | 70 | def override_class(): 71 | """Overriding a class should only throw a global statement error""" diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0711_binary_op_exception.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0711_binary_op_exception.py.snap index 98e165e6cd..fe65dfb54a 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0711_binary_op_exception.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW0711_binary_op_exception.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/binary_op_exception.py:3:8: PLW0711 Exception to catch is the result of a binary `or` operation +binary_op_exception.py:3:8: PLW0711 Exception to catch is the result of a binary `or` operation | 3 | try: 4 | 1 / 0 @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 | pass | -./resources/test/fixtures/pylint/binary_op_exception.py:8:8: PLW0711 Exception to catch is the result of a binary `and` operation +binary_op_exception.py:8:8: PLW0711 Exception to catch is the result of a binary `and` operation | 8 | try: 9 | raise ValueError diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap index a479d93c62..6b67d3cc43 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW1508_invalid_envvar_default.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/invalid_envvar_default.py:3:29: PLW1508 Invalid type for environment variable default; expected `str` or `None` +invalid_envvar_default.py:3:29: PLW1508 Invalid type for environment variable default; expected `str` or `None` | 3 | import os 4 | @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 7 | dictVarBad = os.getenv("AAA", {"a", 7}) # [invalid-envvar-default] | -./resources/test/fixtures/pylint/invalid_envvar_default.py:5:31: PLW1508 Invalid type for environment variable default; expected `str` or `None` +invalid_envvar_default.py:5:31: PLW1508 Invalid type for environment variable default; expected `str` or `None` | 5 | tempVar = os.getenv("TEST", 12) # [invalid-envvar-default] 6 | goodVar = os.getenv("TESTING", None) @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | os.getenv("AA", "GOOD") | -./resources/test/fixtures/pylint/invalid_envvar_default.py:6:25: PLW1508 Invalid type for environment variable default; expected `str` or `None` +invalid_envvar_default.py:6:25: PLW1508 Invalid type for environment variable default; expected `str` or `None` | 6 | goodVar = os.getenv("TESTING", None) 7 | dictVarBad = os.getenv("AAA", {"a", 7}) # [invalid-envvar-default] @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 10 | os.getenv("AA", f"GOOD") | -./resources/test/fixtures/pylint/invalid_envvar_default.py:10:17: PLW1508 Invalid type for environment variable default; expected `str` or `None` +invalid_envvar_default.py:10:17: PLW1508 Invalid type for environment variable default; expected `str` or `None` | 10 | os.getenv("AA", f"GOOD") 11 | os.getenv("AA", "GOOD" + "BAD") diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap index cea32c61e2..e9993dff2b 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__PLW2901_redefined_loop_name.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/redefined_loop_name.py:6:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:6:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 6 | # For -> for, variable reused 7 | for i in []: @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:11:9: PLW2901 `with` statement variable `i` overwritten by `for` loop target +redefined_loop_name.py:11:9: PLW2901 `with` statement variable `i` overwritten by `for` loop target | 11 | # With -> for, variable reused 12 | with None as i: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 14 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:16:18: PLW2901 `for` loop variable `i` overwritten by `with` statement target +redefined_loop_name.py:16:18: PLW2901 `for` loop variable `i` overwritten by `with` statement target | 16 | # For -> with, variable reused 17 | for i in []: @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 19 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:21:18: PLW2901 Outer `with` statement variable `i` overwritten by inner `with` statement target +redefined_loop_name.py:21:18: PLW2901 Outer `with` statement variable `i` overwritten by inner `with` statement target | 21 | # With -> with, variable reused 22 | with None as i: @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 24 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:37:13: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:37:13: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 37 | for i in []: 38 | for j in []: @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 40 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:43:13: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:43:13: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 43 | for i in []: 44 | for j in []: @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 47 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:44:17: PLW2901 Outer `for` loop variable `j` overwritten by inner `for` loop target +redefined_loop_name.py:44:17: PLW2901 Outer `for` loop variable `j` overwritten by inner `for` loop target | 44 | for j in []: 45 | for i in []: # error @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 47 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:52:5: PLW2901 `for` loop variable `i` overwritten by assignment target +redefined_loop_name.py:52:5: PLW2901 `for` loop variable `i` overwritten by assignment target | 52 | i = cast(int, i) 53 | i = typing.cast(int, i) @@ -75,7 +75,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 56 | # For -> augmented assignment | -./resources/test/fixtures/pylint/redefined_loop_name.py:56:5: PLW2901 `for` loop variable `i` overwritten by assignment target +redefined_loop_name.py:56:5: PLW2901 `for` loop variable `i` overwritten by assignment target | 56 | # For -> augmented assignment 57 | for i in []: @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 60 | # For -> annotated assignment | -./resources/test/fixtures/pylint/redefined_loop_name.py:60:5: PLW2901 `for` loop variable `i` overwritten by assignment target +redefined_loop_name.py:60:5: PLW2901 `for` loop variable `i` overwritten by assignment target | 60 | # For -> annotated assignment 61 | for i in []: @@ -95,7 +95,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 64 | # For -> annotated assignment without value | -./resources/test/fixtures/pylint/redefined_loop_name.py:68:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:68:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 68 | # Async for -> for, variable reused 69 | async for i in []: @@ -104,7 +104,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 71 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:73:15: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:73:15: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 73 | # For -> async for, variable reused 74 | for i in []: @@ -113,7 +113,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 76 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:78:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:78:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 78 | # For -> for, outer loop unpacks tuple 79 | for i, j in enumerate([]): @@ -122,7 +122,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 81 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:83:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:83:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 83 | # For -> for, inner loop unpacks tuple 84 | for i in []: @@ -131,7 +131,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 86 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:88:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:88:9: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 88 | # For -> for, both loops unpack tuple 89 | for (i, (j, k)) in []: @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 91 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:88:12: PLW2901 Outer `for` loop variable `j` overwritten by inner `for` loop target +redefined_loop_name.py:88:12: PLW2901 Outer `for` loop variable `j` overwritten by inner `for` loop target | 88 | # For -> for, both loops unpack tuple 89 | for (i, (j, k)) in []: @@ -149,7 +149,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 91 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:105:9: PLW2901 Outer `for` loop variable `j` overwritten by inner `for` loop target +redefined_loop_name.py:105:9: PLW2901 Outer `for` loop variable `j` overwritten by inner `for` loop target | 105 | # For -> for, outer loop unpacks with asterisk 106 | for i, *j in []: @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 108 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:122:13: PLW2901 `for` loop variable `i` overwritten by assignment target +redefined_loop_name.py:122:13: PLW2901 `for` loop variable `i` overwritten by assignment target | 122 | def f(): 123 | for i in []: # no error @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 126 | # For -> class definition -> for -> for | -./resources/test/fixtures/pylint/redefined_loop_name.py:128:17: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target +redefined_loop_name.py:128:17: PLW2901 Outer `for` loop variable `i` overwritten by inner `for` loop target | 128 | class A: 129 | for i in []: # no error @@ -177,7 +177,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 131 | pass | -./resources/test/fixtures/pylint/redefined_loop_name.py:143:5: PLW2901 `for` loop variable `a[0]` overwritten by assignment target +redefined_loop_name.py:143:5: PLW2901 `for` loop variable `a[0]` overwritten by assignment target | 143 | # For target with subscript -> assignment 144 | for a[0] in []: @@ -186,7 +186,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 146 | a[1] = 2 # no error | -./resources/test/fixtures/pylint/redefined_loop_name.py:148:5: PLW2901 `for` loop variable `a['i']` overwritten by assignment target +redefined_loop_name.py:148:5: PLW2901 `for` loop variable `a['i']` overwritten by assignment target | 148 | # For target with subscript -> assignment 149 | for a['i'] in []: @@ -195,7 +195,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 151 | a['j'] = 2 # no error | -./resources/test/fixtures/pylint/redefined_loop_name.py:153:5: PLW2901 `for` loop variable `a.i` overwritten by assignment target +redefined_loop_name.py:153:5: PLW2901 `for` loop variable `a.i` overwritten by assignment target | 153 | # For target with attribute -> assignment 154 | for a.i in []: @@ -204,7 +204,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 156 | a.j = 2 # no error | -./resources/test/fixtures/pylint/redefined_loop_name.py:158:5: PLW2901 `for` loop variable `a.i.j` overwritten by assignment target +redefined_loop_name.py:158:5: PLW2901 `for` loop variable `a.i.j` overwritten by assignment target | 158 | # For target with double nested attribute -> assignment 159 | for a.i.j in []: @@ -213,7 +213,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 161 | a.j.i = 2 # no error | -./resources/test/fixtures/pylint/redefined_loop_name.py:163:5: PLW2901 `for` loop variable `a.i` overwritten by assignment target +redefined_loop_name.py:163:5: PLW2901 `for` loop variable `a.i` overwritten by assignment target | 163 | # For target with attribute -> assignment with different spacing 164 | for a.i in []: @@ -223,7 +223,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 167 | a.i = 2 # error | -./resources/test/fixtures/pylint/redefined_loop_name.py:165:5: PLW2901 `for` loop variable `a.i` overwritten by assignment target +redefined_loop_name.py:165:5: PLW2901 `for` loop variable `a.i` overwritten by assignment target | 165 | a. i = 2 # error 166 | for a. i in []: diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap index 44ba1cd532..8d35c9f3d5 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__allow_magic_value_types.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/magic_value_comparison.py:59:22: PLR2004 Magic value used in comparison, consider replacing "Hunter2" with a constant variable +magic_value_comparison.py:59:22: PLR2004 Magic value used in comparison, consider replacing "Hunter2" with a constant variable | 59 | pass 60 | @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 62 | pass | -./resources/test/fixtures/pylint/magic_value_comparison.py:65:21: PLR2004 Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable +magic_value_comparison.py:65:21: PLR2004 Magic value used in comparison, consider replacing 3.141592653589793 with a constant variable | 65 | pi_estimation = 3.14 66 | @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 68 | pass | -./resources/test/fixtures/pylint/magic_value_comparison.py:74:18: PLR2004 Magic value used in comparison, consider replacing b"something" with a constant variable +magic_value_comparison.py:74:18: PLR2004 Magic value used in comparison, consider replacing b"something" with a constant variable | 74 | user_input = b"Hello, There!" 75 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap index 56843cab92..01512e6267 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__continue_in_finally.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/continue_in_finally.py:5:9: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:5:9: PLE0116 `continue` not supported inside `finally` clause | 5 | pass 6 | finally: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 9 | while True: | -./resources/test/fixtures/pylint/continue_in_finally.py:16:13: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:16:13: PLE0116 `continue` not supported inside `finally` clause | 16 | pass 17 | finally: @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 19 | pass | -./resources/test/fixtures/pylint/continue_in_finally.py:26:17: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:26:17: PLE0116 `continue` not supported inside `finally` clause | 26 | match test: 27 | case "aa": @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 30 | while True: | -./resources/test/fixtures/pylint/continue_in_finally.py:33:13: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:33:13: PLE0116 `continue` not supported inside `finally` clause | 33 | finally: 34 | with "aa" as f: @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 37 | while True: | -./resources/test/fixtures/pylint/continue_in_finally.py:40:13: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:40:13: PLE0116 `continue` not supported inside `finally` clause | 40 | finally: 41 | if True: @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 43 | continue # [continue-in-finally] | -./resources/test/fixtures/pylint/continue_in_finally.py:41:9: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:41:9: PLE0116 `continue` not supported inside `finally` clause | 41 | if True: 42 | continue # [continue-in-finally] @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 45 | def test(): | -./resources/test/fixtures/pylint/continue_in_finally.py:49:17: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:49:17: PLE0116 `continue` not supported inside `finally` clause | 49 | pass 50 | finally: @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/pylint/mod.rs | ^^^^^^^^ PLE0116 | -./resources/test/fixtures/pylint/continue_in_finally.py:56:9: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:56:9: PLE0116 `continue` not supported inside `finally` clause | 56 | pass 57 | finally: @@ -77,7 +77,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 60 | def test(): | -./resources/test/fixtures/pylint/continue_in_finally.py:69:9: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:69:9: PLE0116 `continue` not supported inside `finally` clause | 69 | for i in range(12): 70 | continue @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 73 | while True: | -./resources/test/fixtures/pylint/continue_in_finally.py:74:13: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:74:13: PLE0116 `continue` not supported inside `finally` clause | 74 | pass 75 | else: @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 78 | def test(): | -./resources/test/fixtures/pylint/continue_in_finally.py:89:13: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:89:13: PLE0116 `continue` not supported inside `finally` clause | 89 | pass 90 | elif False: @@ -107,7 +107,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 93 | continue # [continue-in-finally] | -./resources/test/fixtures/pylint/continue_in_finally.py:91:13: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:91:13: PLE0116 `continue` not supported inside `finally` clause | 91 | continue # [continue-in-finally] 92 | else: @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 95 | pass | -./resources/test/fixtures/pylint/continue_in_finally.py:95:17: PLE0116 `continue` not supported inside `finally` clause +continue_in_finally.py:95:17: PLE0116 `continue` not supported inside `finally` clause | 95 | pass 96 | else: diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap index d0abdb4d49..f29e0a3e29 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_arguments_params.py:3:5: PLR0913 Too many arguments to function call (6 > 4) +too_many_arguments_params.py:3:5: PLR0913 Too many arguments to function call (6 > 4) | 3 | # Too many args (6/4) for max_args=4 4 | # OK for dummy_variable_rgx ~ "skip_.*" @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 6 | pass | -./resources/test/fixtures/pylint/too_many_arguments_params.py:9:5: PLR0913 Too many arguments to function call (6 > 4) +too_many_arguments_params.py:9:5: PLR0913 Too many arguments to function call (6 > 4) | 9 | # Too many args (6/4) for max_args=4 10 | # Too many args (6/5) for dummy_variable_rgx ~ "skip_.*" diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap index a1b77452c7..b8539c1622 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_args_with_dummy_variables.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_arguments_params.py:9:5: PLR0913 Too many arguments to function call (6 > 5) +too_many_arguments_params.py:9:5: PLR0913 Too many arguments to function call (6 > 5) | 9 | # Too many args (6/4) for max_args=4 10 | # Too many args (6/5) for dummy_variable_rgx ~ "skip_.*" diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap index e29aa0ea52..cf97fdcf47 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_branches.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_branches_params.py:6:5: PLR0912 Too many branches (2 > 1) +too_many_branches_params.py:6:5: PLR0912 Too many branches (2 > 1) | 6 | def g(x): | ^ PLR0912 @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 | pass | -./resources/test/fixtures/pylint/too_many_branches_params.py:15:9: PLR0912 Too many branches (2 > 1) +too_many_branches_params.py:15:9: PLR0912 Too many branches (2 > 1) | 15 | return 16 | diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap index 2785a1ab42..4b022ab606 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_return_statements.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_return_statements_params.py:1:5: PLR0911 Too many return statements (2 > 1) +too_many_return_statements_params.py:1:5: PLR0911 Too many return statements (2 > 1) | 1 | def f(x): # Too many return statements (2/1) | ^ PLR0911 diff --git a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap index cf51be617d..e2e963c6fd 100644 --- a/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap +++ b/crates/ruff/src/rules/pylint/snapshots/ruff__rules__pylint__tests__max_statements.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pylint/mod.rs --- -./resources/test/fixtures/pylint/too_many_statements_params.py:2:5: PLR0915 Too many statements (2 > 1) +too_many_statements_params.py:2:5: PLR0915 Too many statements (2 > 1) | 2 | # Too may statements (2/1) for max_statements=1 3 | def f(x): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 4 | pass | -./resources/test/fixtures/pylint/too_many_statements_params.py:6:5: PLR0915 Too many statements (3 > 1) +too_many_statements_params.py:6:5: PLR0915 Too many statements (3 > 1) | 6 | def f(x): | ^ PLR0915 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pylint/mod.rs 8 | pass | -./resources/test/fixtures/pylint/too_many_statements_params.py:7:9: PLR0915 Too many statements (2 > 1) +too_many_statements_params.py:7:9: PLR0915 Too many statements (2 > 1) | 7 | def f(x): 8 | def g(x): diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap index 6aa8f23e00..56563313c7 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP001.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP001.py:2:5: UP001 [*] `__metaclass__ = type` is implied +UP001.py:2:5: UP001 [*] `__metaclass__ = type` is implied | 2 | class A: 3 | __metaclass__ = type @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | 5 5 | class B: -./resources/test/fixtures/pyupgrade/UP001.py:6:5: UP001 [*] `__metaclass__ = type` is implied +UP001.py:6:5: UP001 [*] `__metaclass__ = type` is implied | 6 | class B: 7 | __metaclass__ = type diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap index 3d2dbb05f5..981bd129e1 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP003.py:1:1: UP003 [*] Use `str` instead of `type(...)` +UP003.py:1:1: UP003 [*] Use `str` instead of `type(...)` | 1 | type("") | ^^^^^^^^ UP003 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 3 3 | type(0) 4 4 | type(0.0) -./resources/test/fixtures/pyupgrade/UP003.py:2:1: UP003 [*] Use `bytes` instead of `type(...)` +UP003.py:2:1: UP003 [*] Use `bytes` instead of `type(...)` | 2 | type("") 3 | type(b"") @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | type(0.0) 5 5 | type(0j) -./resources/test/fixtures/pyupgrade/UP003.py:3:1: UP003 [*] Use `int` instead of `type(...)` +UP003.py:3:1: UP003 [*] Use `int` instead of `type(...)` | 3 | type("") 4 | type(b"") @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 5 | type(0j) 6 6 | -./resources/test/fixtures/pyupgrade/UP003.py:4:1: UP003 [*] Use `float` instead of `type(...)` +UP003.py:4:1: UP003 [*] Use `float` instead of `type(...)` | 4 | type(b"") 5 | type(0) @@ -75,7 +75,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | 7 7 | # OK -./resources/test/fixtures/pyupgrade/UP003.py:5:1: UP003 [*] Use `complex` instead of `type(...)` +UP003.py:5:1: UP003 [*] Use `complex` instead of `type(...)` | 5 | type(0) 6 | type(0.0) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap index e96c793e24..5bcbdfd25a 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP004.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP004.py:5:9: UP004 [*] Class `A` inherits from `object` +UP004.py:5:9: UP004 [*] Class `A` inherits from `object` | 5 | class A(object): | ^^^^^^ UP004 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 7 | 8 8 | -./resources/test/fixtures/pyupgrade/UP004.py:10:5: UP004 [*] Class `A` inherits from `object` +UP004.py:10:5: UP004 [*] Class `A` inherits from `object` | 10 | class A( 11 | object, @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 11 | 14 12 | -./resources/test/fixtures/pyupgrade/UP004.py:16:5: UP004 [*] Class `A` inherits from `object` +UP004.py:16:5: UP004 [*] Class `A` inherits from `object` | 16 | class A( 17 | object, @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 17 | 21 18 | -./resources/test/fixtures/pyupgrade/UP004.py:24:5: UP004 [*] Class `A` inherits from `object` +UP004.py:24:5: UP004 [*] Class `A` inherits from `object` | 24 | class A( 25 | # @@ -88,7 +88,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 27 24 | 28 25 | -./resources/test/fixtures/pyupgrade/UP004.py:31:5: UP004 [*] Class `A` inherits from `object` +UP004.py:31:5: UP004 [*] Class `A` inherits from `object` | 31 | class A( 32 | # @@ -112,7 +112,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 34 31 | 35 32 | -./resources/test/fixtures/pyupgrade/UP004.py:37:5: UP004 [*] Class `A` inherits from `object` +UP004.py:37:5: UP004 [*] Class `A` inherits from `object` | 37 | class A( 38 | object @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 41 38 | 42 39 | -./resources/test/fixtures/pyupgrade/UP004.py:45:5: UP004 [*] Class `A` inherits from `object` +UP004.py:45:5: UP004 [*] Class `A` inherits from `object` | 45 | class A( 46 | # @@ -160,7 +160,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 45 | 50 46 | -./resources/test/fixtures/pyupgrade/UP004.py:53:5: UP004 [*] Class `A` inherits from `object` +UP004.py:53:5: UP004 [*] Class `A` inherits from `object` | 53 | class A( 54 | # @@ -185,7 +185,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 57 53 | 58 54 | -./resources/test/fixtures/pyupgrade/UP004.py:61:5: UP004 [*] Class `A` inherits from `object` +UP004.py:61:5: UP004 [*] Class `A` inherits from `object` | 61 | class A( 62 | # @@ -210,7 +210,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 65 61 | 66 62 | -./resources/test/fixtures/pyupgrade/UP004.py:69:5: UP004 [*] Class `A` inherits from `object` +UP004.py:69:5: UP004 [*] Class `A` inherits from `object` | 69 | class A( 70 | # @@ -235,7 +235,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 73 69 | 74 70 | -./resources/test/fixtures/pyupgrade/UP004.py:75:12: UP004 [*] Class `B` inherits from `object` +UP004.py:75:12: UP004 [*] Class `B` inherits from `object` | 75 | class B(A, object): | ^^^^^^ UP004 @@ -253,7 +253,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 77 77 | 78 78 | -./resources/test/fixtures/pyupgrade/UP004.py:79:9: UP004 [*] Class `B` inherits from `object` +UP004.py:79:9: UP004 [*] Class `B` inherits from `object` | 79 | class B(object, A): | ^^^^^^ UP004 @@ -271,7 +271,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 81 81 | 82 82 | -./resources/test/fixtures/pyupgrade/UP004.py:84:5: UP004 [*] Class `B` inherits from `object` +UP004.py:84:5: UP004 [*] Class `B` inherits from `object` | 84 | class B( 85 | object, @@ -290,7 +290,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 86 85 | ): 87 86 | ... -./resources/test/fixtures/pyupgrade/UP004.py:92:5: UP004 [*] Class `B` inherits from `object` +UP004.py:92:5: UP004 [*] Class `B` inherits from `object` | 92 | class B( 93 | A, @@ -310,7 +310,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 94 93 | ... 95 94 | -./resources/test/fixtures/pyupgrade/UP004.py:98:5: UP004 [*] Class `B` inherits from `object` +UP004.py:98:5: UP004 [*] Class `B` inherits from `object` | 98 | class B( 99 | object, @@ -329,7 +329,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 100 99 | A, 101 100 | ): -./resources/test/fixtures/pyupgrade/UP004.py:108:5: UP004 [*] Class `B` inherits from `object` +UP004.py:108:5: UP004 [*] Class `B` inherits from `object` | 108 | # Comment on A. 109 | A, @@ -349,7 +349,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 110 109 | ... 111 110 | -./resources/test/fixtures/pyupgrade/UP004.py:114:13: UP004 [*] Class `A` inherits from `object` +UP004.py:114:13: UP004 [*] Class `A` inherits from `object` | 114 | def f(): 115 | class A(object): @@ -368,7 +368,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 116 116 | 117 117 | -./resources/test/fixtures/pyupgrade/UP004.py:119:5: UP004 [*] Class `A` inherits from `object` +UP004.py:119:5: UP004 [*] Class `A` inherits from `object` | 119 | class A( 120 | object, @@ -390,7 +390,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 122 120 | 123 121 | -./resources/test/fixtures/pyupgrade/UP004.py:125:5: UP004 [*] Class `A` inherits from `object` +UP004.py:125:5: UP004 [*] Class `A` inherits from `object` | 125 | class A( 126 | object, # ) @@ -412,7 +412,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 128 126 | 129 127 | -./resources/test/fixtures/pyupgrade/UP004.py:131:5: UP004 [*] Class `A` inherits from `object` +UP004.py:131:5: UP004 [*] Class `A` inherits from `object` | 131 | class A( 132 | object # ) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap index 21a0257b97..8e206db80b 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP005.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP005.py:6:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` +UP005.py:6:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` | 6 | class Suite(unittest.TestCase): 7 | def test(self) -> None: @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | self.assertEqual(3, 4) 9 9 | self.failUnlessAlmostEqual(1, 1.1) -./resources/test/fixtures/pyupgrade/UP005.py:7:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` +UP005.py:7:9: UP005 [*] `assertEquals` is deprecated, use `assertEqual` | 7 | def test(self) -> None: 8 | self.assertEquals (1, 2) @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | self.failUnlessAlmostEqual(1, 1.1) 10 10 | self.assertNotRegexpMatches("a", "b") -./resources/test/fixtures/pyupgrade/UP005.py:9:9: UP005 [*] `failUnlessAlmostEqual` is deprecated, use `assertAlmostEqual` +UP005.py:9:9: UP005 [*] `failUnlessAlmostEqual` is deprecated, use `assertAlmostEqual` | 9 | self.assertEquals(1, 2) 10 | self.assertEqual(3, 4) @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 |+ self.assertAlmostEqual(1, 1.1) 10 10 | self.assertNotRegexpMatches("a", "b") -./resources/test/fixtures/pyupgrade/UP005.py:10:9: UP005 [*] `assertNotRegexpMatches` is deprecated, use `assertNotRegex` +UP005.py:10:9: UP005 [*] `assertNotRegexpMatches` is deprecated, use `assertNotRegex` | 10 | self.assertEqual(3, 4) 11 | self.failUnlessAlmostEqual(1, 1.1) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap index 841b8724a5..19db55b0de 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP006.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP006.py:4:10: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:4:10: UP006 [*] Use `list` instead of `List` for type annotations | 4 | def f(x: typing.List[str]) -> None: | ^^^^^^^^^^^ UP006 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | 7 7 | -./resources/test/fixtures/pyupgrade/UP006.py:11:10: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:11:10: UP006 [*] Use `list` instead of `List` for type annotations | 11 | def f(x: List[str]) -> None: | ^^^^ UP006 @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | 14 14 | -./resources/test/fixtures/pyupgrade/UP006.py:18:10: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:18:10: UP006 [*] Use `list` instead of `List` for type annotations | 18 | def f(x: t.List[str]) -> None: | ^^^^^^ UP006 @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | 21 21 | -./resources/test/fixtures/pyupgrade/UP006.py:25:10: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:25:10: UP006 [*] Use `list` instead of `List` for type annotations | 25 | def f(x: IList[str]) -> None: | ^^^^^ UP006 @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 27 27 | 28 28 | -./resources/test/fixtures/pyupgrade/UP006.py:29:11: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:29:11: UP006 [*] Use `list` instead of `List` for type annotations | 29 | def f(x: "List[str]") -> None: | ^^^^ UP006 @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 31 31 | 32 32 | -./resources/test/fixtures/pyupgrade/UP006.py:33:12: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:33:12: UP006 [*] Use `list` instead of `List` for type annotations | 33 | def f(x: r"List[str]") -> None: | ^^^^ UP006 @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 35 35 | 36 36 | -./resources/test/fixtures/pyupgrade/UP006.py:37:11: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:37:11: UP006 [*] Use `list` instead of `List` for type annotations | 37 | def f(x: "List[str]") -> None: | ^^^^ UP006 @@ -127,7 +127,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 39 39 | 40 40 | -./resources/test/fixtures/pyupgrade/UP006.py:41:13: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:41:13: UP006 [*] Use `list` instead of `List` for type annotations | 41 | def f(x: """List[str]""") -> None: | ^^^^ UP006 @@ -145,14 +145,14 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 43 43 | 44 44 | -./resources/test/fixtures/pyupgrade/UP006.py:45:10: UP006 Use `list` instead of `List` for type annotations +UP006.py:45:10: UP006 Use `list` instead of `List` for type annotations | 45 | def f(x: "Li" "st[str]") -> None: | ^^^^^^^^^^^^^^ UP006 46 | ... | -./resources/test/fixtures/pyupgrade/UP006.py:49:11: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:49:11: UP006 [*] Use `list` instead of `List` for type annotations | 49 | def f(x: "List['List[str]']") -> None: | ^^^^ UP006 @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 51 51 | 52 52 | -./resources/test/fixtures/pyupgrade/UP006.py:49:17: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:49:17: UP006 [*] Use `list` instead of `List` for type annotations | 49 | def f(x: "List['List[str]']") -> None: | ^^^^ UP006 @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 51 51 | 52 52 | -./resources/test/fixtures/pyupgrade/UP006.py:53:11: UP006 [*] Use `list` instead of `List` for type annotations +UP006.py:53:11: UP006 [*] Use `list` instead of `List` for type annotations | 53 | def f(x: "List['Li' 'st[str]']") -> None: | ^^^^ UP006 @@ -206,21 +206,21 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 55 55 | 56 56 | -./resources/test/fixtures/pyupgrade/UP006.py:53:16: UP006 Use `list` instead of `List` for type annotations +UP006.py:53:16: UP006 Use `list` instead of `List` for type annotations | 53 | def f(x: "List['Li' 'st[str]']") -> None: | ^^^^^^^^^^^^^^ UP006 54 | ... | -./resources/test/fixtures/pyupgrade/UP006.py:57:10: UP006 Use `list` instead of `List` for type annotations +UP006.py:57:10: UP006 Use `list` instead of `List` for type annotations | 57 | def f(x: "Li" "st['List[str]']") -> None: | ^^^^^^^^^^^^^^^^^^^^^^ UP006 58 | ... | -./resources/test/fixtures/pyupgrade/UP006.py:57:10: UP006 Use `list` instead of `List` for type annotations +UP006.py:57:10: UP006 Use `list` instead of `List` for type annotations | 57 | def f(x: "Li" "st['List[str]']") -> None: | ^^^^^^^^^^^^^^^^^^^^^^ UP006 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap index eb2b515a7e..079806c6bf 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP007.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP007.py:6:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:6:10: UP007 [*] Use `X | Y` for type annotations | 6 | def f(x: Optional[str]) -> None: | ^^^^^^^^^^^^^ UP007 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | 9 9 | -./resources/test/fixtures/pyupgrade/UP007.py:10:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:10:10: UP007 [*] Use `X | Y` for type annotations | 10 | def f(x: typing.Optional[str]) -> None: | ^^^^^^^^^^^^^^^^^^^^ UP007 @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | 13 13 | -./resources/test/fixtures/pyupgrade/UP007.py:14:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:14:10: UP007 [*] Use `X | Y` for type annotations | 14 | def f(x: Union[str, int, Union[float, bytes]]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 16 | 17 17 | -./resources/test/fixtures/pyupgrade/UP007.py:14:26: UP007 [*] Use `X | Y` for type annotations +UP007.py:14:26: UP007 [*] Use `X | Y` for type annotations | 14 | def f(x: Union[str, int, Union[float, bytes]]) -> None: | ^^^^^^^^^^^^^^^^^^^ UP007 @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 16 | 17 17 | -./resources/test/fixtures/pyupgrade/UP007.py:18:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:18:10: UP007 [*] Use `X | Y` for type annotations | 18 | def f(x: typing.Union[str, int]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | 21 21 | -./resources/test/fixtures/pyupgrade/UP007.py:22:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:22:10: UP007 [*] Use `X | Y` for type annotations | 22 | def f(x: typing.Union[(str, int)]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 24 | 25 25 | -./resources/test/fixtures/pyupgrade/UP007.py:26:10: UP007 [*] Use `X | Y` for type annotations +UP007.py:26:10: UP007 [*] Use `X | Y` for type annotations | 26 | def f(x: typing.Union[(str, int), float]) -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -127,7 +127,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 28 28 | 29 29 | -./resources/test/fixtures/pyupgrade/UP007.py:30:11: UP007 [*] Use `X | Y` for type annotations +UP007.py:30:11: UP007 [*] Use `X | Y` for type annotations | 30 | def f(x: "Union[str, int, Union[float, bytes]]") -> None: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 32 | 33 33 | -./resources/test/fixtures/pyupgrade/UP007.py:30:27: UP007 [*] Use `X | Y` for type annotations +UP007.py:30:27: UP007 [*] Use `X | Y` for type annotations | 30 | def f(x: "Union[str, int, Union[float, bytes]]") -> None: | ^^^^^^^^^^^^^^^^^^^ UP007 @@ -163,7 +163,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 32 | 33 33 | -./resources/test/fixtures/pyupgrade/UP007.py:34:11: UP007 [*] Use `X | Y` for type annotations +UP007.py:34:11: UP007 [*] Use `X | Y` for type annotations | 34 | def f(x: "typing.Union[str, int]") -> None: | ^^^^^^^^^^^^^^^^^^^^^^ UP007 @@ -181,7 +181,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 36 36 | 37 37 | -./resources/test/fixtures/pyupgrade/UP007.py:47:8: UP007 [*] Use `X | Y` for type annotations +UP007.py:47:8: UP007 [*] Use `X | Y` for type annotations | 47 | def f() -> None: 48 | x: Optional[str] @@ -200,7 +200,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 49 | 50 50 | x = Union[str, int] -./resources/test/fixtures/pyupgrade/UP007.py:52:8: UP007 [*] Use `X | Y` for type annotations +UP007.py:52:8: UP007 [*] Use `X | Y` for type annotations | 52 | x = Union[str, int] 53 | x = Union["str", "int"] diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap index b5c68a71a5..9b073050ec 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP008.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP008.py:17:18: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:17:18: UP008 [*] Use `super()` instead of `super(__class__, self)` | 17 | def wrong(self): 18 | parent = super(Child, self) # wrong @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 19 | super( 20 20 | Child, -./resources/test/fixtures/pyupgrade/UP008.py:18:9: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:18:9: UP008 [*] Use `super()` instead of `super(__class__, self)` | 18 | def wrong(self): 19 | parent = super(Child, self) # wrong @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | Child, 21 21 | self, -./resources/test/fixtures/pyupgrade/UP008.py:19:9: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:19:9: UP008 [*] Use `super()` instead of `super(__class__, self)` | 19 | parent = super(Child, self) # wrong 20 | super(Child, self).method # wrong @@ -68,7 +68,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 21 | 25 22 | class BaseClass: -./resources/test/fixtures/pyupgrade/UP008.py:36:9: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:36:9: UP008 [*] Use `super()` instead of `super(__class__, self)` | 36 | class MyClass(BaseClass): 37 | def normal(self): @@ -88,7 +88,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 38 38 | 39 39 | def different_argument(self, other): -./resources/test/fixtures/pyupgrade/UP008.py:50:13: UP008 [*] Use `super()` instead of `super(__class__, self)` +UP008.py:50:13: UP008 [*] Use `super()` instead of `super(__class__, self)` | 50 | def inner_argument(self): 51 | super(MyClass, self).f() # can use super() diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap index a84ed83e5e..42e1dbd19f 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP009_0.py:1:1: UP009 [*] UTF-8 encoding declaration is unnecessary +UP009_0.py:1:1: UP009 [*] UTF-8 encoding declaration is unnecessary | 1 | / # coding=utf8 2 | | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap index b09c2daf5b..97b7656efd 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP009_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP009_1.py:2:1: UP009 [*] UTF-8 encoding declaration is unnecessary +UP009_1.py:2:1: UP009 [*] UTF-8 encoding declaration is unnecessary | 2 | #!/usr/bin/python 3 | / # -*- coding: utf-8 -*- diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap index f987faca47..218acc5453 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP010.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP010.py:1:1: UP010 [*] Unnecessary `__future__` imports `generators`, `nested_scopes` for target Python version +UP010.py:1:1: UP010 [*] Unnecessary `__future__` imports `generators`, `nested_scopes` for target Python version | 1 | from __future__ import nested_scopes, generators | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP010 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 3 2 | from __future__ import absolute_import, division 4 3 | from __future__ import generator_stop -./resources/test/fixtures/pyupgrade/UP010.py:2:1: UP010 [*] Unnecessary `__future__` imports `unicode_literals`, `with_statement` for target Python version +UP010.py:2:1: UP010 [*] Unnecessary `__future__` imports `unicode_literals`, `with_statement` for target Python version | 2 | from __future__ import nested_scopes, generators 3 | from __future__ import with_statement, unicode_literals @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 3 | from __future__ import generator_stop 5 4 | from __future__ import print_function, generator_stop -./resources/test/fixtures/pyupgrade/UP010.py:3:1: UP010 [*] Unnecessary `__future__` imports `absolute_import`, `division` for target Python version +UP010.py:3:1: UP010 [*] Unnecessary `__future__` imports `absolute_import`, `division` for target Python version | 3 | from __future__ import nested_scopes, generators 4 | from __future__ import with_statement, unicode_literals @@ -52,7 +52,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 4 | from __future__ import print_function, generator_stop 6 5 | from __future__ import invalid_module, generators -./resources/test/fixtures/pyupgrade/UP010.py:4:1: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version +UP010.py:4:1: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version | 4 | from __future__ import with_statement, unicode_literals 5 | from __future__ import absolute_import, division @@ -72,7 +72,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 5 | from __future__ import invalid_module, generators 7 6 | -./resources/test/fixtures/pyupgrade/UP010.py:5:1: UP010 [*] Unnecessary `__future__` imports `generator_stop`, `print_function` for target Python version +UP010.py:5:1: UP010 [*] Unnecessary `__future__` imports `generator_stop`, `print_function` for target Python version | 5 | from __future__ import absolute_import, division 6 | from __future__ import generator_stop @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 6 | 8 7 | if True: -./resources/test/fixtures/pyupgrade/UP010.py:6:1: UP010 [*] Unnecessary `__future__` import `generators` for target Python version +UP010.py:6:1: UP010 [*] Unnecessary `__future__` import `generators` for target Python version | 6 | from __future__ import generator_stop 7 | from __future__ import print_function, generator_stop @@ -112,7 +112,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | if True: 9 9 | from __future__ import generator_stop -./resources/test/fixtures/pyupgrade/UP010.py:9:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version +UP010.py:9:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version | 9 | if True: 10 | from __future__ import generator_stop @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 11 10 | 12 11 | if True: -./resources/test/fixtures/pyupgrade/UP010.py:10:5: UP010 [*] Unnecessary `__future__` import `generators` for target Python version +UP010.py:10:5: UP010 [*] Unnecessary `__future__` import `generators` for target Python version | 10 | if True: 11 | from __future__ import generator_stop @@ -151,7 +151,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | if True: 13 13 | from __future__ import generator_stop -./resources/test/fixtures/pyupgrade/UP010.py:13:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version +UP010.py:13:5: UP010 [*] Unnecessary `__future__` import `generator_stop` for target Python version | 13 | if True: 14 | from __future__ import generator_stop @@ -167,7 +167,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 |- from __future__ import generator_stop 14 13 | from __future__ import invalid_module, generators -./resources/test/fixtures/pyupgrade/UP010.py:14:5: UP010 [*] Unnecessary `__future__` import `generators` for target Python version +UP010.py:14:5: UP010 [*] Unnecessary `__future__` import `generators` for target Python version | 14 | if True: 15 | from __future__ import generator_stop diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap index 6851013355..cdd094abe4 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP011.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP011.py:5:21: UP011 [*] Unnecessary parameters to `functools.lru_cache` +UP011.py:5:21: UP011 [*] Unnecessary parameters to `functools.lru_cache` | 5 | @functools.lru_cache() | ^^ UP011 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 7 | pass 8 8 | -./resources/test/fixtures/pyupgrade/UP011.py:10:11: UP011 [*] Unnecessary parameters to `functools.lru_cache` +UP011.py:10:11: UP011 [*] Unnecessary parameters to `functools.lru_cache` | 10 | @lru_cache() | ^^ UP011 @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | pass 13 13 | -./resources/test/fixtures/pyupgrade/UP011.py:16:21: UP011 [*] Unnecessary parameters to `functools.lru_cache` +UP011.py:16:21: UP011 [*] Unnecessary parameters to `functools.lru_cache` | 16 | @other_decorator 17 | @functools.lru_cache() @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | pass 19 19 | -./resources/test/fixtures/pyupgrade/UP011.py:21:21: UP011 [*] Unnecessary parameters to `functools.lru_cache` +UP011.py:21:21: UP011 [*] Unnecessary parameters to `functools.lru_cache` | 21 | @functools.lru_cache() | ^^ UP011 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap index ccd0f2bad0..485ba36a2a 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP012.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP012.py:2:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:2:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 2 | # ASCII literals should be replaced by a bytes literal 3 | "foo".encode("utf-8") # b"foo" @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | "foo".encode() # b"foo" 5 5 | "foo".encode("UTF8") # b"foo" -./resources/test/fixtures/pyupgrade/UP012.py:3:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:3:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 3 | # ASCII literals should be replaced by a bytes literal 4 | "foo".encode("utf-8") # b"foo" @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 5 | "foo".encode("UTF8") # b"foo" 6 6 | U"foo".encode("utf-8") # b"foo" -./resources/test/fixtures/pyupgrade/UP012.py:4:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:4:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 4 | "foo".encode("utf-8") # b"foo" 5 | "foo".encode("u8") # b"foo" @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | U"foo".encode("utf-8") # b"foo" 7 7 | "foo".encode(encoding="utf-8") # b"foo" -./resources/test/fixtures/pyupgrade/UP012.py:5:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:5:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 5 | "foo".encode("u8") # b"foo" 6 | "foo".encode() # b"foo" @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 7 | "foo".encode(encoding="utf-8") # b"foo" 8 8 | """ -./resources/test/fixtures/pyupgrade/UP012.py:6:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:6:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 6 | "foo".encode() # b"foo" 7 | "foo".encode("UTF8") # b"foo" @@ -102,7 +102,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | """ 9 9 | Lorem -./resources/test/fixtures/pyupgrade/UP012.py:7:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:7:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 7 | "foo".encode("UTF8") # b"foo" 8 | U"foo".encode("utf-8") # b"foo" @@ -123,7 +123,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | Lorem 10 10 | -./resources/test/fixtures/pyupgrade/UP012.py:8:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:8:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 8 | U"foo".encode("utf-8") # b"foo" 9 | "foo".encode(encoding="utf-8") # b"foo" @@ -157,7 +157,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 14 | "Lorem " 17 15 | "Ipsum".encode() -./resources/test/fixtures/pyupgrade/UP012.py:16:5: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:16:5: UP012 [*] Unnecessary call to `encode` as UTF-8 | 16 | ) 17 | ( @@ -182,7 +182,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 19 | ( 20 20 | "Lorem " # Comment -./resources/test/fixtures/pyupgrade/UP012.py:20:5: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:20:5: UP012 [*] Unnecessary call to `encode` as UTF-8 | 20 | ) 21 | ( @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 23 23 | ( 24 24 | "Lorem " "Ipsum".encode() -./resources/test/fixtures/pyupgrade/UP012.py:24:5: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:24:5: UP012 [*] Unnecessary call to `encode` as UTF-8 | 24 | ) 25 | ( @@ -227,7 +227,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 26 | 27 27 | # `encode` on variables should not be processed. -./resources/test/fixtures/pyupgrade/UP012.py:32:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:32:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 32 | bar = "bar" 33 | f"foo{bar}".encode("utf-8") @@ -247,7 +247,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 34 34 | "foo".encode(encoding) 35 35 | f"foo{bar}".encode(encoding) -./resources/test/fixtures/pyupgrade/UP012.py:36:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:36:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 36 | "foo".encode(encoding) 37 | f"foo{bar}".encode(encoding) @@ -272,7 +272,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 40 38 | # `encode` with custom args and kwargs should not be processed. 41 39 | "foo".encode("utf-8", errors="replace") -./resources/test/fixtures/pyupgrade/UP012.py:53:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:53:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 53 | # Unicode literals should only be stripped of default encoding. 54 | "unicode text©".encode("utf-8") # "unicode text©".encode() @@ -292,7 +292,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 55 55 | "unicode text©".encode(encoding="UTF8") # "unicode text©".encode() 56 56 | -./resources/test/fixtures/pyupgrade/UP012.py:55:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:55:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 55 | "unicode text©".encode("utf-8") # "unicode text©".encode() 56 | "unicode text©".encode() @@ -313,7 +313,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 57 57 | r"foo\o".encode("utf-8") # br"foo\o" 58 58 | u"foo".encode("utf-8") # b"foo" -./resources/test/fixtures/pyupgrade/UP012.py:57:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:57:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 57 | "unicode text©".encode(encoding="UTF8") # "unicode text©".encode() 58 | @@ -334,7 +334,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 59 59 | R"foo\o".encode("utf-8") # br"foo\o" 60 60 | U"foo".encode("utf-8") # b"foo" -./resources/test/fixtures/pyupgrade/UP012.py:58:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:58:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 58 | r"foo\o".encode("utf-8") # br"foo\o" 59 | u"foo".encode("utf-8") # b"foo" @@ -354,7 +354,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 60 60 | U"foo".encode("utf-8") # b"foo" 61 61 | print("foo".encode()) # print(b"foo") -./resources/test/fixtures/pyupgrade/UP012.py:59:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:59:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 59 | r"foo\o".encode("utf-8") # br"foo\o" 60 | u"foo".encode("utf-8") # b"foo" @@ -374,7 +374,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 60 60 | U"foo".encode("utf-8") # b"foo" 61 61 | print("foo".encode()) # print(b"foo") -./resources/test/fixtures/pyupgrade/UP012.py:60:1: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:60:1: UP012 [*] Unnecessary call to `encode` as UTF-8 | 60 | u"foo".encode("utf-8") # b"foo" 61 | R"foo\o".encode("utf-8") # br"foo\o" @@ -392,7 +392,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 60 |+b"foo" # b"foo" 61 61 | print("foo".encode()) # print(b"foo") -./resources/test/fixtures/pyupgrade/UP012.py:61:7: UP012 [*] Unnecessary call to `encode` as UTF-8 +UP012.py:61:7: UP012 [*] Unnecessary call to `encode` as UTF-8 | 61 | R"foo\o".encode("utf-8") # br"foo\o" 62 | U"foo".encode("utf-8") # b"foo" diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap index 52a9a9fe27..1f87b0920c 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP013.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP013.py:5:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:5:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 5 | # dict literal 6 | MyType = TypedDict("MyType", {"a": int, "b": str}) @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 9 | # dict call 8 10 | MyType = TypedDict("MyType", dict(a=int, b=str)) -./resources/test/fixtures/pyupgrade/UP013.py:8:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:8:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 8 | # dict call 9 | MyType = TypedDict("MyType", dict(a=int, b=str)) @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 12 | # kwargs 11 13 | MyType = TypedDict("MyType", a=int, b=str) -./resources/test/fixtures/pyupgrade/UP013.py:11:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:11:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 11 | # kwargs 12 | MyType = TypedDict("MyType", a=int, b=str) @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 15 | # Empty TypedDict 14 16 | MyType = TypedDict("MyType") -./resources/test/fixtures/pyupgrade/UP013.py:14:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:14:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 14 | # Empty TypedDict 15 | MyType = TypedDict("MyType") @@ -88,7 +88,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 17 | # Literal values 17 18 | MyType = TypedDict("MyType", {"a": "hello"}) -./resources/test/fixtures/pyupgrade/UP013.py:17:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:17:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 17 | # Literal values 18 | MyType = TypedDict("MyType", {"a": "hello"}) @@ -108,7 +108,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 20 | 20 21 | # NotRequired -./resources/test/fixtures/pyupgrade/UP013.py:18:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:18:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 18 | # Literal values 19 | MyType = TypedDict("MyType", {"a": "hello"}) @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 21 | # NotRequired 21 22 | MyType = TypedDict("MyType", {"a": NotRequired[dict]}) -./resources/test/fixtures/pyupgrade/UP013.py:21:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:21:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 21 | # NotRequired 22 | MyType = TypedDict("MyType", {"a": NotRequired[dict]}) @@ -151,7 +151,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 23 24 | # total 24 25 | MyType = TypedDict("MyType", {"x": int, "y": int}, total=False) -./resources/test/fixtures/pyupgrade/UP013.py:24:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:24:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 24 | # total 25 | MyType = TypedDict("MyType", {"x": int, "y": int}, total=False) @@ -173,7 +173,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 28 | # using Literal type 27 29 | MyType = TypedDict("MyType", {"key": Literal["value"]}) -./resources/test/fixtures/pyupgrade/UP013.py:27:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:27:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 27 | # using Literal type 28 | MyType = TypedDict("MyType", {"key": Literal["value"]}) @@ -194,7 +194,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 29 30 | # using namespace TypedDict 30 31 | MyType = typing.TypedDict("MyType", {"key": int}) -./resources/test/fixtures/pyupgrade/UP013.py:30:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:30:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 30 | # using namespace TypedDict 31 | MyType = typing.TypedDict("MyType", {"key": int}) @@ -215,7 +215,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 33 | # invalid identifiers (OK) 33 34 | MyType = TypedDict("MyType", {"in": int, "x-y": int}) -./resources/test/fixtures/pyupgrade/UP013.py:40:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:40:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 40 | # Empty dict literal 41 | MyType = TypedDict("MyType", {}) @@ -236,7 +236,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 43 | # Empty dict call 43 44 | MyType = TypedDict("MyType", dict()) -./resources/test/fixtures/pyupgrade/UP013.py:43:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax +UP013.py:43:1: UP013 [*] Convert `MyType` from `TypedDict` functional to class syntax | 43 | # Empty dict call 44 | MyType = TypedDict("MyType", dict()) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap index 0259c3eb31..613bf955a6 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP014.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP014.py:5:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:5:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax | 5 | # with complex annotations 6 | MyType = NamedTuple("MyType", [("a", int), ("b", tuple[str, ...])]) @@ -23,7 +23,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 9 | # with default values as list 8 10 | MyType = NamedTuple( -./resources/test/fixtures/pyupgrade/UP014.py:8:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:8:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax | 8 | # with default values as list 9 | / MyType = NamedTuple( @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 13 | # with namespace 15 14 | MyType = typing.NamedTuple("MyType", [("a", int), ("b", str)]) -./resources/test/fixtures/pyupgrade/UP014.py:15:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:15:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax | 15 | # with namespace 16 | MyType = typing.NamedTuple("MyType", [("a", int), ("b", str)]) @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 17 19 | # too many default values (OK) 18 20 | MyType = NamedTuple( -./resources/test/fixtures/pyupgrade/UP014.py:28:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:28:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax | 28 | # no fields 29 | MyType = typing.NamedTuple("MyType") @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 30 31 | # empty fields 31 32 | MyType = typing.NamedTuple("MyType", []) -./resources/test/fixtures/pyupgrade/UP014.py:31:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax +UP014.py:31:1: UP014 [*] Convert `MyType` from `NamedTuple` functional to class syntax | 31 | # empty fields 32 | MyType = typing.NamedTuple("MyType", []) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap index 973e0c5d67..52c01c21f3 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP015.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP015.py:1:1: UP015 [*] Unnecessary open mode parameters +UP015.py:1:1: UP015 [*] Unnecessary open mode parameters | 1 | open("foo", "U") | ^^^^^^^^^^^^^^^^ UP015 @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 3 3 | open("foo", "Ub") 4 4 | open("foo", "rUb") -./resources/test/fixtures/pyupgrade/UP015.py:2:1: UP015 [*] Unnecessary open mode parameters +UP015.py:2:1: UP015 [*] Unnecessary open mode parameters | 2 | open("foo", "U") 3 | open("foo", "Ur") @@ -35,7 +35,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | open("foo", "rUb") 5 5 | open("foo", "r") -./resources/test/fixtures/pyupgrade/UP015.py:3:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:3:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 3 | open("foo", "U") 4 | open("foo", "Ur") @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 5 | open("foo", "r") 6 6 | open("foo", "rt") -./resources/test/fixtures/pyupgrade/UP015.py:4:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:4:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 4 | open("foo", "Ur") 5 | open("foo", "Ub") @@ -76,7 +76,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | open("foo", "rt") 7 7 | open("f", "r", encoding="UTF-8") -./resources/test/fixtures/pyupgrade/UP015.py:5:1: UP015 [*] Unnecessary open mode parameters +UP015.py:5:1: UP015 [*] Unnecessary open mode parameters | 5 | open("foo", "Ub") 6 | open("foo", "rUb") @@ -97,7 +97,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 7 | open("f", "r", encoding="UTF-8") 8 8 | open("f", "wt") -./resources/test/fixtures/pyupgrade/UP015.py:6:1: UP015 [*] Unnecessary open mode parameters +UP015.py:6:1: UP015 [*] Unnecessary open mode parameters | 6 | open("foo", "rUb") 7 | open("foo", "r") @@ -118,7 +118,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | open("f", "wt") 9 9 | -./resources/test/fixtures/pyupgrade/UP015.py:7:1: UP015 [*] Unnecessary open mode parameters +UP015.py:7:1: UP015 [*] Unnecessary open mode parameters | 7 | open("foo", "r") 8 | open("foo", "rt") @@ -138,7 +138,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | 10 10 | with open("foo", "U") as f: -./resources/test/fixtures/pyupgrade/UP015.py:8:1: UP015 [*] Unnecessary open mode parameters, use ""w"" +UP015.py:8:1: UP015 [*] Unnecessary open mode parameters, use ""w"" | 8 | open("foo", "rt") 9 | open("f", "r", encoding="UTF-8") @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 10 | with open("foo", "U") as f: 11 11 | pass -./resources/test/fixtures/pyupgrade/UP015.py:10:6: UP015 [*] Unnecessary open mode parameters +UP015.py:10:6: UP015 [*] Unnecessary open mode parameters | 10 | open("f", "wt") 11 | @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | with open("foo", "Ur") as f: 13 13 | pass -./resources/test/fixtures/pyupgrade/UP015.py:12:6: UP015 [*] Unnecessary open mode parameters +UP015.py:12:6: UP015 [*] Unnecessary open mode parameters | 12 | with open("foo", "U") as f: 13 | pass @@ -201,7 +201,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | with open("foo", "Ub") as f: 15 15 | pass -./resources/test/fixtures/pyupgrade/UP015.py:14:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:14:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 14 | with open("foo", "Ur") as f: 15 | pass @@ -222,7 +222,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 16 | with open("foo", "rUb") as f: 17 17 | pass -./resources/test/fixtures/pyupgrade/UP015.py:16:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:16:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 16 | with open("foo", "Ub") as f: 17 | pass @@ -243,7 +243,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | with open("foo", "r") as f: 19 19 | pass -./resources/test/fixtures/pyupgrade/UP015.py:18:6: UP015 [*] Unnecessary open mode parameters +UP015.py:18:6: UP015 [*] Unnecessary open mode parameters | 18 | with open("foo", "rUb") as f: 19 | pass @@ -264,7 +264,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | with open("foo", "rt") as f: 21 21 | pass -./resources/test/fixtures/pyupgrade/UP015.py:20:6: UP015 [*] Unnecessary open mode parameters +UP015.py:20:6: UP015 [*] Unnecessary open mode parameters | 20 | with open("foo", "r") as f: 21 | pass @@ -285,7 +285,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 22 | with open("foo", "r", encoding="UTF-8") as f: 23 23 | pass -./resources/test/fixtures/pyupgrade/UP015.py:22:6: UP015 [*] Unnecessary open mode parameters +UP015.py:22:6: UP015 [*] Unnecessary open mode parameters | 22 | with open("foo", "rt") as f: 23 | pass @@ -306,7 +306,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 24 | with open("foo", "wt") as f: 25 25 | pass -./resources/test/fixtures/pyupgrade/UP015.py:24:6: UP015 [*] Unnecessary open mode parameters, use ""w"" +UP015.py:24:6: UP015 [*] Unnecessary open mode parameters, use ""w"" | 24 | with open("foo", "r", encoding="UTF-8") as f: 25 | pass @@ -326,7 +326,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 26 | 27 27 | open(f("a", "b", "c"), "U") -./resources/test/fixtures/pyupgrade/UP015.py:27:1: UP015 [*] Unnecessary open mode parameters +UP015.py:27:1: UP015 [*] Unnecessary open mode parameters | 27 | pass 28 | @@ -346,7 +346,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 29 29 | 30 30 | with open(f("a", "b", "c"), "U") as f: -./resources/test/fixtures/pyupgrade/UP015.py:28:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:28:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 28 | open(f("a", "b", "c"), "U") 29 | open(f("a", "b", "c"), "Ub") @@ -366,7 +366,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 30 30 | with open(f("a", "b", "c"), "U") as f: 31 31 | pass -./resources/test/fixtures/pyupgrade/UP015.py:30:6: UP015 [*] Unnecessary open mode parameters +UP015.py:30:6: UP015 [*] Unnecessary open mode parameters | 30 | open(f("a", "b", "c"), "Ub") 31 | @@ -387,7 +387,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 32 | with open(f("a", "b", "c"), "Ub") as f: 33 33 | pass -./resources/test/fixtures/pyupgrade/UP015.py:32:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:32:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 32 | with open(f("a", "b", "c"), "U") as f: 33 | pass @@ -407,7 +407,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 34 34 | 35 35 | with open("foo", "U") as fa, open("bar", "U") as fb: -./resources/test/fixtures/pyupgrade/UP015.py:35:6: UP015 [*] Unnecessary open mode parameters +UP015.py:35:6: UP015 [*] Unnecessary open mode parameters | 35 | pass 36 | @@ -428,7 +428,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 37 37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb: 38 38 | pass -./resources/test/fixtures/pyupgrade/UP015.py:35:30: UP015 [*] Unnecessary open mode parameters +UP015.py:35:30: UP015 [*] Unnecessary open mode parameters | 35 | pass 36 | @@ -449,7 +449,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 37 37 | with open("foo", "Ub") as fa, open("bar", "Ub") as fb: 38 38 | pass -./resources/test/fixtures/pyupgrade/UP015.py:37:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:37:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 37 | with open("foo", "U") as fa, open("bar", "U") as fb: 38 | pass @@ -469,7 +469,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 39 39 | 40 40 | open("foo", mode="U") -./resources/test/fixtures/pyupgrade/UP015.py:37:31: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:37:31: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 37 | with open("foo", "U") as fa, open("bar", "U") as fb: 38 | pass @@ -489,7 +489,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 39 39 | 40 40 | open("foo", mode="U") -./resources/test/fixtures/pyupgrade/UP015.py:40:1: UP015 [*] Unnecessary open mode parameters +UP015.py:40:1: UP015 [*] Unnecessary open mode parameters | 40 | pass 41 | @@ -510,7 +510,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 42 | open(mode="U", name="foo") 43 43 | -./resources/test/fixtures/pyupgrade/UP015.py:41:1: UP015 [*] Unnecessary open mode parameters +UP015.py:41:1: UP015 [*] Unnecessary open mode parameters | 41 | open("foo", mode="U") 42 | open(name="foo", mode="U") @@ -529,7 +529,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 43 43 | 44 44 | with open("foo", mode="U") as f: -./resources/test/fixtures/pyupgrade/UP015.py:42:1: UP015 [*] Unnecessary open mode parameters +UP015.py:42:1: UP015 [*] Unnecessary open mode parameters | 42 | open("foo", mode="U") 43 | open(name="foo", mode="U") @@ -550,7 +550,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 44 44 | with open("foo", mode="U") as f: 45 45 | pass -./resources/test/fixtures/pyupgrade/UP015.py:44:6: UP015 [*] Unnecessary open mode parameters +UP015.py:44:6: UP015 [*] Unnecessary open mode parameters | 44 | open(mode="U", name="foo") 45 | @@ -571,7 +571,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 46 46 | with open(name="foo", mode="U") as f: 47 47 | pass -./resources/test/fixtures/pyupgrade/UP015.py:46:6: UP015 [*] Unnecessary open mode parameters +UP015.py:46:6: UP015 [*] Unnecessary open mode parameters | 46 | with open("foo", mode="U") as f: 47 | pass @@ -592,7 +592,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 48 48 | with open(mode="U", name="foo") as f: 49 49 | pass -./resources/test/fixtures/pyupgrade/UP015.py:48:6: UP015 [*] Unnecessary open mode parameters +UP015.py:48:6: UP015 [*] Unnecessary open mode parameters | 48 | with open(name="foo", mode="U") as f: 49 | pass @@ -612,7 +612,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 50 50 | 51 51 | open("foo", mode="Ub") -./resources/test/fixtures/pyupgrade/UP015.py:51:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:51:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 51 | pass 52 | @@ -633,7 +633,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 53 53 | open(mode="Ub", name="foo") 54 54 | -./resources/test/fixtures/pyupgrade/UP015.py:52:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:52:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 52 | open("foo", mode="Ub") 53 | open(name="foo", mode="Ub") @@ -652,7 +652,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 54 54 | 55 55 | with open("foo", mode="Ub") as f: -./resources/test/fixtures/pyupgrade/UP015.py:53:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:53:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 53 | open("foo", mode="Ub") 54 | open(name="foo", mode="Ub") @@ -673,7 +673,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 55 55 | with open("foo", mode="Ub") as f: 56 56 | pass -./resources/test/fixtures/pyupgrade/UP015.py:55:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:55:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 55 | open(mode="Ub", name="foo") 56 | @@ -694,7 +694,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 57 57 | with open(name="foo", mode="Ub") as f: 58 58 | pass -./resources/test/fixtures/pyupgrade/UP015.py:57:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:57:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 57 | with open("foo", mode="Ub") as f: 58 | pass @@ -715,7 +715,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 59 59 | with open(mode="Ub", name="foo") as f: 60 60 | pass -./resources/test/fixtures/pyupgrade/UP015.py:59:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:59:6: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 59 | with open(name="foo", mode="Ub") as f: 60 | pass @@ -735,7 +735,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 61 61 | 62 62 | open(file="foo", mode='U', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) -./resources/test/fixtures/pyupgrade/UP015.py:62:1: UP015 [*] Unnecessary open mode parameters +UP015.py:62:1: UP015 [*] Unnecessary open mode parameters | 62 | pass 63 | @@ -756,7 +756,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 64 64 | open(file="foo", buffering=- 1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None) 65 65 | open(mode='U', file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) -./resources/test/fixtures/pyupgrade/UP015.py:63:1: UP015 [*] Unnecessary open mode parameters +UP015.py:63:1: UP015 [*] Unnecessary open mode parameters | 63 | open(file="foo", mode='U', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 64 | open(file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U') @@ -776,7 +776,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 65 65 | open(mode='U', file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 66 66 | -./resources/test/fixtures/pyupgrade/UP015.py:64:1: UP015 [*] Unnecessary open mode parameters +UP015.py:64:1: UP015 [*] Unnecessary open mode parameters | 64 | open(file="foo", mode='U', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 65 | open(file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U') @@ -796,7 +796,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 66 66 | 67 67 | open(file="foo", mode='Ub', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) -./resources/test/fixtures/pyupgrade/UP015.py:65:1: UP015 [*] Unnecessary open mode parameters +UP015.py:65:1: UP015 [*] Unnecessary open mode parameters | 65 | open(file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='U') 66 | open(file="foo", buffering=- 1, encoding=None, errors=None, mode='U', newline=None, closefd=True, opener=None) @@ -817,7 +817,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 67 67 | open(file="foo", mode='Ub', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 68 68 | open(file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub') -./resources/test/fixtures/pyupgrade/UP015.py:67:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:67:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 67 | open(mode='U', file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 68 | @@ -838,7 +838,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 69 69 | open(file="foo", buffering=- 1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None) 70 70 | open(mode='Ub', file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) -./resources/test/fixtures/pyupgrade/UP015.py:68:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:68:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 68 | open(file="foo", mode='Ub', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 69 | open(file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub') @@ -858,7 +858,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 70 70 | open(mode='Ub', file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 71 71 | -./resources/test/fixtures/pyupgrade/UP015.py:69:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:69:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 69 | open(file="foo", mode='Ub', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None) 70 | open(file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub') @@ -878,7 +878,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 71 71 | 72 72 | open = 1 -./resources/test/fixtures/pyupgrade/UP015.py:70:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" +UP015.py:70:1: UP015 [*] Unnecessary open mode parameters, use ""rb"" | 70 | open(file="foo", buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None, mode='Ub') 71 | open(file="foo", buffering=- 1, encoding=None, errors=None, mode='Ub', newline=None, closefd=True, opener=None) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap index 04a4d5ac5a..a7faa63d8a 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP018.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP018.py:20:1: UP018 [*] Unnecessary call to `str` +UP018.py:20:1: UP018 [*] Unnecessary call to `str` | 20 | # These become string or byte literals 21 | str() @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 22 | str(""" 23 23 | foo""") -./resources/test/fixtures/pyupgrade/UP018.py:21:1: UP018 [*] Unnecessary call to `str` +UP018.py:21:1: UP018 [*] Unnecessary call to `str` | 21 | # These become string or byte literals 22 | str() @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 23 23 | foo""") 24 24 | bytes() -./resources/test/fixtures/pyupgrade/UP018.py:22:1: UP018 [*] Unnecessary call to `str` +UP018.py:22:1: UP018 [*] Unnecessary call to `str` | 22 | str() 23 | str("foo") @@ -66,7 +66,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 25 25 | bytes(b"foo") 26 26 | bytes(b""" -./resources/test/fixtures/pyupgrade/UP018.py:24:1: UP018 [*] Unnecessary call to `bytes` +UP018.py:24:1: UP018 [*] Unnecessary call to `bytes` | 24 | str(""" 25 | foo""") @@ -87,7 +87,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 26 | bytes(b""" 27 27 | foo""") -./resources/test/fixtures/pyupgrade/UP018.py:25:1: UP018 [*] Unnecessary call to `bytes` +UP018.py:25:1: UP018 [*] Unnecessary call to `bytes` | 25 | foo""") 26 | bytes() @@ -107,7 +107,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 26 | bytes(b""" 27 27 | foo""") -./resources/test/fixtures/pyupgrade/UP018.py:26:1: UP018 [*] Unnecessary call to `bytes` +UP018.py:26:1: UP018 [*] Unnecessary call to `bytes` | 26 | bytes() 27 | bytes(b"foo") diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap index 502e608db4..c4697f0e39 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP019.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP019.py:7:22: UP019 [*] `typing.Text` is deprecated, use `str` +UP019.py:7:22: UP019 [*] `typing.Text` is deprecated, use `str` | 7 | def print_word(word: Text) -> None: | ^^^^ UP019 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | 10 10 | -./resources/test/fixtures/pyupgrade/UP019.py:11:29: UP019 [*] `typing.Text` is deprecated, use `str` +UP019.py:11:29: UP019 [*] `typing.Text` is deprecated, use `str` | 11 | def print_second_word(word: typing.Text) -> None: | ^^^^^^^^^^^ UP019 @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | 14 14 | -./resources/test/fixtures/pyupgrade/UP019.py:15:28: UP019 [*] `typing.Text` is deprecated, use `str` +UP019.py:15:28: UP019 [*] `typing.Text` is deprecated, use `str` | 15 | def print_third_word(word: Hello.Text) -> None: | ^^^^^^^^^^ UP019 @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 17 17 | 18 18 | -./resources/test/fixtures/pyupgrade/UP019.py:19:29: UP019 [*] `typing.Text` is deprecated, use `str` +UP019.py:19:29: UP019 [*] `typing.Text` is deprecated, use `str` | 19 | def print_fourth_word(word: Goodbye) -> None: | ^^^^^^^ UP019 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP020.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP020.py.snap index c8a156260d..b219ec28d9 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP020.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP020.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP020.py:3:6: UP020 [*] Use builtin `open` +UP020.py:3:6: UP020 [*] Use builtin `open` | 3 | import io 4 | @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 5 | 6 6 | from io import open -./resources/test/fixtures/pyupgrade/UP020.py:8:6: UP020 Use builtin `open` +UP020.py:8:6: UP020 Use builtin `open` | 8 | from io import open 9 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap index 143bbce0e6..e8faa525f8 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP021.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP021.py:6:25: UP021 [*] `universal_newlines` is deprecated, use `text` +UP021.py:6:25: UP021 [*] `universal_newlines` is deprecated, use `text` | 6 | from subprocess import run as anothername 7 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | 9 9 | run(["foo"], universal_newlines=True, check=False) -./resources/test/fixtures/pyupgrade/UP021.py:7:23: UP021 [*] `universal_newlines` is deprecated, use `text` +UP021.py:7:23: UP021 [*] `universal_newlines` is deprecated, use `text` | 7 | subprocess.run(["foo"], universal_newlines=True, check=True) 8 | somename.run(["foo"], universal_newlines=True) @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | run(["foo"], universal_newlines=True, check=False) 10 10 | anothername(["foo"], universal_newlines=True) -./resources/test/fixtures/pyupgrade/UP021.py:9:14: UP021 [*] `universal_newlines` is deprecated, use `text` +UP021.py:9:14: UP021 [*] `universal_newlines` is deprecated, use `text` | 9 | somename.run(["foo"], universal_newlines=True) 10 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 11 11 | 12 12 | subprocess.run(["foo"], check=True) -./resources/test/fixtures/pyupgrade/UP021.py:10:22: UP021 [*] `universal_newlines` is deprecated, use `text` +UP021.py:10:22: UP021 [*] `universal_newlines` is deprecated, use `text` | 10 | run(["foo"], universal_newlines=True, check=False) 11 | anothername(["foo"], universal_newlines=True) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap index 4215850790..8296ed7a33 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP022.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP022.py:4:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` +UP022.py:4:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` | 4 | import subprocess 5 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | output = subprocess.run(["foo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 7 7 | -./resources/test/fixtures/pyupgrade/UP022.py:6:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` +UP022.py:6:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` | 6 | output = run(["foo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 7 | @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | output = subprocess.run(stdout=subprocess.PIPE, args=["foo"], stderr=subprocess.PIPE) 9 9 | -./resources/test/fixtures/pyupgrade/UP022.py:8:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` +UP022.py:8:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` | 8 | output = subprocess.run(["foo"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 9 | @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 10 | output = subprocess.run( 11 11 | ["foo"], stdout=subprocess.PIPE, check=True, stderr=subprocess.PIPE -./resources/test/fixtures/pyupgrade/UP022.py:10:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` +UP022.py:10:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` | 10 | output = subprocess.run(stdout=subprocess.PIPE, args=["foo"], stderr=subprocess.PIPE) 11 | @@ -88,7 +88,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | 14 14 | output = subprocess.run( -./resources/test/fixtures/pyupgrade/UP022.py:14:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` +UP022.py:14:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` | 14 | ) 15 | @@ -112,7 +112,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 17 17 | 18 18 | output = subprocess.run( -./resources/test/fixtures/pyupgrade/UP022.py:18:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` +UP022.py:18:10: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` | 18 | ) 19 | @@ -144,7 +144,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 23 | encoding="utf-8", 25 24 | close_fds=True, -./resources/test/fixtures/pyupgrade/UP022.py:29:14: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` +UP022.py:29:14: UP022 [*] Sending stdout and stderr to pipe is deprecated, use `capture_output` | 29 | if output: 30 | output = subprocess.run( diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap index 1309656a11..69dbb3e90d 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP023.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP023.py:2:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:2:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 2 | # These two imports have something after cElementTree, so they should be fixed. 3 | from xml.etree.cElementTree import XML, Element, SubElement @@ -18,7 +18,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | 5 5 | # Weird spacing should not cause issues. -./resources/test/fixtures/pyupgrade/UP023.py:3:8: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:3:8: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 3 | # These two imports have something after cElementTree, so they should be fixed. 4 | from xml.etree.cElementTree import XML, Element, SubElement @@ -38,7 +38,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 5 | # Weird spacing should not cause issues. 6 6 | from xml.etree.cElementTree import XML -./resources/test/fixtures/pyupgrade/UP023.py:6:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:6:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 6 | # Weird spacing should not cause issues. 7 | from xml.etree.cElementTree import XML @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | 9 9 | # Multi line imports should also work fine. -./resources/test/fixtures/pyupgrade/UP023.py:7:11: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:7:11: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 7 | # Weird spacing should not cause issues. 8 | from xml.etree.cElementTree import XML @@ -78,7 +78,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | # Multi line imports should also work fine. 10 10 | from xml.etree.cElementTree import ( -./resources/test/fixtures/pyupgrade/UP023.py:10:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:10:1: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 10 | # Multi line imports should also work fine. 11 | / from xml.etree.cElementTree import ( @@ -102,7 +102,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | Element, 13 13 | SubElement, -./resources/test/fixtures/pyupgrade/UP023.py:16:12: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:16:12: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 16 | ) 17 | if True: @@ -122,7 +122,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | 19 19 | from xml.etree import cElementTree as ET -./resources/test/fixtures/pyupgrade/UP023.py:17:27: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:17:27: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 17 | if True: 18 | import xml.etree.cElementTree as ET @@ -143,7 +143,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 19 | from xml.etree import cElementTree as ET 20 20 | -./resources/test/fixtures/pyupgrade/UP023.py:19:23: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:19:23: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 19 | from xml.etree import cElementTree as CET 20 | @@ -164,7 +164,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 21 21 | import contextlib, xml.etree.cElementTree as ET 22 22 | -./resources/test/fixtures/pyupgrade/UP023.py:21:20: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:21:20: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 21 | from xml.etree import cElementTree as ET 22 | @@ -185,7 +185,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 23 23 | # This should fix the second, but not the first invocation. 24 24 | import xml.etree.cElementTree, xml.etree.cElementTree as ET -./resources/test/fixtures/pyupgrade/UP023.py:24:32: UP023 [*] `cElementTree` is deprecated, use `ElementTree` +UP023.py:24:32: UP023 [*] `cElementTree` is deprecated, use `ElementTree` | 24 | # This should fix the second, but not the first invocation. 25 | import xml.etree.cElementTree, xml.etree.cElementTree as ET diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap index cc933bb153..7fd72774f2 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP024_0.py:6:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:6:8: UP024 [*] Replace aliased errors with `OSError` | 6 | try: 7 | pass @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | 9 9 | try: -./resources/test/fixtures/pyupgrade/UP024_0.py:11:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:11:8: UP024 [*] Replace aliased errors with `OSError` | 11 | try: 12 | pass @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | 14 14 | try: -./resources/test/fixtures/pyupgrade/UP024_0.py:16:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:16:8: UP024 [*] Replace aliased errors with `OSError` | 16 | try: 17 | pass @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | 19 19 | try: -./resources/test/fixtures/pyupgrade/UP024_0.py:21:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:21:8: UP024 [*] Replace aliased errors with `OSError` | 21 | try: 22 | pass @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 23 23 | 24 24 | try: -./resources/test/fixtures/pyupgrade/UP024_0.py:26:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:26:8: UP024 [*] Replace aliased errors with `OSError` | 26 | try: 27 | pass @@ -101,7 +101,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 28 28 | 29 29 | try: -./resources/test/fixtures/pyupgrade/UP024_0.py:31:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:31:8: UP024 [*] Replace aliased errors with `OSError` | 31 | try: 32 | pass @@ -121,7 +121,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 33 33 | 34 34 | try: -./resources/test/fixtures/pyupgrade/UP024_0.py:36:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:36:8: UP024 [*] Replace aliased errors with `OSError` | 36 | try: 37 | pass @@ -141,7 +141,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 38 38 | 39 39 | # Should NOT be in parentheses when replaced -./resources/test/fixtures/pyupgrade/UP024_0.py:43:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:43:8: UP024 [*] Replace aliased errors with `OSError` | 43 | try: 44 | pass @@ -162,7 +162,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 45 45 | try: 46 46 | pass -./resources/test/fixtures/pyupgrade/UP024_0.py:47:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:47:8: UP024 [*] Replace aliased errors with `OSError` | 47 | try: 48 | pass @@ -183,7 +183,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 49 | try: 50 50 | pass -./resources/test/fixtures/pyupgrade/UP024_0.py:51:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:51:8: UP024 [*] Replace aliased errors with `OSError` | 51 | try: 52 | pass @@ -203,7 +203,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 53 53 | 54 54 | # Should be kept in parentheses (because multiple) -./resources/test/fixtures/pyupgrade/UP024_0.py:58:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:58:8: UP024 [*] Replace aliased errors with `OSError` | 58 | try: 59 | pass @@ -223,7 +223,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 60 60 | 61 61 | # First should change, second should not -./resources/test/fixtures/pyupgrade/UP024_0.py:65:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:65:8: UP024 [*] Replace aliased errors with `OSError` | 65 | try: 66 | pass @@ -244,7 +244,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 67 67 | # These should not change 68 68 | -./resources/test/fixtures/pyupgrade/UP024_0.py:87:8: UP024 [*] Replace aliased errors with `OSError` +UP024_0.py:87:8: UP024 [*] Replace aliased errors with `OSError` | 87 | try: 88 | pass diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap index c9d5907ecb..4bf5d785e1 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP024_1.py:5:8: UP024 [*] Replace aliased errors with `OSError` +UP024_1.py:5:8: UP024 [*] Replace aliased errors with `OSError` | 5 | try: 6 | pass @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 7 | except (OSError, socket.error, KeyError): 8 8 | pass -./resources/test/fixtures/pyupgrade/UP024_1.py:7:8: UP024 [*] Replace aliased errors with `OSError` +UP024_1.py:7:8: UP024 [*] Replace aliased errors with `OSError` | 7 | except (OSError, mmap.error, IOError): 8 | pass @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | 10 10 | try: -./resources/test/fixtures/pyupgrade/UP024_1.py:12:8: UP024 [*] Replace aliased errors with `OSError` +UP024_1.py:12:8: UP024 [*] Replace aliased errors with `OSError` | 12 | try: 13 | pass diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap index 04d40b2648..207be628a1 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP024_2.py:10:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:10:7: UP024 [*] Replace aliased errors with `OSError` | 10 | # Testing the modules 11 | import socket, mmap, select @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | raise select.error 13 13 | -./resources/test/fixtures/pyupgrade/UP024_2.py:11:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:11:7: UP024 [*] Replace aliased errors with `OSError` | 11 | import socket, mmap, select 12 | raise socket.error @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | 14 14 | raise socket.error() -./resources/test/fixtures/pyupgrade/UP024_2.py:12:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:12:7: UP024 [*] Replace aliased errors with `OSError` | 12 | raise socket.error 13 | raise mmap.error @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | raise socket.error() 15 15 | raise mmap.error(1) -./resources/test/fixtures/pyupgrade/UP024_2.py:14:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:14:7: UP024 [*] Replace aliased errors with `OSError` | 14 | raise select.error 15 | @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 16 | raise select.error(1, 2) 17 17 | -./resources/test/fixtures/pyupgrade/UP024_2.py:15:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:15:7: UP024 [*] Replace aliased errors with `OSError` | 15 | raise socket.error() 16 | raise mmap.error(1) @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 17 17 | 18 18 | raise socket.error( -./resources/test/fixtures/pyupgrade/UP024_2.py:16:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:16:7: UP024 [*] Replace aliased errors with `OSError` | 16 | raise socket.error() 17 | raise mmap.error(1) @@ -124,7 +124,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | raise socket.error( 19 19 | 1, -./resources/test/fixtures/pyupgrade/UP024_2.py:18:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:18:7: UP024 [*] Replace aliased errors with `OSError` | 18 | raise select.error(1, 2) 19 | @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | 2, 21 21 | 3, -./resources/test/fixtures/pyupgrade/UP024_2.py:25:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:25:7: UP024 [*] Replace aliased errors with `OSError` | 25 | from mmap import error 26 | raise error @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 27 27 | from socket import error 28 28 | raise error(1) -./resources/test/fixtures/pyupgrade/UP024_2.py:28:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:28:7: UP024 [*] Replace aliased errors with `OSError` | 28 | from socket import error 29 | raise error(1) @@ -185,7 +185,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 30 30 | from select import error 31 31 | raise error(1, 2) -./resources/test/fixtures/pyupgrade/UP024_2.py:31:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:31:7: UP024 [*] Replace aliased errors with `OSError` | 31 | from select import error 32 | raise error(1, 2) @@ -205,7 +205,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 33 33 | # Testing the names 34 34 | raise EnvironmentError -./resources/test/fixtures/pyupgrade/UP024_2.py:34:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:34:7: UP024 [*] Replace aliased errors with `OSError` | 34 | # Testing the names 35 | raise EnvironmentError @@ -225,7 +225,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 36 36 | raise WindowsError 37 37 | -./resources/test/fixtures/pyupgrade/UP024_2.py:35:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:35:7: UP024 [*] Replace aliased errors with `OSError` | 35 | # Testing the names 36 | raise EnvironmentError @@ -245,7 +245,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 37 37 | 38 38 | raise EnvironmentError() -./resources/test/fixtures/pyupgrade/UP024_2.py:36:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:36:7: UP024 [*] Replace aliased errors with `OSError` | 36 | raise EnvironmentError 37 | raise IOError @@ -266,7 +266,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 38 38 | raise EnvironmentError() 39 39 | raise IOError(1) -./resources/test/fixtures/pyupgrade/UP024_2.py:38:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:38:7: UP024 [*] Replace aliased errors with `OSError` | 38 | raise WindowsError 39 | @@ -287,7 +287,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 40 40 | raise WindowsError(1, 2) 41 41 | -./resources/test/fixtures/pyupgrade/UP024_2.py:39:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:39:7: UP024 [*] Replace aliased errors with `OSError` | 39 | raise EnvironmentError() 40 | raise IOError(1) @@ -306,7 +306,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 41 41 | 42 42 | raise EnvironmentError( -./resources/test/fixtures/pyupgrade/UP024_2.py:40:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:40:7: UP024 [*] Replace aliased errors with `OSError` | 40 | raise EnvironmentError() 41 | raise IOError(1) @@ -327,7 +327,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 42 | raise EnvironmentError( 43 43 | 1, -./resources/test/fixtures/pyupgrade/UP024_2.py:42:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:42:7: UP024 [*] Replace aliased errors with `OSError` | 42 | raise WindowsError(1, 2) 43 | @@ -348,7 +348,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 44 44 | 2, 45 45 | 3, -./resources/test/fixtures/pyupgrade/UP024_2.py:48:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:48:7: UP024 [*] Replace aliased errors with `OSError` | 48 | ) 49 | @@ -368,7 +368,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 49 | raise EnvironmentError(1) 50 50 | raise IOError(1, 2) -./resources/test/fixtures/pyupgrade/UP024_2.py:49:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:49:7: UP024 [*] Replace aliased errors with `OSError` | 49 | raise WindowsError 50 | raise EnvironmentError(1) @@ -385,7 +385,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 |+raise OSError(1) 50 50 | raise IOError(1, 2) -./resources/test/fixtures/pyupgrade/UP024_2.py:50:7: UP024 [*] Replace aliased errors with `OSError` +UP024_2.py:50:7: UP024 [*] Replace aliased errors with `OSError` | 50 | raise WindowsError 51 | raise EnvironmentError(1) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap index ae3990ef9b..63ac886d8b 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP024_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP024_4.py:9:8: UP024 [*] Replace aliased errors with `OSError` +UP024_4.py:9:8: UP024 [*] Replace aliased errors with `OSError` | 9 | conn.ensure_connection(max_retries=2) 10 | conn._close() diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap index ea5bb0bb0d..8184432480 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP025.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP025.py:2:5: UP025 [*] Remove unicode literals from strings +UP025.py:2:5: UP025 [*] Remove unicode literals from strings | 2 | # These should change 3 | x = u"Hello" @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | u'world' 5 5 | -./resources/test/fixtures/pyupgrade/UP025.py:4:1: UP025 [*] Remove unicode literals from strings +UP025.py:4:1: UP025 [*] Remove unicode literals from strings | 4 | x = u"Hello" 5 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | print(u"Hello") 7 7 | -./resources/test/fixtures/pyupgrade/UP025.py:6:7: UP025 [*] Remove unicode literals from strings +UP025.py:6:7: UP025 [*] Remove unicode literals from strings | 6 | u'world' 7 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | print(u'world') 9 9 | -./resources/test/fixtures/pyupgrade/UP025.py:8:7: UP025 [*] Remove unicode literals from strings +UP025.py:8:7: UP025 [*] Remove unicode literals from strings | 8 | print(u"Hello") 9 | @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 10 | import foo 11 11 | -./resources/test/fixtures/pyupgrade/UP025.py:12:5: UP025 [*] Remove unicode literals from strings +UP025.py:12:5: UP025 [*] Remove unicode literals from strings | 12 | import foo 13 | @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | # These should stay quoted they way they are 15 15 | -./resources/test/fixtures/pyupgrade/UP025.py:12:15: UP025 [*] Remove unicode literals from strings +UP025.py:12:15: UP025 [*] Remove unicode literals from strings | 12 | import foo 13 | @@ -124,7 +124,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | # These should stay quoted they way they are 15 15 | -./resources/test/fixtures/pyupgrade/UP025.py:12:27: UP025 [*] Remove unicode literals from strings +UP025.py:12:27: UP025 [*] Remove unicode literals from strings | 12 | import foo 13 | @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | # These should stay quoted they way they are 15 15 | -./resources/test/fixtures/pyupgrade/UP025.py:12:39: UP025 [*] Remove unicode literals from strings +UP025.py:12:39: UP025 [*] Remove unicode literals from strings | 12 | import foo 13 | @@ -166,7 +166,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | # These should stay quoted they way they are 15 15 | -./resources/test/fixtures/pyupgrade/UP025.py:16:5: UP025 [*] Remove unicode literals from strings +UP025.py:16:5: UP025 [*] Remove unicode literals from strings | 16 | # These should stay quoted they way they are 17 | @@ -187,7 +187,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | x = u'''hello''' 19 19 | x = u'Hello "World"' -./resources/test/fixtures/pyupgrade/UP025.py:17:5: UP025 [*] Remove unicode literals from strings +UP025.py:17:5: UP025 [*] Remove unicode literals from strings | 17 | x = u'hello' 18 | x = u"""hello""" @@ -207,7 +207,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 19 | x = u'Hello "World"' 20 20 | -./resources/test/fixtures/pyupgrade/UP025.py:18:5: UP025 [*] Remove unicode literals from strings +UP025.py:18:5: UP025 [*] Remove unicode literals from strings | 18 | x = u'hello' 19 | x = u"""hello""" @@ -227,7 +227,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | 21 21 | # These should not change -./resources/test/fixtures/pyupgrade/UP025.py:19:5: UP025 [*] Remove unicode literals from strings +UP025.py:19:5: UP025 [*] Remove unicode literals from strings | 19 | x = u"""hello""" 20 | x = u'''hello''' diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap index c0eeed435d..e4a375d50c 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP026.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP026.py:3:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:3:12: UP026 [*] `mock` is deprecated, use `unittest.mock` | 3 | # Error (`from unittest import mock`) 4 | if True: @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 5 | # Error (`from unittest import mock`) 6 6 | if True: -./resources/test/fixtures/pyupgrade/UP026.py:7:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:7:12: UP026 [*] `mock` is deprecated, use `unittest.mock` | 7 | # Error (`from unittest import mock`) 8 | if True: @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 10 | # Error (`from unittest.mock import *`) 10 11 | if True: -./resources/test/fixtures/pyupgrade/UP026.py:11:5: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:11:5: UP026 [*] `mock` is deprecated, use `unittest.mock` | 11 | # Error (`from unittest.mock import *`) 12 | if True: @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | # Error (`from unittest import mock`) 14 14 | import mock.mock -./resources/test/fixtures/pyupgrade/UP026.py:14:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:14:8: UP026 [*] `mock` is deprecated, use `unittest.mock` | 14 | # Error (`from unittest import mock`) 15 | import mock.mock @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 16 | # Error (`from unittest import mock`) 17 17 | import contextlib, mock, sys -./resources/test/fixtures/pyupgrade/UP026.py:17:20: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:17:20: UP026 [*] `mock` is deprecated, use `unittest.mock` | 17 | # Error (`from unittest import mock`) 18 | import contextlib, mock, sys @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 20 | # Error (`from unittest import mock`) 20 21 | import mock, sys -./resources/test/fixtures/pyupgrade/UP026.py:20:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:20:8: UP026 [*] `mock` is deprecated, use `unittest.mock` | 20 | # Error (`from unittest import mock`) 21 | import mock, sys @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 23 | 23 24 | # Error (`from unittest import mock`) -./resources/test/fixtures/pyupgrade/UP026.py:24:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:24:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 24 | # Error (`from unittest import mock`) 25 | from mock import mock @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 26 | # Error (keep trailing comma) 27 27 | from mock import ( -./resources/test/fixtures/pyupgrade/UP026.py:27:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:27:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 27 | # Error (keep trailing comma) 28 | / from mock import ( @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 34 34 | a, 35 35 | b, -./resources/test/fixtures/pyupgrade/UP026.py:33:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:33:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 33 | c, 34 | ) @@ -208,7 +208,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 40 40 | # Error (avoid trailing comma) 41 41 | from mock import ( -./resources/test/fixtures/pyupgrade/UP026.py:41:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:41:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 41 | # Error (avoid trailing comma) 42 | / from mock import ( @@ -239,7 +239,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 48 48 | a, 49 49 | b, -./resources/test/fixtures/pyupgrade/UP026.py:47:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:47:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 47 | c 48 | ) @@ -272,7 +272,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 54 54 | from mock import a, b, c, mock 55 55 | -./resources/test/fixtures/pyupgrade/UP026.py:53:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:53:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 53 | mock 54 | ) @@ -293,7 +293,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 55 56 | 56 57 | if True: -./resources/test/fixtures/pyupgrade/UP026.py:54:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:54:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 54 | ) 55 | from mock import mock, a, b, c @@ -315,7 +315,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 56 57 | if True: 57 58 | if False: -./resources/test/fixtures/pyupgrade/UP026.py:58:9: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:58:9: UP026 [*] `mock` is deprecated, use `unittest.mock` | 58 | if True: 59 | if False: @@ -348,7 +348,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 65 65 | # OK 66 66 | import os, io -./resources/test/fixtures/pyupgrade/UP026.py:69:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:69:8: UP026 [*] `mock` is deprecated, use `unittest.mock` | 69 | # Error (`from unittest import mock`) 70 | import mock, mock @@ -369,7 +369,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 71 72 | # Error (`from unittest import mock as foo`) 72 73 | import mock as foo -./resources/test/fixtures/pyupgrade/UP026.py:69:14: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:69:14: UP026 [*] `mock` is deprecated, use `unittest.mock` | 69 | # Error (`from unittest import mock`) 70 | import mock, mock @@ -390,7 +390,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 71 72 | # Error (`from unittest import mock as foo`) 72 73 | import mock as foo -./resources/test/fixtures/pyupgrade/UP026.py:72:8: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:72:8: UP026 [*] `mock` is deprecated, use `unittest.mock` | 72 | # Error (`from unittest import mock as foo`) 73 | import mock as foo @@ -410,7 +410,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 74 74 | # Error (`from unittest import mock as foo`) 75 75 | from mock import mock as foo -./resources/test/fixtures/pyupgrade/UP026.py:75:1: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:75:1: UP026 [*] `mock` is deprecated, use `unittest.mock` | 75 | # Error (`from unittest import mock as foo`) 76 | from mock import mock as foo @@ -430,7 +430,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 77 77 | if True: 78 78 | # This should yield multiple, aliased imports. -./resources/test/fixtures/pyupgrade/UP026.py:79:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:79:12: UP026 [*] `mock` is deprecated, use `unittest.mock` | 79 | if True: 80 | # This should yield multiple, aliased imports. @@ -453,7 +453,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 81 83 | # This should yield multiple, aliased imports, and preserve `os`. 82 84 | import mock as foo, mock as bar, mock, os -./resources/test/fixtures/pyupgrade/UP026.py:79:25: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:79:25: UP026 [*] `mock` is deprecated, use `unittest.mock` | 79 | if True: 80 | # This should yield multiple, aliased imports. @@ -476,7 +476,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 81 83 | # This should yield multiple, aliased imports, and preserve `os`. 82 84 | import mock as foo, mock as bar, mock, os -./resources/test/fixtures/pyupgrade/UP026.py:79:38: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:79:38: UP026 [*] `mock` is deprecated, use `unittest.mock` | 79 | if True: 80 | # This should yield multiple, aliased imports. @@ -499,7 +499,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 81 83 | # This should yield multiple, aliased imports, and preserve `os`. 82 84 | import mock as foo, mock as bar, mock, os -./resources/test/fixtures/pyupgrade/UP026.py:82:12: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:82:12: UP026 [*] `mock` is deprecated, use `unittest.mock` | 82 | # This should yield multiple, aliased imports, and preserve `os`. 83 | import mock as foo, mock as bar, mock, os @@ -522,7 +522,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 84 87 | if True: 85 88 | # This should yield multiple, aliased imports. -./resources/test/fixtures/pyupgrade/UP026.py:82:25: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:82:25: UP026 [*] `mock` is deprecated, use `unittest.mock` | 82 | # This should yield multiple, aliased imports, and preserve `os`. 83 | import mock as foo, mock as bar, mock, os @@ -545,7 +545,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 84 87 | if True: 85 88 | # This should yield multiple, aliased imports. -./resources/test/fixtures/pyupgrade/UP026.py:82:38: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:82:38: UP026 [*] `mock` is deprecated, use `unittest.mock` | 82 | # This should yield multiple, aliased imports, and preserve `os`. 83 | import mock as foo, mock as bar, mock, os @@ -568,7 +568,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 84 87 | if True: 85 88 | # This should yield multiple, aliased imports. -./resources/test/fixtures/pyupgrade/UP026.py:86:5: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:86:5: UP026 [*] `mock` is deprecated, use `unittest.mock` | 86 | if True: 87 | # This should yield multiple, aliased imports. @@ -589,7 +589,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 88 90 | 89 91 | # OK. -./resources/test/fixtures/pyupgrade/UP026.py:93:5: UP026 [*] `mock` is deprecated, use `unittest.mock` +UP026.py:93:5: UP026 [*] `mock` is deprecated, use `unittest.mock` | 93 | # Error (`mock.Mock()`). 94 | x = mock.mock.Mock() diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap index 2f8477b79d..bfc5f21a52 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP027.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP027.py:2:17: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:2:17: UP027 [*] Replace unpacked list comprehension with a generator expression | 2 | # Should change 3 | foo, bar, baz = [fn(x) for x in items] @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | foo, bar, baz =[fn(x) for x in items] 5 5 | -./resources/test/fixtures/pyupgrade/UP027.py:4:16: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:4:16: UP027 [*] Replace unpacked list comprehension with a generator expression | 4 | foo, bar, baz = [fn(x) for x in items] 5 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | foo, bar, baz = [fn(x) for x in items] 7 7 | -./resources/test/fixtures/pyupgrade/UP027.py:6:26: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:6:26: UP027 [*] Replace unpacked list comprehension with a generator expression | 6 | foo, bar, baz =[fn(x) for x in items] 7 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | foo, bar, baz = [[i for i in fn(x)] for x in items] 9 9 | -./resources/test/fixtures/pyupgrade/UP027.py:8:17: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:8:17: UP027 [*] Replace unpacked list comprehension with a generator expression | 8 | foo, bar, baz = [fn(x) for x in items] 9 | @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 10 | foo, bar, baz = [ 11 11 | fn(x) -./resources/test/fixtures/pyupgrade/UP027.py:10:17: UP027 [*] Replace unpacked list comprehension with a generator expression +UP027.py:10:17: UP027 [*] Replace unpacked list comprehension with a generator expression | 10 | foo, bar, baz = [[i for i in fn(x)] for x in items] 11 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap index 3478b4789f..fedc753496 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP028_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP028_0.py:2:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:2:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 2 | def f(): 3 | for x in y: @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 4 | 6 5 | def g(): -./resources/test/fixtures/pyupgrade/UP028_0.py:7:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:7:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 7 | def g(): 8 | for x, y in z: @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 9 | 11 10 | def h(): -./resources/test/fixtures/pyupgrade/UP028_0.py:12:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:12:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 12 | def h(): 13 | for x in [1, 2, 3]: @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 15 14 | 16 15 | def i(): -./resources/test/fixtures/pyupgrade/UP028_0.py:17:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:17:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 17 | def i(): 18 | for x in {x for x in y}: @@ -83,7 +83,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 19 | 21 20 | def j(): -./resources/test/fixtures/pyupgrade/UP028_0.py:22:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:22:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 22 | def j(): 23 | for x in (1, 2, 3): @@ -104,7 +104,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 25 24 | 26 25 | def k(): -./resources/test/fixtures/pyupgrade/UP028_0.py:27:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:27:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 27 | def k(): 28 | for x, y in {3: "x", 6: "y"}: @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 30 29 | 31 30 | def f(): # Comment one\n' -./resources/test/fixtures/pyupgrade/UP028_0.py:33:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:33:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 33 | def f(): # Comment one\n' 34 | # Comment two\n' @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 41 39 | 42 40 | -./resources/test/fixtures/pyupgrade/UP028_0.py:44:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:44:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 44 | def f(): 45 | for x, y in [{3: (3, [44, "long ss"]), 6: "y"}]: @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 47 46 | 48 47 | def f(): -./resources/test/fixtures/pyupgrade/UP028_0.py:49:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:49:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 49 | def f(): 50 | for x, y in z(): @@ -203,7 +203,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 52 51 | def f(): 53 52 | def func(): -./resources/test/fixtures/pyupgrade/UP028_0.py:55:9: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:55:9: UP028 [*] Replace `yield` over `for` loop with `yield from` | 55 | def func(): 56 | # This comment is preserved\n' @@ -229,7 +229,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 59 57 | # Comment\n' 60 58 | def g(): -./resources/test/fixtures/pyupgrade/UP028_0.py:67:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:67:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 67 | for x in y: 68 | yield x @@ -251,7 +251,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 70 69 | 71 70 | def f(): -./resources/test/fixtures/pyupgrade/UP028_0.py:72:5: UP028 [*] Replace `yield` over `for` loop with `yield from` +UP028_0.py:72:5: UP028 [*] Replace `yield` over `for` loop with `yield from` | 72 | def f(): 73 | for x, y in z(): diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap index 089084ad70..b7cb508b99 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP029.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP029.py:1:1: UP029 [*] Unnecessary builtin import: `*` +UP029.py:1:1: UP029 [*] Unnecessary builtin import: `*` | 1 | from builtins import * | ^^^^^^^^^^^^^^^^^^^^^^ UP029 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 3 2 | from builtins import str as _str 4 3 | from six.moves import filter, zip, zip_longest -./resources/test/fixtures/pyupgrade/UP029.py:2:1: UP029 [*] Unnecessary builtin imports: `ascii`, `bytes` +UP029.py:2:1: UP029 [*] Unnecessary builtin imports: `ascii`, `bytes` | 2 | from builtins import * 3 | from builtins import ascii, bytes, compile @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | from six.moves import filter, zip, zip_longest 5 5 | from io import open -./resources/test/fixtures/pyupgrade/UP029.py:4:1: UP029 [*] Unnecessary builtin imports: `filter`, `zip` +UP029.py:4:1: UP029 [*] Unnecessary builtin imports: `filter`, `zip` | 4 | from builtins import ascii, bytes, compile 5 | from builtins import str as _str @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | import io 7 7 | import six -./resources/test/fixtures/pyupgrade/UP029.py:5:1: UP029 [*] Unnecessary builtin import: `open` +UP029.py:5:1: UP029 [*] Unnecessary builtin import: `open` | 5 | from builtins import str as _str 6 | from six.moves import filter, zip, zip_longest diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap index b3ef05863e..986ccd2c0a 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP030_0.py:3:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:3:1: UP030 [*] Use implicit references for positional format fields | 3 | # Invalid calls; errors expected. 4 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 5 5 | "a {3} complicated {1} string with {0} {2}".format( 6 6 | "first", "second", "third", "fourth" -./resources/test/fixtures/pyupgrade/UP030_0.py:5:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:5:1: UP030 [*] Use implicit references for positional format fields | 5 | "{0}" "{1}" "{2}".format(1, 2, 3) 6 | @@ -46,7 +46,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | 9 9 | '{0}'.format(1) -./resources/test/fixtures/pyupgrade/UP030_0.py:9:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:9:1: UP030 [*] Use implicit references for positional format fields | 9 | ) 10 | @@ -67,7 +67,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 11 11 | '{0:x}'.format(30) 12 12 | -./resources/test/fixtures/pyupgrade/UP030_0.py:11:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:11:1: UP030 [*] Use implicit references for positional format fields | 11 | '{0}'.format(1) 12 | @@ -88,7 +88,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | x = '{0}'.format(1) 14 14 | -./resources/test/fixtures/pyupgrade/UP030_0.py:13:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:13:5: UP030 [*] Use implicit references for positional format fields | 13 | '{0:x}'.format(30) 14 | @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 15 15 | '''{0}\n{1}\n'''.format(1, 2) 16 16 | -./resources/test/fixtures/pyupgrade/UP030_0.py:15:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:15:1: UP030 [*] Use implicit references for positional format fields | 15 | x = '{0}'.format(1) 16 | @@ -130,7 +130,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 17 17 | x = "foo {0}" \ 18 18 | "bar {1}".format(1, 2) -./resources/test/fixtures/pyupgrade/UP030_0.py:17:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:17:5: UP030 [*] Use implicit references for positional format fields | 17 | '''{0}\n{1}\n'''.format(1, 2) 18 | @@ -155,7 +155,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | ("{0}").format(1) 21 21 | -./resources/test/fixtures/pyupgrade/UP030_0.py:20:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:20:1: UP030 [*] Use implicit references for positional format fields | 20 | "bar {1}".format(1, 2) 21 | @@ -176,7 +176,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 22 | "\N{snowman} {0}".format(1) 23 23 | -./resources/test/fixtures/pyupgrade/UP030_0.py:22:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:22:1: UP030 [*] Use implicit references for positional format fields | 22 | ("{0}").format(1) 23 | @@ -197,7 +197,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 24 | '{' '0}'.format(1) 25 25 | -./resources/test/fixtures/pyupgrade/UP030_0.py:24:1: UP030 [*] Use implicit references for positional format fields +UP030_0.py:24:1: UP030 [*] Use implicit references for positional format fields | 24 | "\N{snowman} {0}".format(1) 25 | @@ -208,7 +208,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs | = help: Remove explicit positional indices -./resources/test/fixtures/pyupgrade/UP030_0.py:29:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:29:5: UP030 [*] Use implicit references for positional format fields | 29 | # https://github.com/Instagram/LibCST/issues/846 30 | print( @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs | = help: Remove explicit positional indices -./resources/test/fixtures/pyupgrade/UP030_0.py:34:5: UP030 [*] Use implicit references for positional format fields +UP030_0.py:34:5: UP030 [*] Use implicit references for positional format fields | 34 | print( 35 | 'foo{0}' # ohai\n" diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap index 31281fc48b..0838b6cb70 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP030_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP030_2.py:6:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:6:1: UP030 [*] Use implicit references for positional format fields | 6 | kwargs = {x: x for x in range(10)} 7 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | "{0}".format(**kwargs) 9 9 | -./resources/test/fixtures/pyupgrade/UP030_2.py:8:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:8:1: UP030 [*] Use implicit references for positional format fields | 8 | "{0}".format(*args) 9 | @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 10 | "{0}_{1}".format(*args) 11 11 | -./resources/test/fixtures/pyupgrade/UP030_2.py:10:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:10:1: UP030 [*] Use implicit references for positional format fields | 10 | "{0}".format(**kwargs) 11 | @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | "{0}_{1}".format(1, *args) 13 13 | -./resources/test/fixtures/pyupgrade/UP030_2.py:12:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:12:1: UP030 [*] Use implicit references for positional format fields | 12 | "{0}_{1}".format(*args) 13 | @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | "{1}_{0}".format(*args) 15 15 | -./resources/test/fixtures/pyupgrade/UP030_2.py:14:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:14:1: UP030 [*] Use implicit references for positional format fields | 14 | "{0}_{1}".format(1, *args) 15 | @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs | = help: Remove explicit positional indices -./resources/test/fixtures/pyupgrade/UP030_2.py:16:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:16:1: UP030 [*] Use implicit references for positional format fields | 16 | "{1}_{0}".format(*args) 17 | @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | "{0}_{1}".format(1, 2, *args) 19 19 | -./resources/test/fixtures/pyupgrade/UP030_2.py:18:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:18:1: UP030 [*] Use implicit references for positional format fields | 18 | "{1}_{0}".format(1, *args) 19 | @@ -138,7 +138,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | "{0}_{1}".format(*args, 1, 2) 21 21 | -./resources/test/fixtures/pyupgrade/UP030_2.py:20:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:20:1: UP030 [*] Use implicit references for positional format fields | 20 | "{0}_{1}".format(1, 2, *args) 21 | @@ -159,7 +159,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 22 | "{0}_{1}_{2}".format(1, **kwargs) 23 23 | -./resources/test/fixtures/pyupgrade/UP030_2.py:22:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:22:1: UP030 [*] Use implicit references for positional format fields | 22 | "{0}_{1}".format(*args, 1, 2) 23 | @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 24 | "{0}_{1}_{2}".format(1, 2, **kwargs) 25 25 | -./resources/test/fixtures/pyupgrade/UP030_2.py:24:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:24:1: UP030 [*] Use implicit references for positional format fields | 24 | "{0}_{1}_{2}".format(1, **kwargs) 25 | @@ -201,7 +201,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 26 | "{0}_{1}_{2}".format(1, 2, 3, **kwargs) 27 27 | -./resources/test/fixtures/pyupgrade/UP030_2.py:26:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:26:1: UP030 [*] Use implicit references for positional format fields | 26 | "{0}_{1}_{2}".format(1, 2, **kwargs) 27 | @@ -221,7 +221,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 27 27 | 28 28 | "{0}_{1}_{2}".format(1, 2, 3, *args, **kwargs) -./resources/test/fixtures/pyupgrade/UP030_2.py:28:1: UP030 [*] Use implicit references for positional format fields +UP030_2.py:28:1: UP030 [*] Use implicit references for positional format fields | 28 | "{0}_{1}_{2}".format(1, 2, 3, **kwargs) 29 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap index e655ed09d5..10983da761 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP031_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP031_0.py:4:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:4:7: UP031 [*] Use format specifiers instead of percent format | 4 | # UP031 5 | print('%s %s' % (a, b)) @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | print('%s%s' % (a, b)) 7 7 | -./resources/test/fixtures/pyupgrade/UP031_0.py:6:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:6:7: UP031 [*] Use format specifiers instead of percent format | 6 | print('%s %s' % (a, b)) 7 | @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | print("trivial" % ()) 9 9 | -./resources/test/fixtures/pyupgrade/UP031_0.py:8:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:8:7: UP031 [*] Use format specifiers instead of percent format | 8 | print('%s%s' % (a, b)) 9 | @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 10 | print("%s" % ("simple",)) 11 11 | -./resources/test/fixtures/pyupgrade/UP031_0.py:10:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:10:7: UP031 [*] Use format specifiers instead of percent format | 10 | print("trivial" % ()) 11 | @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | print("%s" % ("%s" % ("nested",),)) 13 13 | -./resources/test/fixtures/pyupgrade/UP031_0.py:12:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:12:7: UP031 [*] Use format specifiers instead of percent format | 12 | print("%s" % ("simple",)) 13 | @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | print("%s%% percent" % (15,)) 15 15 | -./resources/test/fixtures/pyupgrade/UP031_0.py:12:15: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:12:15: UP031 [*] Use format specifiers instead of percent format | 12 | print("%s" % ("simple",)) 13 | @@ -126,7 +126,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 14 | print("%s%% percent" % (15,)) 15 15 | -./resources/test/fixtures/pyupgrade/UP031_0.py:14:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:14:7: UP031 [*] Use format specifiers instead of percent format | 14 | print("%s" % ("%s" % ("nested",),)) 15 | @@ -147,7 +147,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 16 | print("%f" % (15,)) 17 17 | -./resources/test/fixtures/pyupgrade/UP031_0.py:16:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:16:7: UP031 [*] Use format specifiers instead of percent format | 16 | print("%s%% percent" % (15,)) 17 | @@ -168,7 +168,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | print("%.f" % (15,)) 19 19 | -./resources/test/fixtures/pyupgrade/UP031_0.py:18:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:18:7: UP031 [*] Use format specifiers instead of percent format | 18 | print("%f" % (15,)) 19 | @@ -189,7 +189,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | print("%.3f" % (15,)) 21 21 | -./resources/test/fixtures/pyupgrade/UP031_0.py:20:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:20:7: UP031 [*] Use format specifiers instead of percent format | 20 | print("%.f" % (15,)) 21 | @@ -210,7 +210,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 22 | print("%3f" % (15,)) 23 23 | -./resources/test/fixtures/pyupgrade/UP031_0.py:22:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:22:7: UP031 [*] Use format specifiers instead of percent format | 22 | print("%.3f" % (15,)) 23 | @@ -231,7 +231,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 24 | print("%-5f" % (5,)) 25 25 | -./resources/test/fixtures/pyupgrade/UP031_0.py:24:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:24:7: UP031 [*] Use format specifiers instead of percent format | 24 | print("%3f" % (15,)) 25 | @@ -252,7 +252,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 26 26 | print("%9f" % (5,)) 27 27 | -./resources/test/fixtures/pyupgrade/UP031_0.py:26:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:26:7: UP031 [*] Use format specifiers instead of percent format | 26 | print("%-5f" % (5,)) 27 | @@ -273,7 +273,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 28 28 | print("%#o" % (123,)) 29 29 | -./resources/test/fixtures/pyupgrade/UP031_0.py:28:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:28:7: UP031 [*] Use format specifiers instead of percent format | 28 | print("%9f" % (5,)) 29 | @@ -294,7 +294,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 30 30 | print("brace {} %s" % (1,)) 31 31 | -./resources/test/fixtures/pyupgrade/UP031_0.py:30:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:30:7: UP031 [*] Use format specifiers instead of percent format | 30 | print("%#o" % (123,)) 31 | @@ -315,7 +315,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 32 | print( 33 33 | "%s" % ( -./resources/test/fixtures/pyupgrade/UP031_0.py:33:3: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:33:3: UP031 [*] Use format specifiers instead of percent format | 33 | print( 34 | "%s" % ( @@ -337,7 +337,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 35 35 | ) 36 36 | ) -./resources/test/fixtures/pyupgrade/UP031_0.py:38:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:38:7: UP031 [*] Use format specifiers instead of percent format | 38 | ) 39 | @@ -358,7 +358,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 40 40 | print("%(k)s" % {"k": "v"}) 41 41 | -./resources/test/fixtures/pyupgrade/UP031_0.py:40:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:40:7: UP031 [*] Use format specifiers instead of percent format | 40 | print("foo %s " % (x,)) 41 | @@ -379,7 +379,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 42 | print("%(k)s" % { 43 43 | "k": "v", -./resources/test/fixtures/pyupgrade/UP031_0.py:42:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:42:7: UP031 [*] Use format specifiers instead of percent format | 42 | print("%(k)s" % {"k": "v"}) 43 | @@ -410,7 +410,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 47 47 | print("%(to_list)s" % {"to_list": []}) 48 48 | -./resources/test/fixtures/pyupgrade/UP031_0.py:47:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:47:7: UP031 [*] Use format specifiers instead of percent format | 47 | }) 48 | @@ -431,7 +431,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 49 | print("%(k)s" % {"k": "v", "i": 1, "j": []}) 50 50 | -./resources/test/fixtures/pyupgrade/UP031_0.py:49:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:49:7: UP031 [*] Use format specifiers instead of percent format | 49 | print("%(to_list)s" % {"to_list": []}) 50 | @@ -452,7 +452,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 51 51 | print("%(ab)s" % {"a" "b": 1}) 52 52 | -./resources/test/fixtures/pyupgrade/UP031_0.py:51:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:51:7: UP031 [*] Use format specifiers instead of percent format | 51 | print("%(k)s" % {"k": "v", "i": 1, "j": []}) 52 | @@ -473,7 +473,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 53 53 | print("%(a)s" % {"a" : 1}) 54 54 | -./resources/test/fixtures/pyupgrade/UP031_0.py:53:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:53:7: UP031 [*] Use format specifiers instead of percent format | 53 | print("%(ab)s" % {"a" "b": 1}) 54 | @@ -494,7 +494,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 55 55 | print(( 56 56 | "foo %s " -./resources/test/fixtures/pyupgrade/UP031_0.py:56:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:56:5: UP031 [*] Use format specifiers instead of percent format | 56 | print(( 57 | "foo %s " @@ -517,7 +517,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 59 59 | 60 60 | print( -./resources/test/fixtures/pyupgrade/UP031_0.py:61:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:61:5: UP031 [*] Use format specifiers instead of percent format | 61 | print( 62 | "foo %(foo)s " @@ -540,7 +540,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 64 64 | 65 65 | bar = {"bar": y} -./resources/test/fixtures/pyupgrade/UP031_0.py:67:5: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:67:5: UP031 [*] Use format specifiers instead of percent format | 67 | bar = {"bar": y} 68 | print( @@ -564,7 +564,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 70 70 | 71 71 | print("%s \N{snowman}" % (a,)) -./resources/test/fixtures/pyupgrade/UP031_0.py:71:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:71:7: UP031 [*] Use format specifiers instead of percent format | 71 | ) 72 | @@ -585,7 +585,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 73 73 | print("%(foo)s \N{snowman}" % {"foo": 1}) 74 74 | -./resources/test/fixtures/pyupgrade/UP031_0.py:73:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:73:7: UP031 [*] Use format specifiers instead of percent format | 73 | print("%s \N{snowman}" % (a,)) 74 | @@ -606,7 +606,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 75 75 | print(("foo %s " "bar %s") % (x, y)) 76 76 | -./resources/test/fixtures/pyupgrade/UP031_0.py:75:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:75:7: UP031 [*] Use format specifiers instead of percent format | 75 | print("%(foo)s \N{snowman}" % {"foo": 1}) 76 | @@ -627,7 +627,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 77 77 | # Single-value expressions 78 78 | print('Hello %s' % "World") -./resources/test/fixtures/pyupgrade/UP031_0.py:78:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:78:7: UP031 [*] Use format specifiers instead of percent format | 78 | # Single-value expressions 79 | print('Hello %s' % "World") @@ -647,7 +647,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 80 80 | print('Hello %s (%s)' % bar) 81 81 | print('Hello %s (%s)' % bar.baz) -./resources/test/fixtures/pyupgrade/UP031_0.py:79:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:79:7: UP031 [*] Use format specifiers instead of percent format | 79 | # Single-value expressions 80 | print('Hello %s' % "World") @@ -668,7 +668,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 81 81 | print('Hello %s (%s)' % bar.baz) 82 82 | print('Hello %s (%s)' % bar['bop']) -./resources/test/fixtures/pyupgrade/UP031_0.py:80:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:80:7: UP031 [*] Use format specifiers instead of percent format | 80 | print('Hello %s' % "World") 81 | print('Hello %s' % f"World") @@ -689,7 +689,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 82 82 | print('Hello %s (%s)' % bar['bop']) 83 83 | print('Hello %(arg)s' % bar) -./resources/test/fixtures/pyupgrade/UP031_0.py:81:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:81:7: UP031 [*] Use format specifiers instead of percent format | 81 | print('Hello %s' % f"World") 82 | print('Hello %s (%s)' % bar) @@ -710,7 +710,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 83 83 | print('Hello %(arg)s' % bar) 84 84 | print('Hello %(arg)s' % bar.baz) -./resources/test/fixtures/pyupgrade/UP031_0.py:82:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:82:7: UP031 [*] Use format specifiers instead of percent format | 82 | print('Hello %s (%s)' % bar) 83 | print('Hello %s (%s)' % bar.baz) @@ -731,7 +731,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 84 84 | print('Hello %(arg)s' % bar.baz) 85 85 | print('Hello %(arg)s' % bar['bop']) -./resources/test/fixtures/pyupgrade/UP031_0.py:83:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:83:7: UP031 [*] Use format specifiers instead of percent format | 83 | print('Hello %s (%s)' % bar.baz) 84 | print('Hello %s (%s)' % bar['bop']) @@ -751,7 +751,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 84 84 | print('Hello %(arg)s' % bar.baz) 85 85 | print('Hello %(arg)s' % bar['bop']) -./resources/test/fixtures/pyupgrade/UP031_0.py:84:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:84:7: UP031 [*] Use format specifiers instead of percent format | 84 | print('Hello %s (%s)' % bar['bop']) 85 | print('Hello %(arg)s' % bar) @@ -769,7 +769,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 84 |+print('Hello {arg}'.format(**bar.baz)) 85 85 | print('Hello %(arg)s' % bar['bop']) -./resources/test/fixtures/pyupgrade/UP031_0.py:85:7: UP031 [*] Use format specifiers instead of percent format +UP031_0.py:85:7: UP031 [*] Use format specifiers instead of percent format | 85 | print('Hello %(arg)s' % bar) 86 | print('Hello %(arg)s' % bar.baz) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap index f494baca3b..fca6f04d93 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP032.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP032.py:5:1: UP032 [*] Use f-string instead of `format` call +UP032.py:5:1: UP032 [*] Use f-string instead of `format` call | 5 | ### 6 | @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 7 | "{1} {0}".format(a, b) 8 8 | -./resources/test/fixtures/pyupgrade/UP032.py:7:1: UP032 [*] Use f-string instead of `format` call +UP032.py:7:1: UP032 [*] Use f-string instead of `format` call | 7 | "{} {}".format(a, b) 8 | @@ -43,7 +43,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 9 | "{x.y}".format(x=z) 10 10 | -./resources/test/fixtures/pyupgrade/UP032.py:9:1: UP032 [*] Use f-string instead of `format` call +UP032.py:9:1: UP032 [*] Use f-string instead of `format` call | 9 | "{1} {0}".format(a, b) 10 | @@ -64,7 +64,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 11 11 | "{.x} {.y}".format(a, b) 12 12 | -./resources/test/fixtures/pyupgrade/UP032.py:11:1: UP032 [*] Use f-string instead of `format` call +UP032.py:11:1: UP032 [*] Use f-string instead of `format` call | 11 | "{x.y}".format(x=z) 12 | @@ -85,7 +85,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | "{} {}".format(a.b, c.d) 14 14 | -./resources/test/fixtures/pyupgrade/UP032.py:13:1: UP032 [*] Use f-string instead of `format` call +UP032.py:13:1: UP032 [*] Use f-string instead of `format` call | 13 | "{.x} {.y}".format(a, b) 14 | @@ -106,7 +106,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 15 15 | "{}".format(a()) 16 16 | -./resources/test/fixtures/pyupgrade/UP032.py:15:1: UP032 [*] Use f-string instead of `format` call +UP032.py:15:1: UP032 [*] Use f-string instead of `format` call | 15 | "{} {}".format(a.b, c.d) 16 | @@ -127,7 +127,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 17 17 | "{}".format(a.b()) 18 18 | -./resources/test/fixtures/pyupgrade/UP032.py:17:1: UP032 [*] Use f-string instead of `format` call +UP032.py:17:1: UP032 [*] Use f-string instead of `format` call | 17 | "{}".format(a()) 18 | @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 19 | "{}".format(a.b().c()) 20 20 | -./resources/test/fixtures/pyupgrade/UP032.py:19:1: UP032 [*] Use f-string instead of `format` call +UP032.py:19:1: UP032 [*] Use f-string instead of `format` call | 19 | "{}".format(a.b()) 20 | @@ -169,7 +169,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 21 21 | "hello {}!".format(name) 22 22 | -./resources/test/fixtures/pyupgrade/UP032.py:21:1: UP032 [*] Use f-string instead of `format` call +UP032.py:21:1: UP032 [*] Use f-string instead of `format` call | 21 | "{}".format(a.b().c()) 22 | @@ -190,7 +190,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 23 23 | "{}{b}{}".format(a, c, b=b) 24 24 | -./resources/test/fixtures/pyupgrade/UP032.py:23:1: UP032 [*] Use f-string instead of `format` call +UP032.py:23:1: UP032 [*] Use f-string instead of `format` call | 23 | "hello {}!".format(name) 24 | @@ -211,7 +211,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 25 25 | "{}".format(0x0) 26 26 | -./resources/test/fixtures/pyupgrade/UP032.py:25:1: UP032 [*] Use f-string instead of `format` call +UP032.py:25:1: UP032 [*] Use f-string instead of `format` call | 25 | "{}{b}{}".format(a, c, b=b) 26 | @@ -232,7 +232,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 27 27 | "{} {}".format(a, b) 28 28 | -./resources/test/fixtures/pyupgrade/UP032.py:27:1: UP032 [*] Use f-string instead of `format` call +UP032.py:27:1: UP032 [*] Use f-string instead of `format` call | 27 | "{}".format(0x0) 28 | @@ -253,7 +253,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 29 29 | """{} {}""".format(a, b) 30 30 | -./resources/test/fixtures/pyupgrade/UP032.py:29:1: UP032 [*] Use f-string instead of `format` call +UP032.py:29:1: UP032 [*] Use f-string instead of `format` call | 29 | "{} {}".format(a, b) 30 | @@ -274,7 +274,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 31 31 | "foo{}".format(1) 32 32 | -./resources/test/fixtures/pyupgrade/UP032.py:31:1: UP032 [*] Use f-string instead of `format` call +UP032.py:31:1: UP032 [*] Use f-string instead of `format` call | 31 | """{} {}""".format(a, b) 32 | @@ -295,7 +295,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 33 33 | r"foo{}".format(1) 34 34 | -./resources/test/fixtures/pyupgrade/UP032.py:33:1: UP032 [*] Use f-string instead of `format` call +UP032.py:33:1: UP032 [*] Use f-string instead of `format` call | 33 | "foo{}".format(1) 34 | @@ -316,7 +316,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 35 35 | x = "{a}".format(a=1) 36 36 | -./resources/test/fixtures/pyupgrade/UP032.py:35:5: UP032 [*] Use f-string instead of `format` call +UP032.py:35:5: UP032 [*] Use f-string instead of `format` call | 35 | r"foo{}".format(1) 36 | @@ -337,7 +337,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 37 37 | print("foo {} ".format(x)) 38 38 | -./resources/test/fixtures/pyupgrade/UP032.py:37:7: UP032 [*] Use f-string instead of `format` call +UP032.py:37:7: UP032 [*] Use f-string instead of `format` call | 37 | x = "{a}".format(a=1) 38 | @@ -358,7 +358,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 39 39 | "{a[b]}".format(a=a) 40 40 | -./resources/test/fixtures/pyupgrade/UP032.py:39:1: UP032 [*] Use f-string instead of `format` call +UP032.py:39:1: UP032 [*] Use f-string instead of `format` call | 39 | print("foo {} ".format(x)) 40 | @@ -379,7 +379,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 41 41 | "{a.a[b]}".format(a=a) 42 42 | -./resources/test/fixtures/pyupgrade/UP032.py:41:1: UP032 [*] Use f-string instead of `format` call +UP032.py:41:1: UP032 [*] Use f-string instead of `format` call | 41 | "{a[b]}".format(a=a) 42 | @@ -400,7 +400,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 43 43 | "{}{{}}{}".format(escaped, y) 44 44 | -./resources/test/fixtures/pyupgrade/UP032.py:43:1: UP032 [*] Use f-string instead of `format` call +UP032.py:43:1: UP032 [*] Use f-string instead of `format` call | 43 | "{a.a[b]}".format(a=a) 44 | @@ -421,7 +421,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 45 45 | "{}".format(a) 46 46 | -./resources/test/fixtures/pyupgrade/UP032.py:45:1: UP032 [*] Use f-string instead of `format` call +UP032.py:45:1: UP032 [*] Use f-string instead of `format` call | 45 | "{}{{}}{}".format(escaped, y) 46 | @@ -442,7 +442,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 47 47 | '({}={{0!e}})'.format(a) 48 48 | -./resources/test/fixtures/pyupgrade/UP032.py:47:1: UP032 [*] Use f-string instead of `format` call +UP032.py:47:1: UP032 [*] Use f-string instead of `format` call | 47 | "{}".format(a) 48 | @@ -463,7 +463,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 49 | ### 50 50 | # Non-errors -./resources/test/fixtures/pyupgrade/UP032.py:92:11: UP032 [*] Use f-string instead of `format` call +UP032.py:92:11: UP032 [*] Use f-string instead of `format` call | 92 | def d(osname, version, release): 93 | return"{}-{}.{}".format(osname, version, release) @@ -481,7 +481,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 94 94 | 95 95 | def e(): -./resources/test/fixtures/pyupgrade/UP032.py:96:10: UP032 [*] Use f-string instead of `format` call +UP032.py:96:10: UP032 [*] Use f-string instead of `format` call | 96 | def e(): 97 | yield"{}".format(1) @@ -499,7 +499,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 98 98 | 99 99 | assert"{}".format(1) -./resources/test/fixtures/pyupgrade/UP032.py:99:7: UP032 [*] Use f-string instead of `format` call +UP032.py:99:7: UP032 [*] Use f-string instead of `format` call | 99 | assert"{}".format(1) | ^^^^^^^^^^^^^^ UP032 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_0.py.snap index 012eaa41cb..4d37fc3d83 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP033_0.py:4:21: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` +UP033_0.py:4:21: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` | 4 | @functools.lru_cache(maxsize=None) | ^^^^^^^^^^^^^^ UP033 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | pass 7 7 | -./resources/test/fixtures/pyupgrade/UP033_0.py:10:21: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` +UP033_0.py:10:21: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` | 10 | @other_decorator 11 | @functools.lru_cache(maxsize=None) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | pass 13 13 | -./resources/test/fixtures/pyupgrade/UP033_0.py:15:21: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` +UP033_0.py:15:21: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` | 15 | @functools.lru_cache(maxsize=None) | ^^^^^^^^^^^^^^ UP033 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_1.py.snap index 7e7270e56d..74f31c3341 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP033_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP033_1.py:4:11: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` +UP033_1.py:4:11: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` | 4 | @lru_cache(maxsize=None) | ^^^^^^^^^^^^^^ UP033 @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | pass 7 7 | -./resources/test/fixtures/pyupgrade/UP033_1.py:10:11: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` +UP033_1.py:10:11: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` | 10 | @other_decorator 11 | @lru_cache(maxsize=None) @@ -47,7 +47,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 12 | pass 13 13 | -./resources/test/fixtures/pyupgrade/UP033_1.py:15:11: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` +UP033_1.py:15:11: UP033 [*] Use `@functools.cache` instead of `@functools.lru_cache(maxsize=None)` | 15 | @lru_cache(maxsize=None) | ^^^^^^^^^^^^^^ UP033 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap index 3d50da593e..af0f8589d6 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP034.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP034.py:2:7: UP034 [*] Avoid extraneous parentheses +UP034.py:2:7: UP034 [*] Avoid extraneous parentheses | 2 | # UP034 3 | print(("foo")) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | # UP034 5 5 | print(("hell((goodybe))o")) -./resources/test/fixtures/pyupgrade/UP034.py:5:7: UP034 [*] Avoid extraneous parentheses +UP034.py:5:7: UP034 [*] Avoid extraneous parentheses | 5 | # UP034 6 | print(("hell((goodybe))o")) @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 7 | # UP034 8 8 | print((("foo"))) -./resources/test/fixtures/pyupgrade/UP034.py:8:7: UP034 [*] Avoid extraneous parentheses +UP034.py:8:7: UP034 [*] Avoid extraneous parentheses | 8 | # UP034 9 | print((("foo"))) @@ -59,7 +59,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 10 | # UP034 11 11 | print((((1)))) -./resources/test/fixtures/pyupgrade/UP034.py:11:7: UP034 [*] Avoid extraneous parentheses +UP034.py:11:7: UP034 [*] Avoid extraneous parentheses | 11 | # UP034 12 | print((((1)))) @@ -79,7 +79,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 13 | # UP034 14 14 | print(("foo{}".format(1))) -./resources/test/fixtures/pyupgrade/UP034.py:14:7: UP034 [*] Avoid extraneous parentheses +UP034.py:14:7: UP034 [*] Avoid extraneous parentheses | 14 | # UP034 15 | print(("foo{}".format(1))) @@ -99,7 +99,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 16 | # UP034 17 17 | print( -./resources/test/fixtures/pyupgrade/UP034.py:18:5: UP034 [*] Avoid extraneous parentheses +UP034.py:18:5: UP034 [*] Avoid extraneous parentheses | 18 | # UP034 19 | print( @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | 21 21 | # UP034 -./resources/test/fixtures/pyupgrade/UP034.py:23:5: UP034 [*] Avoid extraneous parentheses +UP034.py:23:5: UP034 [*] Avoid extraneous parentheses | 23 | # UP034 24 | print( @@ -145,7 +145,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 27 27 | 28 28 | # UP034 -./resources/test/fixtures/pyupgrade/UP034.py:30:13: UP034 [*] Avoid extraneous parentheses +UP034.py:30:13: UP034 [*] Avoid extraneous parentheses | 30 | # UP034 31 | def f(): @@ -166,7 +166,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 32 | # UP034 33 33 | if True: -./resources/test/fixtures/pyupgrade/UP034.py:35:9: UP034 [*] Avoid extraneous parentheses +UP034.py:35:9: UP034 [*] Avoid extraneous parentheses | 35 | if True: 36 | print( @@ -186,7 +186,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 37 37 | 38 38 | # UP034 -./resources/test/fixtures/pyupgrade/UP034.py:39:7: UP034 [*] Avoid extraneous parentheses +UP034.py:39:7: UP034 [*] Avoid extraneous parentheses | 39 | # UP034 40 | print((x for x in range(3))) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap index 82ed6946f4..c57bb255da 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP035.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP035.py:2:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:2:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 2 | # UP035 3 | from collections import Mapping @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 4 4 | from collections import Mapping as MAP 5 5 | -./resources/test/fixtures/pyupgrade/UP035.py:4:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:4:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 4 | from collections import Mapping 5 | @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 6 6 | from collections import Mapping, Sequence 7 7 | -./resources/test/fixtures/pyupgrade/UP035.py:6:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence` +UP035.py:6:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence` | 6 | from collections import Mapping as MAP 7 | @@ -61,7 +61,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 8 | from collections import Counter, Mapping 9 9 | -./resources/test/fixtures/pyupgrade/UP035.py:8:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:8:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 8 | from collections import Mapping, Sequence 9 | @@ -83,7 +83,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 11 | from collections import (Counter, Mapping) 11 12 | -./resources/test/fixtures/pyupgrade/UP035.py:10:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:10:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 10 | from collections import Counter, Mapping 11 | @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 13 | from collections import (Counter, 13 14 | Mapping) -./resources/test/fixtures/pyupgrade/UP035.py:12:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:12:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 12 | from collections import (Counter, Mapping) 13 | @@ -129,7 +129,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 15 15 | from collections import Counter, \ 16 16 | Mapping -./resources/test/fixtures/pyupgrade/UP035.py:15:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:15:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 15 | Mapping) 16 | @@ -153,7 +153,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 18 | from collections import Counter, Mapping, Sequence 19 19 | -./resources/test/fixtures/pyupgrade/UP035.py:18:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence` +UP035.py:18:1: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Sequence` | 18 | Mapping 19 | @@ -175,7 +175,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 21 | from collections import Mapping as mapping, Counter 21 22 | -./resources/test/fixtures/pyupgrade/UP035.py:20:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:20:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 20 | from collections import Counter, Mapping, Sequence 21 | @@ -197,7 +197,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 23 | if True: 23 24 | from collections import Mapping, Counter -./resources/test/fixtures/pyupgrade/UP035.py:23:5: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:23:5: UP035 [*] Import from `collections.abc` instead: `Mapping` | 23 | if True: 24 | from collections import Mapping, Counter @@ -218,7 +218,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 25 26 | if True: 26 27 | if True: -./resources/test/fixtures/pyupgrade/UP035.py:28:5: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:28:5: UP035 [*] Import from `collections.abc` instead: `Mapping` | 28 | if True: 29 | pass @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 30 31 | if True: from collections import Mapping 31 32 | -./resources/test/fixtures/pyupgrade/UP035.py:30:10: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:30:10: UP035 [*] Import from `collections.abc` instead: `Mapping` | 30 | from collections import Mapping, Counter 31 | @@ -261,7 +261,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 32 | import os 33 33 | from collections import Counter, Mapping -./resources/test/fixtures/pyupgrade/UP035.py:33:1: UP035 [*] Import from `collections.abc` instead: `Mapping` +UP035.py:33:1: UP035 [*] Import from `collections.abc` instead: `Mapping` | 33 | import os 34 | from collections import Counter, Mapping @@ -281,7 +281,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 35 36 | 36 37 | if True: -./resources/test/fixtures/pyupgrade/UP035.py:37:5: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Callable` +UP035.py:37:5: UP035 [*] Import from `collections.abc` instead: `Mapping`, `Callable` | 37 | if True: 38 | from collections import ( @@ -311,7 +311,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 44 43 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager 45 44 | -./resources/test/fixtures/pyupgrade/UP035.py:44:1: UP035 [*] Import from `collections.abc` instead: `Callable` +UP035.py:44:1: UP035 [*] Import from `collections.abc` instead: `Callable` | 44 | ) 45 | @@ -333,7 +333,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 46 47 | if True: from collections import ( 47 48 | Mapping, Counter) -./resources/test/fixtures/pyupgrade/UP035.py:44:1: UP035 [*] Import from `collections` instead: `OrderedDict` +UP035.py:44:1: UP035 [*] Import from `collections` instead: `OrderedDict` | 44 | ) 45 | @@ -355,7 +355,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 46 47 | if True: from collections import ( 47 48 | Mapping, Counter) -./resources/test/fixtures/pyupgrade/UP035.py:44:1: UP035 [*] Import from `re` instead: `Match`, `Pattern` +UP035.py:44:1: UP035 [*] Import from `re` instead: `Match`, `Pattern` | 44 | ) 45 | @@ -377,7 +377,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 46 47 | if True: from collections import ( 47 48 | Mapping, Counter) -./resources/test/fixtures/pyupgrade/UP035.py:44:1: UP035 `typing.List` is deprecated, use `list` instead +UP035.py:44:1: UP035 `typing.List` is deprecated, use `list` instead | 44 | ) 45 | @@ -387,7 +387,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 48 | if True: from collections import ( | -./resources/test/fixtures/pyupgrade/UP035.py:44:1: UP035 `typing.AbstractSet` is deprecated, use `collections.abc.Set` instead +UP035.py:44:1: UP035 `typing.AbstractSet` is deprecated, use `collections.abc.Set` instead | 44 | ) 45 | @@ -397,7 +397,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 48 | if True: from collections import ( | -./resources/test/fixtures/pyupgrade/UP035.py:44:1: UP035 `typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead +UP035.py:44:1: UP035 `typing.ContextManager` is deprecated, use `contextlib.AbstractContextManager` instead | 44 | ) 45 | @@ -407,7 +407,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 48 | if True: from collections import ( | -./resources/test/fixtures/pyupgrade/UP035.py:46:10: UP035 Import from `collections.abc` instead: `Mapping` +UP035.py:46:10: UP035 Import from `collections.abc` instead: `Mapping` | 46 | from typing import Callable, Match, Pattern, List, OrderedDict, AbstractSet, ContextManager 47 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap index 9381fd51a0..acc5d5b5e1 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_0.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP036_0.py:3:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:3:1: UP036 [*] Version block is outdated for minimum Python version | 3 | import sys 4 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 5 | if sys.version_info < (3,0): 9 6 | if True: -./resources/test/fixtures/pyupgrade/UP036_0.py:8:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:8:1: UP036 [*] Version block is outdated for minimum Python version | 8 | print("py3") 9 | @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 16 10 | if sys.version_info < (3,0): print("PY2!") 17 11 | else: print("PY3!") -./resources/test/fixtures/pyupgrade/UP036_0.py:16:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:16:1: UP036 [*] Version block is outdated for minimum Python version | 16 | print("py3") 17 | @@ -83,7 +83,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 18 | if True: 20 19 | if sys.version_info < (3,0): -./resources/test/fixtures/pyupgrade/UP036_0.py:20:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:20:5: UP036 [*] Version block is outdated for minimum Python version | 20 | if True: 21 | if sys.version_info < (3,0): @@ -110,7 +110,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 25 22 | if sys.version_info < (3,0): print(1 if True else 3) 26 23 | else: -./resources/test/fixtures/pyupgrade/UP036_0.py:25:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:25:1: UP036 [*] Version block is outdated for minimum Python version | 25 | print("PY3") 26 | @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 29 27 | if sys.version_info < (3,0): 30 28 | def f(): -./resources/test/fixtures/pyupgrade/UP036_0.py:29:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:29:1: UP036 [*] Version block is outdated for minimum Python version | 29 | print("py3") 30 | @@ -170,7 +170,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 37 33 | if sys.version_info > (3,0): 38 34 | print("py3") -./resources/test/fixtures/pyupgrade/UP036_0.py:37:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:37:1: UP036 [*] Version block is outdated for minimum Python version | 37 | print("This the next") 38 | @@ -195,7 +195,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 39 | 43 40 | x = 1 -./resources/test/fixtures/pyupgrade/UP036_0.py:45:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:45:1: UP036 [*] Version block is outdated for minimum Python version | 45 | x = 1 46 | @@ -221,7 +221,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 50 47 | 51 48 | x = 1 -./resources/test/fixtures/pyupgrade/UP036_0.py:53:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:53:1: UP036 [*] Version block is outdated for minimum Python version | 53 | x = 1 54 | @@ -244,7 +244,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 56 55 | if sys.version_info > (3,): 57 56 | print("py3") -./resources/test/fixtures/pyupgrade/UP036_0.py:56:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:56:1: UP036 [*] Version block is outdated for minimum Python version | 56 | else: print("py2") 57 | @@ -271,7 +271,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 61 58 | if True: 62 59 | if sys.version_info > (3,): -./resources/test/fixtures/pyupgrade/UP036_0.py:62:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:62:5: UP036 [*] Version block is outdated for minimum Python version | 62 | if True: 63 | if sys.version_info > (3,): @@ -298,7 +298,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 67 64 | if sys.version_info < (3,): 68 65 | print("py2") -./resources/test/fixtures/pyupgrade/UP036_0.py:67:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:67:1: UP036 [*] Version block is outdated for minimum Python version | 67 | print("py2") 68 | @@ -325,7 +325,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 72 69 | def f(): 73 70 | if sys.version_info < (3,0): -./resources/test/fixtures/pyupgrade/UP036_0.py:73:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:73:5: UP036 [*] Version block is outdated for minimum Python version | 73 | def f(): 74 | if sys.version_info < (3,0): @@ -356,7 +356,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 81 75 | 82 76 | class C: -./resources/test/fixtures/pyupgrade/UP036_0.py:86:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:86:5: UP036 [*] Version block is outdated for minimum Python version | 86 | pass 87 | @@ -389,7 +389,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 93 89 | def h(): 94 90 | pass -./resources/test/fixtures/pyupgrade/UP036_0.py:97:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:97:5: UP036 [*] Version block is outdated for minimum Python version | 97 | if True: 98 | if sys.version_info < (3,0): @@ -416,7 +416,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 102 99 | # comment 103 100 | -./resources/test/fixtures/pyupgrade/UP036_0.py:104:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:104:1: UP036 [*] Version block is outdated for minimum Python version | 104 | # comment 105 | @@ -458,7 +458,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 115 109 | if True: 116 110 | if sys.version_info > (3,): -./resources/test/fixtures/pyupgrade/UP036_0.py:116:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:116:5: UP036 [*] Version block is outdated for minimum Python version | 116 | if True: 117 | if sys.version_info > (3,): @@ -481,7 +481,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 119 118 | print(2+3) 120 119 | -./resources/test/fixtures/pyupgrade/UP036_0.py:122:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:122:5: UP036 [*] Version block is outdated for minimum Python version | 122 | if True: 123 | if sys.version_info > (3,): print(3) @@ -501,7 +501,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 124 124 | if True: 125 125 | if sys.version_info > (3,): -./resources/test/fixtures/pyupgrade/UP036_0.py:125:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:125:5: UP036 [*] Version block is outdated for minimum Python version | 125 | if True: 126 | if sys.version_info > (3,): @@ -522,7 +522,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 128 127 | 129 128 | if True: -./resources/test/fixtures/pyupgrade/UP036_0.py:130:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:130:5: UP036 [*] Version block is outdated for minimum Python version | 130 | if True: 131 | if sys.version_info <= (3, 0): @@ -556,7 +556,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 139 136 | 140 137 | if sys.version_info <= (3, 0): -./resources/test/fixtures/pyupgrade/UP036_0.py:140:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:140:1: UP036 [*] Version block is outdated for minimum Python version | 140 | / if sys.version_info <= (3, 0): 141 | | expected_error = [] @@ -588,7 +588,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 149 146 | 150 147 | if sys.version_info > (3,0): -./resources/test/fixtures/pyupgrade/UP036_0.py:150:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:150:1: UP036 [*] Version block is outdated for minimum Python version | 150 | / if sys.version_info > (3,0): 151 | | """this @@ -633,7 +633,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 163 162 | if sys.version_info > (3, 0): expected_error = \ 164 163 | [] -./resources/test/fixtures/pyupgrade/UP036_0.py:163:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:163:1: UP036 [*] Version block is outdated for minimum Python version | 163 | "this for some reason") 164 | @@ -655,7 +655,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 165 165 | 166 166 | if sys.version_info > (3, 0): expected_error = [] -./resources/test/fixtures/pyupgrade/UP036_0.py:166:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:166:1: UP036 [*] Version block is outdated for minimum Python version | 166 | [] 167 | @@ -676,7 +676,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 168 168 | if sys.version_info > (3, 0): \ 169 169 | expected_error = [] -./resources/test/fixtures/pyupgrade/UP036_0.py:168:1: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:168:1: UP036 [*] Version block is outdated for minimum Python version | 168 | if sys.version_info > (3, 0): expected_error = [] 169 | @@ -699,7 +699,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 171 170 | if True: 172 171 | if sys.version_info > (3, 0): expected_error = \ -./resources/test/fixtures/pyupgrade/UP036_0.py:172:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:172:5: UP036 [*] Version block is outdated for minimum Python version | 172 | if True: 173 | if sys.version_info > (3, 0): expected_error = \ @@ -721,7 +721,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 174 174 | 175 175 | if True: -./resources/test/fixtures/pyupgrade/UP036_0.py:176:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:176:5: UP036 [*] Version block is outdated for minimum Python version | 176 | if True: 177 | if sys.version_info > (3, 0): expected_error = [] @@ -741,7 +741,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 178 178 | if True: 179 179 | if sys.version_info > (3, 0): \ -./resources/test/fixtures/pyupgrade/UP036_0.py:179:5: UP036 [*] Version block is outdated for minimum Python version +UP036_0.py:179:5: UP036 [*] Version block is outdated for minimum Python version | 179 | if True: 180 | if sys.version_info > (3, 0): \ diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap index c38b6e4647..a82af2713d 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_1.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP036_1.py:3:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:3:1: UP036 [*] Version block is outdated for minimum Python version | 3 | import sys 4 | @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 8 5 | if sys.version_info < (3,): 9 6 | 2 -./resources/test/fixtures/pyupgrade/UP036_1.py:8:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:8:1: UP036 [*] Version block is outdated for minimum Python version | 8 | 3 9 | @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 13 10 | if sys.version_info < (3,0): 14 11 | 2 -./resources/test/fixtures/pyupgrade/UP036_1.py:13:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:13:1: UP036 [*] Version block is outdated for minimum Python version | 13 | 3 14 | @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 18 15 | if sys.version_info == 3: 19 16 | 3 -./resources/test/fixtures/pyupgrade/UP036_1.py:18:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:18:1: UP036 [*] Version block is outdated for minimum Python version | 18 | 3 19 | @@ -108,7 +108,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 23 20 | if sys.version_info > (3,): 24 21 | 3 -./resources/test/fixtures/pyupgrade/UP036_1.py:23:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:23:1: UP036 [*] Version block is outdated for minimum Python version | 23 | 2 24 | @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 28 25 | if sys.version_info >= (3,): 29 26 | 3 -./resources/test/fixtures/pyupgrade/UP036_1.py:28:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:28:1: UP036 [*] Version block is outdated for minimum Python version | 28 | 2 29 | @@ -162,7 +162,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 33 30 | from sys import version_info 34 31 | -./resources/test/fixtures/pyupgrade/UP036_1.py:35:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:35:1: UP036 [*] Version block is outdated for minimum Python version | 35 | from sys import version_info 36 | @@ -189,7 +189,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 40 37 | if True: 41 38 | print(1) -./resources/test/fixtures/pyupgrade/UP036_1.py:42:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:42:1: UP036 [*] Version block is outdated for minimum Python version | 42 | if True: 43 | print(1) @@ -213,7 +213,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 45 43 | print(3) 46 44 | -./resources/test/fixtures/pyupgrade/UP036_1.py:49:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:49:1: UP036 [*] Version block is outdated for minimum Python version | 49 | if True: 50 | print(1) @@ -240,7 +240,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 54 52 | if True: 55 53 | print(1) -./resources/test/fixtures/pyupgrade/UP036_1.py:56:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:56:1: UP036 [*] Version block is outdated for minimum Python version | 56 | if True: 57 | print(1) @@ -262,7 +262,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 58 58 | 59 59 | def f(): -./resources/test/fixtures/pyupgrade/UP036_1.py:62:5: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:62:5: UP036 [*] Version block is outdated for minimum Python version | 62 | if True: 63 | print(1) @@ -285,7 +285,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 64 64 | 65 65 | if True: -./resources/test/fixtures/pyupgrade/UP036_1.py:67:1: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:67:1: UP036 [*] Version block is outdated for minimum Python version | 67 | if True: 68 | print(1) @@ -309,7 +309,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 70 68 | print(3) 71 69 | -./resources/test/fixtures/pyupgrade/UP036_1.py:75:5: UP036 [*] Version block is outdated for minimum Python version +UP036_1.py:75:5: UP036 [*] Version block is outdated for minimum Python version | 75 | if True: 76 | print(1) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap index f24eae911f..60da6ad6d2 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_2.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP036_2.py:4:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:4:1: UP036 [*] Version block is outdated for minimum Python version | 4 | from sys import version_info 5 | @@ -28,7 +28,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 6 | if version_info > (3, 5): 10 7 | 3+6 -./resources/test/fixtures/pyupgrade/UP036_2.py:9:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:9:1: UP036 [*] Version block is outdated for minimum Python version | 9 | 3-5 10 | @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 11 | if sys.version_info >= (3,6): 15 12 | 3+6 -./resources/test/fixtures/pyupgrade/UP036_2.py:14:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:14:1: UP036 [*] Version block is outdated for minimum Python version | 14 | 3-5 15 | @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 19 16 | if version_info >= (3,6): 20 17 | 3+6 -./resources/test/fixtures/pyupgrade/UP036_2.py:19:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:19:1: UP036 [*] Version block is outdated for minimum Python version | 19 | 3-5 20 | @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 21 | if sys.version_info < (3,6): 25 22 | 3-5 -./resources/test/fixtures/pyupgrade/UP036_2.py:24:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:24:1: UP036 [*] Version block is outdated for minimum Python version | 24 | 3-5 25 | @@ -136,7 +136,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 29 26 | if sys.version_info <= (3,5): 30 27 | 3-5 -./resources/test/fixtures/pyupgrade/UP036_2.py:29:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:29:1: UP036 [*] Version block is outdated for minimum Python version | 29 | 3+6 30 | @@ -163,7 +163,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 34 31 | if sys.version_info <= (3, 5): 35 32 | 3-5 -./resources/test/fixtures/pyupgrade/UP036_2.py:34:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:34:1: UP036 [*] Version block is outdated for minimum Python version | 34 | 3+6 35 | @@ -190,7 +190,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 39 36 | if sys.version_info >= (3, 5): 40 37 | pass -./resources/test/fixtures/pyupgrade/UP036_2.py:39:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:39:1: UP036 [*] Version block is outdated for minimum Python version | 39 | 3+6 40 | @@ -213,7 +213,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 41 | if sys.version_info < (3,0): 43 42 | pass -./resources/test/fixtures/pyupgrade/UP036_2.py:42:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:42:1: UP036 [*] Version block is outdated for minimum Python version | 42 | pass 43 | @@ -235,7 +235,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 45 43 | if True: 46 44 | if sys.version_info < (3,0): -./resources/test/fixtures/pyupgrade/UP036_2.py:46:5: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:46:5: UP036 [*] Version block is outdated for minimum Python version | 46 | if True: 47 | if sys.version_info < (3,0): @@ -258,7 +258,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 48 | if sys.version_info < (3,0): 50 49 | pass -./resources/test/fixtures/pyupgrade/UP036_2.py:49:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:49:1: UP036 [*] Version block is outdated for minimum Python version | 49 | pass 50 | @@ -284,7 +284,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 53 51 | 54 52 | if sys.version_info > (3,): -./resources/test/fixtures/pyupgrade/UP036_2.py:54:1: UP036 [*] Version block is outdated for minimum Python version +UP036_2.py:54:1: UP036 [*] Version block is outdated for minimum Python version | 54 | pass 55 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap index b7e8b07baa..7d8dd0bb1e 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_3.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP036_3.py:3:1: UP036 [*] Version block is outdated for minimum Python version +UP036_3.py:3:1: UP036 [*] Version block is outdated for minimum Python version | 3 | import sys 4 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 7 | if False: 13 8 | if sys.version_info < (3,0): -./resources/test/fixtures/pyupgrade/UP036_3.py:13:5: UP036 [*] Version block is outdated for minimum Python version +UP036_3.py:13:5: UP036 [*] Version block is outdated for minimum Python version | 13 | if False: 14 | if sys.version_info < (3,0): @@ -72,7 +72,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 22 17 | 23 18 | if sys.version_info < (3,0): print("PY2!") -./resources/test/fixtures/pyupgrade/UP036_3.py:23:1: UP036 [*] Version block is outdated for minimum Python version +UP036_3.py:23:1: UP036 [*] Version block is outdated for minimum Python version | 23 | / if sys.version_info < (3,0): print("PY2!") 24 | | else : print("PY3!") diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap index 4f982a54f9..5205a85728 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP036_4.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP036_4.py:4:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:4:5: UP036 [*] Version block is outdated for minimum Python version | 4 | if True: 5 | if sys.version_info < (3, 3): @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 7 6 | 8 7 | if True: -./resources/test/fixtures/pyupgrade/UP036_4.py:11:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:11:5: UP036 [*] Version block is outdated for minimum Python version | 11 | if foo: 12 | pass @@ -45,7 +45,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 14 12 | if True: 15 13 | if foo: -./resources/test/fixtures/pyupgrade/UP036_4.py:17:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:17:5: UP036 [*] Version block is outdated for minimum Python version | 17 | if foo: 18 | pass @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 18 | cmd = [sys.executable, "-m", "test", "-j0"] 21 19 | -./resources/test/fixtures/pyupgrade/UP036_4.py:24:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:24:5: UP036 [*] Version block is outdated for minimum Python version | 24 | if foo: 25 | pass @@ -93,7 +93,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 27 25 | if sys.version_info < (3, 3): 28 26 | cmd = [sys.executable, "-m", "test.regrtest"] -./resources/test/fixtures/pyupgrade/UP036_4.py:27:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:27:5: UP036 [*] Version block is outdated for minimum Python version | 27 | cmd = [sys.executable, "-m", "test.regrtest"] 28 | @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 30 28 | if foo: 31 29 | pass -./resources/test/fixtures/pyupgrade/UP036_4.py:32:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:32:5: UP036 [*] Version block is outdated for minimum Python version | 32 | if foo: 33 | pass @@ -141,7 +141,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 35 33 | cmd = [sys.executable, "-m", "test", "-j0"] 36 34 | -./resources/test/fixtures/pyupgrade/UP036_4.py:37:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:37:5: UP036 [*] Version block is outdated for minimum Python version | 37 | cmd = [sys.executable, "-m", "test", "-j0"] 38 | @@ -169,7 +169,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 39 | if sys.version_info < (3, 3): 43 40 | cmd = [sys.executable, "-m", "test.regrtest"] -./resources/test/fixtures/pyupgrade/UP036_4.py:42:5: UP036 [*] Version block is outdated for minimum Python version +UP036_4.py:42:5: UP036 [*] Version block is outdated for minimum Python version | 42 | cmd = [sys.executable, "-m", "test", "-j0"] 43 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap index 13cedcbd84..6fb7ab4a23 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP037.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP037.py:18:14: UP037 [*] Remove quotes from type annotation +UP037.py:18:14: UP037 [*] Remove quotes from type annotation | 18 | def foo(var: "MyClass") -> "MyClass": | ^^^^^^^^^ UP037 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | 21 21 | -./resources/test/fixtures/pyupgrade/UP037.py:18:28: UP037 [*] Remove quotes from type annotation +UP037.py:18:28: UP037 [*] Remove quotes from type annotation | 18 | def foo(var: "MyClass") -> "MyClass": | ^^^^^^^^^ UP037 @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 20 20 | 21 21 | -./resources/test/fixtures/pyupgrade/UP037.py:19:8: UP037 [*] Remove quotes from type annotation +UP037.py:19:8: UP037 [*] Remove quotes from type annotation | 19 | def foo(var: "MyClass") -> "MyClass": 20 | x: "MyClass" @@ -55,7 +55,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 21 21 | 22 22 | def foo(*, inplace: "bool"): -./resources/test/fixtures/pyupgrade/UP037.py:22:21: UP037 [*] Remove quotes from type annotation +UP037.py:22:21: UP037 [*] Remove quotes from type annotation | 22 | def foo(*, inplace: "bool"): | ^^^^^^ UP037 @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 24 24 | 25 25 | -./resources/test/fixtures/pyupgrade/UP037.py:26:16: UP037 [*] Remove quotes from type annotation +UP037.py:26:16: UP037 [*] Remove quotes from type annotation | 26 | def foo(*args: "str", **kwargs: "int"): | ^^^^^ UP037 @@ -91,7 +91,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 28 28 | 29 29 | -./resources/test/fixtures/pyupgrade/UP037.py:26:33: UP037 [*] Remove quotes from type annotation +UP037.py:26:33: UP037 [*] Remove quotes from type annotation | 26 | def foo(*args: "str", **kwargs: "int"): | ^^^^^ UP037 @@ -109,7 +109,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 28 28 | 29 29 | -./resources/test/fixtures/pyupgrade/UP037.py:30:10: UP037 [*] Remove quotes from type annotation +UP037.py:30:10: UP037 [*] Remove quotes from type annotation | 30 | x: Tuple["MyClass"] | ^^^^^^^^^ UP037 @@ -128,7 +128,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 32 32 | x: Callable[["MyClass"], None] 33 33 | -./resources/test/fixtures/pyupgrade/UP037.py:32:14: UP037 [*] Remove quotes from type annotation +UP037.py:32:14: UP037 [*] Remove quotes from type annotation | 32 | x: Tuple["MyClass"] 33 | @@ -147,7 +147,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 34 34 | 35 35 | class Foo(NamedTuple): -./resources/test/fixtures/pyupgrade/UP037.py:36:8: UP037 [*] Remove quotes from type annotation +UP037.py:36:8: UP037 [*] Remove quotes from type annotation | 36 | class Foo(NamedTuple): 37 | x: "MyClass" @@ -165,7 +165,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 38 38 | 39 39 | class D(TypedDict): -./resources/test/fixtures/pyupgrade/UP037.py:40:27: UP037 [*] Remove quotes from type annotation +UP037.py:40:27: UP037 [*] Remove quotes from type annotation | 40 | class D(TypedDict): 41 | E: TypedDict("E", foo="int", total=False) @@ -183,7 +183,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 42 | 43 43 | class D(TypedDict): -./resources/test/fixtures/pyupgrade/UP037.py:44:31: UP037 [*] Remove quotes from type annotation +UP037.py:44:31: UP037 [*] Remove quotes from type annotation | 44 | class D(TypedDict): 45 | E: TypedDict("E", {"foo": "int"}) @@ -201,7 +201,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 46 46 | 47 47 | x: Annotated["str", "metadata"] -./resources/test/fixtures/pyupgrade/UP037.py:47:14: UP037 [*] Remove quotes from type annotation +UP037.py:47:14: UP037 [*] Remove quotes from type annotation | 47 | x: Annotated["str", "metadata"] | ^^^^^ UP037 @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 49 49 | x: Arg("str", "name") 50 50 | -./resources/test/fixtures/pyupgrade/UP037.py:49:8: UP037 [*] Remove quotes from type annotation +UP037.py:49:8: UP037 [*] Remove quotes from type annotation | 49 | x: Annotated["str", "metadata"] 50 | @@ -241,7 +241,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 51 51 | x: DefaultArg("str", "name") 52 52 | -./resources/test/fixtures/pyupgrade/UP037.py:51:15: UP037 [*] Remove quotes from type annotation +UP037.py:51:15: UP037 [*] Remove quotes from type annotation | 51 | x: Arg("str", "name") 52 | @@ -262,7 +262,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 53 53 | x: NamedArg("str", "name") 54 54 | -./resources/test/fixtures/pyupgrade/UP037.py:53:13: UP037 [*] Remove quotes from type annotation +UP037.py:53:13: UP037 [*] Remove quotes from type annotation | 53 | x: DefaultArg("str", "name") 54 | @@ -283,7 +283,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 55 55 | x: DefaultNamedArg("str", "name") 56 56 | -./resources/test/fixtures/pyupgrade/UP037.py:55:20: UP037 [*] Remove quotes from type annotation +UP037.py:55:20: UP037 [*] Remove quotes from type annotation | 55 | x: NamedArg("str", "name") 56 | @@ -304,7 +304,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 57 57 | x: DefaultNamedArg("str", name="name") 58 58 | -./resources/test/fixtures/pyupgrade/UP037.py:57:20: UP037 [*] Remove quotes from type annotation +UP037.py:57:20: UP037 [*] Remove quotes from type annotation | 57 | x: DefaultNamedArg("str", "name") 58 | @@ -325,7 +325,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 59 59 | x: VarArg("str") 60 60 | -./resources/test/fixtures/pyupgrade/UP037.py:59:11: UP037 [*] Remove quotes from type annotation +UP037.py:59:11: UP037 [*] Remove quotes from type annotation | 59 | x: DefaultNamedArg("str", name="name") 60 | @@ -346,7 +346,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 61 61 | x: List[List[List["MyClass"]]] 62 62 | -./resources/test/fixtures/pyupgrade/UP037.py:61:19: UP037 [*] Remove quotes from type annotation +UP037.py:61:19: UP037 [*] Remove quotes from type annotation | 61 | x: VarArg("str") 62 | @@ -367,7 +367,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 63 63 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")]) 64 64 | -./resources/test/fixtures/pyupgrade/UP037.py:63:29: UP037 [*] Remove quotes from type annotation +UP037.py:63:29: UP037 [*] Remove quotes from type annotation | 63 | x: List[List[List["MyClass"]]] 64 | @@ -388,7 +388,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 65 65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")]) 66 66 | -./resources/test/fixtures/pyupgrade/UP037.py:63:45: UP037 [*] Remove quotes from type annotation +UP037.py:63:45: UP037 [*] Remove quotes from type annotation | 63 | x: List[List[List["MyClass"]]] 64 | @@ -409,7 +409,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 65 65 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")]) 66 66 | -./resources/test/fixtures/pyupgrade/UP037.py:65:29: UP037 [*] Remove quotes from type annotation +UP037.py:65:29: UP037 [*] Remove quotes from type annotation | 65 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")]) 66 | @@ -430,7 +430,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")]) 68 68 | -./resources/test/fixtures/pyupgrade/UP037.py:65:36: UP037 [*] Remove quotes from type annotation +UP037.py:65:36: UP037 [*] Remove quotes from type annotation | 65 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")]) 66 | @@ -451,7 +451,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")]) 68 68 | -./resources/test/fixtures/pyupgrade/UP037.py:65:45: UP037 [*] Remove quotes from type annotation +UP037.py:65:45: UP037 [*] Remove quotes from type annotation | 65 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")]) 66 | @@ -472,7 +472,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")]) 68 68 | -./resources/test/fixtures/pyupgrade/UP037.py:65:52: UP037 [*] Remove quotes from type annotation +UP037.py:65:52: UP037 [*] Remove quotes from type annotation | 65 | x: NamedTuple("X", [("foo", "int"), ("bar", "str")]) 66 | @@ -493,7 +493,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 67 67 | x: NamedTuple(typename="X", fields=[("foo", "int")]) 68 68 | -./resources/test/fixtures/pyupgrade/UP037.py:67:24: UP037 [*] Remove quotes from type annotation +UP037.py:67:24: UP037 [*] Remove quotes from type annotation | 67 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")]) 68 | @@ -514,7 +514,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 69 69 | X: MyCallable("X") 70 70 | -./resources/test/fixtures/pyupgrade/UP037.py:67:38: UP037 [*] Remove quotes from type annotation +UP037.py:67:38: UP037 [*] Remove quotes from type annotation | 67 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")]) 68 | @@ -535,7 +535,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 69 69 | X: MyCallable("X") 70 70 | -./resources/test/fixtures/pyupgrade/UP037.py:67:45: UP037 [*] Remove quotes from type annotation +UP037.py:67:45: UP037 [*] Remove quotes from type annotation | 67 | x: NamedTuple("X", fields=[("foo", "int"), ("bar", "str")]) 68 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap index e03af7887c..232b3ebd68 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__UP038.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP038.py:1:1: UP038 [*] Use `X | Y` in `isinstance` call instead of `(X, Y)` +UP038.py:1:1: UP038 [*] Use `X | Y` in `isinstance` call instead of `(X, Y)` | 1 | isinstance(1, (int, float)) # UP038 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP038 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 3 3 | 4 4 | isinstance(1, int) # OK -./resources/test/fixtures/pyupgrade/UP038.py:2:1: UP038 [*] Use `X | Y` in `issubclass` call instead of `(X, Y)` +UP038.py:2:1: UP038 [*] Use `X | Y` in `issubclass` call instead of `(X, Y)` | 2 | isinstance(1, (int, float)) # UP038 3 | issubclass("yes", (int, float, str)) # UP038 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap index ce4e9982c7..5aace83b43 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__datetime_utc_alias_py311.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/UP017.py:7:7: UP017 Use `datetime.UTC` alias +UP017.py:7:7: UP017 Use `datetime.UTC` alias | 7 | print(datetime.timezone(-1)) 8 | print(timezone.utc) @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 9 | print(tz.utc) | -./resources/test/fixtures/pyupgrade/UP017.py:8:7: UP017 Use `datetime.UTC` alias +UP017.py:8:7: UP017 Use `datetime.UTC` alias | 8 | print(datetime.timezone(-1)) 9 | print(timezone.utc) @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 12 | print(datetime.timezone.utc) | -./resources/test/fixtures/pyupgrade/UP017.py:10:7: UP017 [*] Use `datetime.UTC` alias +UP017.py:10:7: UP017 [*] Use `datetime.UTC` alias | 10 | print(tz.utc) 11 | @@ -37,7 +37,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 10 |+print(datetime.UTC) 11 11 | print(dt.timezone.utc) -./resources/test/fixtures/pyupgrade/UP017.py:11:7: UP017 Use `datetime.UTC` alias +UP017.py:11:7: UP017 Use `datetime.UTC` alias | 11 | print(datetime.timezone.utc) 12 | print(dt.timezone.utc) diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap index 5fe1b2f6e2..6f8585b8ef 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_p37.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/future_annotations.py:34:18: UP006 [*] Use `list` instead of `List` for type annotations +future_annotations.py:34:18: UP006 [*] Use `list` instead of `List` for type annotations | 34 | def f(x: int) -> List[int]: | ^^^^ UP006 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap index 837f4b5809..6e9bf5fb17 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_585_py310.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/future_annotations.py:34:18: UP006 [*] Use `list` instead of `List` for type annotations +future_annotations.py:34:18: UP006 [*] Use `list` instead of `List` for type annotations | 34 | def f(x: int) -> List[int]: | ^^^^ UP006 @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 36 36 | y.append(x) 37 37 | return y -./resources/test/fixtures/pyupgrade/future_annotations.py:35:9: UP006 [*] Use `list` instead of `List` for type annotations +future_annotations.py:35:9: UP006 [*] Use `list` instead of `List` for type annotations | 35 | def f(x: int) -> List[int]: 36 | y = List[int]() @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 37 37 | return y 38 38 | -./resources/test/fixtures/pyupgrade/future_annotations.py:42:27: UP006 [*] Use `list` instead of `List` for type annotations +future_annotations.py:42:27: UP006 [*] Use `list` instead of `List` for type annotations | 42 | x: Optional[int] = None 43 | @@ -56,7 +56,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 42 |-MyList: TypeAlias = Union[List[int], List[str]] 42 |+MyList: TypeAlias = Union[list[int], List[str]] -./resources/test/fixtures/pyupgrade/future_annotations.py:42:38: UP006 [*] Use `list` instead of `List` for type annotations +future_annotations.py:42:38: UP006 [*] Use `list` instead of `List` for type annotations | 42 | x: Optional[int] = None 43 | diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap index 5fccb24f60..a5a07f6b84 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_p37.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/future_annotations.py:40:4: UP007 [*] Use `X | Y` for type annotations +future_annotations.py:40:4: UP007 [*] Use `X | Y` for type annotations | 40 | x: Optional[int] = None | ^^^^^^^^^^^^^ UP007 diff --git a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap index 0dfa9ff530..99fa2ef2d2 100644 --- a/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap +++ b/crates/ruff/src/rules/pyupgrade/snapshots/ruff__rules__pyupgrade__tests__future_annotations_pep_604_py310.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/pyupgrade/mod.rs --- -./resources/test/fixtures/pyupgrade/future_annotations.py:40:4: UP007 [*] Use `X | Y` for type annotations +future_annotations.py:40:4: UP007 [*] Use `X | Y` for type annotations | 40 | x: Optional[int] = None | ^^^^^^^^^^^^^ UP007 @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/pyupgrade/mod.rs 41 41 | 42 42 | MyList: TypeAlias = Union[List[int], List[str]] -./resources/test/fixtures/pyupgrade/future_annotations.py:42:21: UP007 [*] Use `X | Y` for type annotations +future_annotations.py:42:21: UP007 [*] Use `X | Y` for type annotations | 42 | x: Optional[int] = None 43 | diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap index 14526e0168..88464a0979 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF005_RUF005.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF005.py:10:7: RUF005 [*] Consider `[1, 2, 3, *foo]` instead of concatenation +RUF005.py:10:7: RUF005 [*] Consider `[1, 2, 3, *foo]` instead of concatenation | 10 | foo = [4, 5, 6] 11 | bar = [1, 2, 3] + foo @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 12 12 | quux = (7, 8, 9) + zoob 13 13 | spam = quux + (10, 11, 12) -./resources/test/fixtures/ruff/RUF005.py:12:8: RUF005 [*] Consider `(7, 8, 9, *zoob)` instead of concatenation +RUF005.py:12:8: RUF005 [*] Consider `(7, 8, 9, *zoob)` instead of concatenation | 12 | bar = [1, 2, 3] + foo 13 | zoob = tuple(bar) @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 14 14 | spom = list(spam) 15 15 | eggs = spom + [13, 14, 15] -./resources/test/fixtures/ruff/RUF005.py:13:8: RUF005 [*] Consider `(*quux, 10, 11, 12)` instead of concatenation +RUF005.py:13:8: RUF005 [*] Consider `(*quux, 10, 11, 12)` instead of concatenation | 13 | zoob = tuple(bar) 14 | quux = (7, 8, 9) + zoob @@ -63,7 +63,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 15 15 | eggs = spom + [13, 14, 15] 16 16 | elatement = ("we all say", ) + yay() -./resources/test/fixtures/ruff/RUF005.py:15:8: RUF005 [*] Consider `[*spom, 13, 14, 15]` instead of concatenation +RUF005.py:15:8: RUF005 [*] Consider `[*spom, 13, 14, 15]` instead of concatenation | 15 | spam = quux + (10, 11, 12) 16 | spom = list(spam) @@ -84,7 +84,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 17 17 | excitement = ("we all think", ) + Fun().yay() 18 18 | astonishment = ("we all feel", ) + Fun.words -./resources/test/fixtures/ruff/RUF005.py:16:13: RUF005 [*] Consider `("we all say", *yay())` instead of concatenation +RUF005.py:16:13: RUF005 [*] Consider `("we all say", *yay())` instead of concatenation | 16 | spom = list(spam) 17 | eggs = spom + [13, 14, 15] @@ -105,7 +105,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 18 18 | astonishment = ("we all feel", ) + Fun.words 19 19 | -./resources/test/fixtures/ruff/RUF005.py:17:14: RUF005 [*] Consider `("we all think", *Fun().yay())` instead of concatenation +RUF005.py:17:14: RUF005 [*] Consider `("we all think", *Fun().yay())` instead of concatenation | 17 | eggs = spom + [13, 14, 15] 18 | elatement = ("we all say", ) + yay() @@ -125,7 +125,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 19 19 | 20 20 | chain = ['a', 'b', 'c'] + eggs + list(('yes', 'no', 'pants') + zoob) -./resources/test/fixtures/ruff/RUF005.py:18:16: RUF005 [*] Consider `("we all feel", *Fun.words)` instead of concatenation +RUF005.py:18:16: RUF005 [*] Consider `("we all feel", *Fun.words)` instead of concatenation | 18 | elatement = ("we all say", ) + yay() 19 | excitement = ("we all think", ) + Fun().yay() @@ -146,7 +146,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 20 20 | chain = ['a', 'b', 'c'] + eggs + list(('yes', 'no', 'pants') + zoob) 21 21 | -./resources/test/fixtures/ruff/RUF005.py:20:9: RUF005 [*] Consider `["a", "b", "c", *eggs]` instead of concatenation +RUF005.py:20:9: RUF005 [*] Consider `["a", "b", "c", *eggs]` instead of concatenation | 20 | astonishment = ("we all feel", ) + Fun.words 21 | @@ -167,7 +167,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 22 22 | baz = () + zoob 23 23 | -./resources/test/fixtures/ruff/RUF005.py:20:39: RUF005 [*] Consider `("yes", "no", "pants", *zoob)` instead of concatenation +RUF005.py:20:39: RUF005 [*] Consider `("yes", "no", "pants", *zoob)` instead of concatenation | 20 | astonishment = ("we all feel", ) + Fun.words 21 | @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 22 22 | baz = () + zoob 23 23 | -./resources/test/fixtures/ruff/RUF005.py:22:7: RUF005 [*] Consider `(*zoob,)` instead of concatenation +RUF005.py:22:7: RUF005 [*] Consider `(*zoob,)` instead of concatenation | 22 | chain = ['a', 'b', 'c'] + eggs + list(('yes', 'no', 'pants') + zoob) 23 | @@ -209,7 +209,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 24 24 | first = [ 25 25 | # The order -./resources/test/fixtures/ruff/RUF005.py:32:10: RUF005 Consider `[*first, 4, 5, 6]` instead of concatenation +RUF005.py:32:10: RUF005 Consider `[*first, 4, 5, 6]` instead of concatenation | 32 | # to preserve 33 | ] @@ -227,7 +227,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 43 | [] + foo + [ | -./resources/test/fixtures/ruff/RUF005.py:41:1: RUF005 [*] Consider `[*foo]` instead of concatenation +RUF005.py:41:1: RUF005 [*] Consider `[*foo]` instead of concatenation | 41 | ] 42 | @@ -247,7 +247,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 43 43 | 44 44 | [] + foo + [ # This will be preserved, but doesn't prevent the fix -./resources/test/fixtures/ruff/RUF005.py:44:1: RUF005 [*] Consider `[*foo]` instead of concatenation +RUF005.py:44:1: RUF005 [*] Consider `[*foo]` instead of concatenation | 44 | ] 45 | diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap index c1d3fc0009..042edb664a 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF006_RUF006.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF006.py:6:5: RUF006 Store a reference to the return value of `asyncio.create_task` +RUF006.py:6:5: RUF006 Store a reference to the return value of `asyncio.create_task` | 6 | # Error 7 | def f(): @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/ruff/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF006 | -./resources/test/fixtures/ruff/RUF006.py:11:5: RUF006 Store a reference to the return value of `asyncio.ensure_future` +RUF006.py:11:5: RUF006 Store a reference to the return value of `asyncio.ensure_future` | 11 | # Error 12 | def f(): diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF008_RUF008.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF008_RUF008.py.snap index b2fe7f37ca..3af7ffb0f4 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF008_RUF008.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF008_RUF008.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF008.py:8:34: RUF008 Do not use mutable default values for dataclass attributes +RUF008.py:8:34: RUF008 Do not use mutable default values for dataclass attributes | 8 | @dataclass() 9 | class A: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 12 | ignored_via_comment: list[int] = [] # noqa: RUF008 | -./resources/test/fixtures/ruff/RUF008.py:9:26: RUF008 Do not use mutable default values for dataclass attributes +RUF008.py:9:26: RUF008 Do not use mutable default values for dataclass attributes | 9 | class A: 10 | mutable_default: list[int] = [] @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 13 | correct_code: list[int] = KNOWINGLY_MUTABLE_DEFAULT | -./resources/test/fixtures/ruff/RUF008.py:17:34: RUF008 Do not use mutable default values for dataclass attributes +RUF008.py:17:34: RUF008 Do not use mutable default values for dataclass attributes | 17 | @dataclass 18 | class B: @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 21 | ignored_via_comment: list[int] = [] # noqa: RUF008 | -./resources/test/fixtures/ruff/RUF008.py:18:26: RUF008 Do not use mutable default values for dataclass attributes +RUF008.py:18:26: RUF008 Do not use mutable default values for dataclass attributes | 18 | class B: 19 | mutable_default: list[int] = [] diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF009_RUF009.py.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF009_RUF009.py.snap index 3c7c1579ab..25e81cdeb0 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF009_RUF009.py.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__RUF009_RUF009.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF009.py:15:41: RUF009 Do not perform function call `default_function` in dataclass defaults +RUF009.py:15:41: RUF009 Do not perform function call `default_function` in dataclass defaults | 15 | @dataclass() 16 | class A: @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/ruff/mod.rs | ^^^^^^^^^^^^^^^^^^ RUF009 | -./resources/test/fixtures/ruff/RUF009.py:24:41: RUF009 Do not perform function call `default_function` in dataclass defaults +RUF009.py:24:41: RUF009 Do not perform function call `default_function` in dataclass defaults | 24 | @dataclass 25 | class B: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 28 | not_optimal: ImmutableType = ImmutableType(20) | -./resources/test/fixtures/ruff/RUF009.py:25:28: RUF009 Do not perform function call `A` in dataclass defaults +RUF009.py:25:28: RUF009 Do not perform function call `A` in dataclass defaults | 25 | class B: 26 | hidden_mutable_default: list[int] = default_function() @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 29 | good_variant: ImmutableType = DEFAULT_IMMUTABLETYPE_FOR_ALL_DATACLASSES | -./resources/test/fixtures/ruff/RUF009.py:26:34: RUF009 Do not perform function call `ImmutableType` in dataclass defaults +RUF009.py:26:34: RUF009 Do not perform function call `ImmutableType` in dataclass defaults | 26 | hidden_mutable_default: list[int] = default_function() 27 | another_dataclass: A = A() diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap index 83d3f0b214..75d127a751 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__confusables.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/confusables.py:1:6: RUF001 [*] String contains ambiguous unicode character `𝐁` (did you mean `B`?) +confusables.py:1:6: RUF001 [*] String contains ambiguous unicode character `𝐁` (did you mean `B`?) | 1 | x = "𝐁ad string" | ^ RUF001 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 3 3 | 4 4 | -./resources/test/fixtures/ruff/confusables.py:6:56: RUF002 [*] Docstring contains ambiguous unicode character `)` (did you mean `)`?) +confusables.py:6:56: RUF002 [*] Docstring contains ambiguous unicode character `)` (did you mean `)`?) | 6 | def f(): 7 | """Here's a docstring with an unusual parenthesis: )""" @@ -36,7 +36,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 8 8 | ... 9 9 | -./resources/test/fixtures/ruff/confusables.py:7:62: RUF003 [*] Comment contains ambiguous unicode character `᜵` (did you mean `/`?) +confusables.py:7:62: RUF003 [*] Comment contains ambiguous unicode character `᜵` (did you mean `/`?) | 7 | def f(): 8 | """Here's a docstring with an unusual parenthesis: )""" diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap index 99e182f8ac..7c3a3bf874 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_0.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF100_0.py:9:12: RUF100 [*] Unused blanket `noqa` directive +RUF100_0.py:9:12: RUF100 [*] Unused blanket `noqa` directive | 9 | # Invalid 10 | c = 1 # noqa @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 11 11 | 12 12 | # Invalid -./resources/test/fixtures/ruff/RUF100_0.py:13:12: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:13:12: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 13 | # Invalid 14 | d = 1 # noqa: E501 @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 15 15 | # Invalid 16 16 | d = 1 # noqa: F841, E501 -./resources/test/fixtures/ruff/RUF100_0.py:16:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `E501`) +RUF100_0.py:16:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `E501`) | 16 | # Invalid 17 | d = 1 # noqa: F841, E501 @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 18 18 | # Invalid (and unimplemented or not enabled) 19 19 | d = 1 # noqa: F841, W191, F821 -./resources/test/fixtures/ruff/RUF100_0.py:19:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`) +RUF100_0.py:19:12: RUF100 [*] Unused `noqa` directive (unused: `F841`, `W191`; non-enabled: `F821`) | 19 | # Invalid (and unimplemented or not enabled) 20 | d = 1 # noqa: F841, W191, F821 @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 21 21 | # Invalid (but external) 22 22 | d = 1 # noqa: F841, V101 -./resources/test/fixtures/ruff/RUF100_0.py:22:12: RUF100 [*] Unused `noqa` directive (unused: `F841`; unknown: `V101`) +RUF100_0.py:22:12: RUF100 [*] Unused `noqa` directive (unused: `F841`; unknown: `V101`) | 22 | # Invalid (but external) 23 | d = 1 # noqa: F841, V101 @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 24 24 | # fmt: off 25 25 | # Invalid - no space before # -./resources/test/fixtures/ruff/RUF100_0.py:26:10: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:26:10: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 26 | # fmt: off 27 | # Invalid - no space before # @@ -121,7 +121,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 28 28 | # Invalid - many spaces before # 29 29 | d = 1 # noqa: E501 -./resources/test/fixtures/ruff/RUF100_0.py:29:5: F841 [*] Local variable `d` is assigned to but never used +RUF100_0.py:29:5: F841 [*] Local variable `d` is assigned to but never used | 29 | # Invalid - many spaces before # 30 | d = 1 # noqa: E501 @@ -139,7 +139,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 31 30 | 32 31 | -./resources/test/fixtures/ruff/RUF100_0.py:29:33: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:29:33: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 29 | # Invalid - many spaces before # 30 | d = 1 # noqa: E501 @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 31 31 | 32 32 | -./resources/test/fixtures/ruff/RUF100_0.py:55:6: RUF100 [*] Unused `noqa` directive (unused: `F841`) +RUF100_0.py:55:6: RUF100 [*] Unused `noqa` directive (unused: `F841`) | 55 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 56 | """ # noqa: E501, F841 @@ -178,7 +178,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 57 57 | # Invalid 58 58 | _ = """Lorem ipsum dolor sit amet. -./resources/test/fixtures/ruff/RUF100_0.py:63:6: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_0.py:63:6: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 63 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. 64 | """ # noqa: E501 @@ -198,7 +198,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 65 65 | # Invalid 66 66 | _ = """Lorem ipsum dolor sit amet. -./resources/test/fixtures/ruff/RUF100_0.py:71:6: RUF100 [*] Unused blanket `noqa` directive +RUF100_0.py:71:6: RUF100 [*] Unused blanket `noqa` directive | 71 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor. 72 | """ # noqa @@ -218,7 +218,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 73 73 | # Valid 74 74 | # this is a veryyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy long comment # noqa: E501 -./resources/test/fixtures/ruff/RUF100_0.py:85:8: F401 [*] `shelve` imported but unused +RUF100_0.py:85:8: F401 [*] `shelve` imported but unused | 85 | import collections # noqa 86 | import os # noqa: F401, RUF100 @@ -237,7 +237,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 87 86 | 88 87 | print(sys.path) -./resources/test/fixtures/ruff/RUF100_0.py:90:89: E501 Line too long (103 > 88 characters) +RUF100_0.py:90:89: E501 Line too long (103 > 88 characters) | 90 | print(sys.path) 91 | @@ -245,7 +245,7 @@ source: crates/ruff/src/rules/ruff/mod.rs | ^^^^^^^^^^^^^^^ E501 | -./resources/test/fixtures/ruff/RUF100_0.py:90:92: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_0.py:90:92: RUF100 [*] Unused `noqa` directive (unused: `F401`) | 90 | print(sys.path) 91 | diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap index 1b84a440c3..18c066c26d 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_1.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF100_1.py:37:9: F401 [*] `typing.Union` imported but unused +RUF100_1.py:37:9: F401 [*] `typing.Union` imported but unused | 37 | from typing import ( 38 | Mapping, # noqa: F401 @@ -22,7 +22,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 40 39 | 41 40 | def f(): -./resources/test/fixtures/ruff/RUF100_1.py:52:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_1.py:52:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) | 52 | # This should ignore the error, but the inner noqa should be marked as unused. 53 | from typing import ( # noqa: F401 @@ -42,7 +42,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 54 54 | 55 55 | -./resources/test/fixtures/ruff/RUF100_1.py:59:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_1.py:59:20: RUF100 [*] Unused `noqa` directive (unused: `F401`) | 59 | # This should ignore the error, but the inner noqa should be marked as unused. 60 | from typing import ( # noqa @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 61 61 | 62 62 | -./resources/test/fixtures/ruff/RUF100_1.py:66:16: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) +RUF100_1.py:66:16: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) | 66 | # This should ignore the error, but mark F501 as unused. 67 | from typing import ( # noqa: F401 @@ -82,7 +82,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 68 68 | 69 69 | -./resources/test/fixtures/ruff/RUF100_1.py:72:27: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) +RUF100_1.py:72:27: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) | 72 | def f(): 73 | # This should ignore the error, but mark F501 as unused. @@ -103,7 +103,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 74 74 | ) 75 75 | -./resources/test/fixtures/ruff/RUF100_1.py:89:24: F401 [*] `typing.Awaitable` imported but unused +RUF100_1.py:89:24: F401 [*] `typing.Awaitable` imported but unused | 89 | def f(): 90 | # This should mark F501 as unused. @@ -119,7 +119,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 89 |- from typing import Awaitable, AwaitableGenerator # noqa: F501 89 |+ pass # noqa: F501 -./resources/test/fixtures/ruff/RUF100_1.py:89:35: F401 [*] `typing.AwaitableGenerator` imported but unused +RUF100_1.py:89:35: F401 [*] `typing.AwaitableGenerator` imported but unused | 89 | def f(): 90 | # This should mark F501 as unused. @@ -135,7 +135,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 89 |- from typing import Awaitable, AwaitableGenerator # noqa: F501 89 |+ pass # noqa: F501 -./resources/test/fixtures/ruff/RUF100_1.py:89:55: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) +RUF100_1.py:89:55: RUF100 [*] Unused `noqa` directive (non-enabled: `F501`) | 89 | def f(): 90 | # This should mark F501 as unused. diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap index 0d216fa7ed..7fd1341d11 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_2.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF100_2.py:1:19: RUF100 [*] Unused `noqa` directive (unused: `F401`) +RUF100_2.py:1:19: RUF100 [*] Unused `noqa` directive (unused: `F401`) | 1 | import itertools # noqa: F401 | ^^^^^^^^^^^^ RUF100 diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap index 2980b10fc1..6e3171c85b 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruf100_3.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF100_3.py:1:1: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:1:1: RUF100 [*] Unused blanket `noqa` directive | 1 | # noqa | ^^^^^^ RUF100 @@ -16,7 +16,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 3 2 | print() # noqa 4 3 | print() # noqa # comment -./resources/test/fixtures/ruff/RUF100_3.py:2:1: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:2:1: RUF100 [*] Unused blanket `noqa` directive | 2 | # noqa 3 | # noqa # comment @@ -34,7 +34,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 4 4 | print() # noqa # comment 5 5 | print() # noqa # comment -./resources/test/fixtures/ruff/RUF100_3.py:3:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:3:10: RUF100 [*] Unused blanket `noqa` directive | 3 | # noqa 4 | # noqa # comment @@ -54,7 +54,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 5 5 | print() # noqa # comment 6 6 | print() # noqa comment -./resources/test/fixtures/ruff/RUF100_3.py:4:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:4:10: RUF100 [*] Unused blanket `noqa` directive | 4 | # noqa # comment 5 | print() # noqa @@ -75,7 +75,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 6 6 | print() # noqa comment 7 7 | print() # noqa comment -./resources/test/fixtures/ruff/RUF100_3.py:5:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:5:10: RUF100 [*] Unused blanket `noqa` directive | 5 | print() # noqa 6 | print() # noqa # comment @@ -96,7 +96,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 7 7 | print() # noqa comment 8 8 | print(a) # noqa -./resources/test/fixtures/ruff/RUF100_3.py:6:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:6:10: RUF100 [*] Unused blanket `noqa` directive | 6 | print() # noqa # comment 7 | print() # noqa # comment @@ -117,7 +117,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 8 8 | print(a) # noqa 9 9 | print(a) # noqa # comment -./resources/test/fixtures/ruff/RUF100_3.py:7:10: RUF100 [*] Unused blanket `noqa` directive +RUF100_3.py:7:10: RUF100 [*] Unused blanket `noqa` directive | 7 | print() # noqa # comment 8 | print() # noqa comment @@ -138,7 +138,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 9 9 | print(a) # noqa # comment 10 10 | print(a) # noqa # comment -./resources/test/fixtures/ruff/RUF100_3.py:14:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:14:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) | 14 | print(a) # noqa comment 15 | @@ -158,7 +158,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 16 15 | print() # noqa: E501, F821 17 16 | print() # noqa: E501, F821 # comment -./resources/test/fixtures/ruff/RUF100_3.py:15:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:15:1: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) | 15 | # noqa: E501, F821 16 | # noqa: E501, F821 # comment @@ -178,7 +178,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 17 17 | print() # noqa: E501, F821 # comment 18 18 | print() # noqa: E501, F821 # comment -./resources/test/fixtures/ruff/RUF100_3.py:16:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:16:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) | 16 | # noqa: E501, F821 17 | # noqa: E501, F821 # comment @@ -199,7 +199,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 18 18 | print() # noqa: E501, F821 # comment 19 19 | print() # noqa: E501, F821 comment -./resources/test/fixtures/ruff/RUF100_3.py:17:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:17:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) | 17 | # noqa: E501, F821 # comment 18 | print() # noqa: E501, F821 @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 19 19 | print() # noqa: E501, F821 comment 20 20 | print() # noqa: E501, F821 comment -./resources/test/fixtures/ruff/RUF100_3.py:18:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:18:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) | 18 | print() # noqa: E501, F821 19 | print() # noqa: E501, F821 # comment @@ -241,7 +241,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 20 20 | print() # noqa: E501, F821 comment 21 21 | print(a) # noqa: E501, F821 -./resources/test/fixtures/ruff/RUF100_3.py:19:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:19:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) | 19 | print() # noqa: E501, F821 # comment 20 | print() # noqa: E501, F821 # comment @@ -262,7 +262,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 21 21 | print(a) # noqa: E501, F821 22 22 | print(a) # noqa: E501, F821 # comment -./resources/test/fixtures/ruff/RUF100_3.py:20:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) +RUF100_3.py:20:10: RUF100 [*] Unused `noqa` directive (unused: `E501`, `F821`) | 20 | print() # noqa: E501, F821 # comment 21 | print() # noqa: E501, F821 comment @@ -283,7 +283,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 22 22 | print(a) # noqa: E501, F821 # comment 23 23 | print(a) # noqa: E501, F821 # comment -./resources/test/fixtures/ruff/RUF100_3.py:21:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:21:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 21 | print() # noqa: E501, F821 comment 22 | print() # noqa: E501, F821 comment @@ -304,7 +304,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 23 23 | print(a) # noqa: E501, F821 # comment 24 24 | print(a) # noqa: E501, F821 comment -./resources/test/fixtures/ruff/RUF100_3.py:22:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:22:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 22 | print() # noqa: E501, F821 comment 23 | print(a) # noqa: E501, F821 @@ -325,7 +325,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 24 24 | print(a) # noqa: E501, F821 comment 25 25 | print(a) # noqa: E501, F821 comment -./resources/test/fixtures/ruff/RUF100_3.py:23:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:23:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 23 | print(a) # noqa: E501, F821 24 | print(a) # noqa: E501, F821 # comment @@ -345,7 +345,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 24 24 | print(a) # noqa: E501, F821 comment 25 25 | print(a) # noqa: E501, F821 comment -./resources/test/fixtures/ruff/RUF100_3.py:24:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:24:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 24 | print(a) # noqa: E501, F821 # comment 25 | print(a) # noqa: E501, F821 # comment @@ -363,7 +363,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 24 |+print(a) # noqa: F821 comment 25 25 | print(a) # noqa: E501, F821 comment -./resources/test/fixtures/ruff/RUF100_3.py:25:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) +RUF100_3.py:25:11: RUF100 [*] Unused `noqa` directive (unused: `E501`) | 25 | print(a) # noqa: E501, F821 # comment 26 | print(a) # noqa: E501, F821 comment diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap index b50844f477..76bccec042 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_pairwise_over_zipped.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/RUF007.py:16:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:16:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 16 | # Errors 17 | zip(input, input[1:]) @@ -10,7 +10,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 19 | zip(input[:-1], input[1:]) | -./resources/test/fixtures/ruff/RUF007.py:17:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:17:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 17 | # Errors 18 | zip(input, input[1:]) @@ -20,7 +20,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 21 | zip(input[1:], input[2:]) | -./resources/test/fixtures/ruff/RUF007.py:18:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:18:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 18 | zip(input, input[1:]) 19 | zip(input, input[1::1]) @@ -30,7 +30,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 22 | zip(input[1:-1], input[2:]) | -./resources/test/fixtures/ruff/RUF007.py:19:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:19:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 19 | zip(input, input[1::1]) 20 | zip(input[:-1], input[1:]) @@ -40,7 +40,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 23 | list(zip(input, input[1:])) | -./resources/test/fixtures/ruff/RUF007.py:20:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:20:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 20 | zip(input[:-1], input[1:]) 21 | zip(input[1:], input[2:]) @@ -50,7 +50,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 24 | list(zip(input[:-1], input[1:])) | -./resources/test/fixtures/ruff/RUF007.py:21:6: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:21:6: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 21 | zip(input[1:], input[2:]) 22 | zip(input[1:-1], input[2:]) @@ -60,7 +60,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 25 | zip(foo[:-1], foo[1:], strict=True) | -./resources/test/fixtures/ruff/RUF007.py:22:6: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:22:6: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 22 | zip(input[1:-1], input[2:]) 23 | list(zip(input, input[1:])) @@ -70,7 +70,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 26 | zip(foo[:-1], foo[1:], strict=False) | -./resources/test/fixtures/ruff/RUF007.py:23:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:23:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 23 | list(zip(input, input[1:])) 24 | list(zip(input[:-1], input[1:])) @@ -80,7 +80,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 27 | zip(foo[:-1], foo[1:], strict=bool(foo)) | -./resources/test/fixtures/ruff/RUF007.py:24:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:24:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 24 | list(zip(input[:-1], input[1:])) 25 | zip(foo[:-1], foo[1:], strict=True) @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/ruff/mod.rs 27 | zip(foo[:-1], foo[1:], strict=bool(foo)) | -./resources/test/fixtures/ruff/RUF007.py:25:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs +RUF007.py:25:1: RUF007 Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs | 25 | zip(foo[:-1], foo[1:], strict=True) 26 | zip(foo[:-1], foo[1:], strict=False) diff --git a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap index fca0264c27..7af2a3f0a0 100644 --- a/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap +++ b/crates/ruff/src/rules/ruff/snapshots/ruff__rules__ruff__tests__ruff_targeted_noqa.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/ruff/mod.rs --- -./resources/test/fixtures/ruff/ruff_targeted_noqa.py:8:5: F841 [*] Local variable `x` is assigned to but never used +ruff_targeted_noqa.py:8:5: F841 [*] Local variable `x` is assigned to but never used | 8 | def f(): 9 | x = 1 diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap index a3ab8ba346..b02e9153f6 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__error-instead-of-exception_TRY400.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY400.py:15:9: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:15:9: TRY400 Use `logging.exception` instead of `logging.error` | 15 | a = 1 16 | except Exception: @@ -11,14 +11,14 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 19 | if True: | -./resources/test/fixtures/tryceratops/TRY400.py:18:13: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:18:13: TRY400 Use `logging.exception` instead of `logging.error` | 18 | if True: 19 | logging.error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY400 | -./resources/test/fixtures/tryceratops/TRY400.py:25:9: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:25:9: TRY400 Use `logging.exception` instead of `logging.error` | 25 | a = 1 26 | except Exception: @@ -28,14 +28,14 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 29 | if True: | -./resources/test/fixtures/tryceratops/TRY400.py:28:13: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:28:13: TRY400 Use `logging.exception` instead of `logging.error` | 28 | if True: 29 | logger.error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY400 | -./resources/test/fixtures/tryceratops/TRY400.py:35:9: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:35:9: TRY400 Use `logging.exception` instead of `logging.error` | 35 | a = 1 36 | except Exception: @@ -45,14 +45,14 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 39 | if True: | -./resources/test/fixtures/tryceratops/TRY400.py:38:13: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:38:13: TRY400 Use `logging.exception` instead of `logging.error` | 38 | if True: 39 | log.error("Context message here") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY400 | -./resources/test/fixtures/tryceratops/TRY400.py:45:9: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:45:9: TRY400 Use `logging.exception` instead of `logging.error` | 45 | a = 1 46 | except Exception: @@ -62,7 +62,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 49 | if True: | -./resources/test/fixtures/tryceratops/TRY400.py:48:13: TRY400 Use `logging.exception` instead of `logging.error` +TRY400.py:48:13: TRY400 Use `logging.exception` instead of `logging.error` | 48 | if True: 49 | self.logger.error("Context message here") diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap index a341fd3078..02dcdd3b99 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-args_TRY003.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY003.py:8:15: TRY003 Avoid specifying long messages outside the exception class +TRY003.py:8:15: TRY003 Avoid specifying long messages outside the exception class | 8 | a = 1 9 | if a == 1: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 12 | raise CustomException("Short") # This is acceptable | -./resources/test/fixtures/tryceratops/TRY003.py:34:15: TRY003 Avoid specifying long messages outside the exception class +TRY003.py:34:15: TRY003 Avoid specifying long messages outside the exception class | 34 | def bad(a): 35 | if a % 2 == 0: @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY003 | -./resources/test/fixtures/tryceratops/TRY003.py:39:15: TRY003 Avoid specifying long messages outside the exception class +TRY003.py:39:15: TRY003 Avoid specifying long messages outside the exception class | 39 | def another_bad(a): 40 | if a % 2 == 0: @@ -27,7 +27,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY003 | -./resources/test/fixtures/tryceratops/TRY003.py:44:15: TRY003 Avoid specifying long messages outside the exception class +TRY003.py:44:15: TRY003 Avoid specifying long messages outside the exception class | 44 | def and_another_bad(a): 45 | if a % 2 == 0: diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap index 8ed71a323a..a7580018d2 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-vanilla-class_TRY002.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY002.py:13:15: TRY002 Create your own exception +TRY002.py:13:15: TRY002 Create your own exception | 13 | a = 1 14 | if a == 1: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 17 | b = 1 | -./resources/test/fixtures/tryceratops/TRY002.py:17:15: TRY002 Create your own exception +TRY002.py:17:15: TRY002 Create your own exception | 17 | b = 1 18 | if b == 1: diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap index c33b92db6c..a0197f6526 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__raise-within-try_TRY301.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY301.py:9:13: TRY301 Abstract `raise` to an inner function +TRY301.py:9:13: TRY301 Abstract `raise` to an inner function | 9 | a = process() 10 | if not a: @@ -11,7 +11,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 13 | raise MyException(a) | -./resources/test/fixtures/tryceratops/TRY301.py:11:9: TRY301 Abstract `raise` to an inner function +TRY301.py:11:9: TRY301 Abstract `raise` to an inner function | 11 | raise MyException(a) 12 | @@ -21,7 +21,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 15 | try: | -./resources/test/fixtures/tryceratops/TRY301.py:16:17: TRY301 Abstract `raise` to an inner function +TRY301.py:16:17: TRY301 Abstract `raise` to an inner function | 16 | b = process() 17 | if not b: @@ -31,7 +31,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 20 | logger.exception("something failed") | -./resources/test/fixtures/tryceratops/TRY301.py:27:13: TRY301 Abstract `raise` to an inner function +TRY301.py:27:13: TRY301 Abstract `raise` to an inner function | 27 | a = process() 28 | if not a: @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 31 | raise MyException(a) | -./resources/test/fixtures/tryceratops/TRY301.py:29:9: TRY301 Abstract `raise` to an inner function +TRY301.py:29:9: TRY301 Abstract `raise` to an inner function | 29 | raise MyException(a) 30 | @@ -51,7 +51,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 33 | try: | -./resources/test/fixtures/tryceratops/TRY301.py:34:17: TRY301 Abstract `raise` to an inner function +TRY301.py:34:17: TRY301 Abstract `raise` to an inner function | 34 | b = process() 35 | if not b: diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap index 27b1db42a1..54454bd74d 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__reraise-no-cause_TRY200.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY200.py:15:9: TRY200 Use `raise from` to specify exception cause +TRY200.py:15:9: TRY200 Use `raise from` to specify exception cause | 15 | a = 1 16 | except Exception: @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^ TRY200 | -./resources/test/fixtures/tryceratops/TRY200.py:23:13: TRY200 Use `raise from` to specify exception cause +TRY200.py:23:13: TRY200 Use `raise from` to specify exception cause | 23 | except Exception: 24 | if True: diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap index c2ade05ef5..12459a7c7d 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__try-consider-else_TRY300.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY300.py:20:9: TRY300 Consider moving this statement to an `else` block +TRY300.py:20:9: TRY300 Consider moving this statement to an `else` block | 20 | a = 1 21 | b = process() diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap index 49bd2d9367..001792e97a 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__type-check-without-type-error_TRY004.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY004.py:12:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:12:9: TRY004 Prefer `TypeError` exception for invalid type | 12 | pass 13 | else: @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:19:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:19:9: TRY004 Prefer `TypeError` exception for invalid type | 19 | pass 20 | else: @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:30:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:30:9: TRY004 Prefer `TypeError` exception for invalid type | 30 | pass 31 | else: @@ -25,7 +25,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:37:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:37:9: TRY004 Prefer `TypeError` exception for invalid type | 37 | pass 38 | else: @@ -33,7 +33,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:44:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:44:9: TRY004 Prefer `TypeError` exception for invalid type | 44 | pass 45 | else: @@ -41,7 +41,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:51:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:51:9: TRY004 Prefer `TypeError` exception for invalid type | 51 | pass 52 | else: @@ -49,7 +49,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:58:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:58:9: TRY004 Prefer `TypeError` exception for invalid type | 58 | pass 59 | else: @@ -57,7 +57,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:65:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:65:9: TRY004 Prefer `TypeError` exception for invalid type | 65 | pass 66 | else: @@ -65,7 +65,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:72:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:72:9: TRY004 Prefer `TypeError` exception for invalid type | 72 | pass 73 | else: @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:79:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:79:9: TRY004 Prefer `TypeError` exception for invalid type | 79 | pass 80 | else: @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:86:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:86:9: TRY004 Prefer `TypeError` exception for invalid type | 86 | pass 87 | else: @@ -89,7 +89,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:95:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:95:9: TRY004 Prefer `TypeError` exception for invalid type | 95 | # should be typeerror 96 | # not multiline is on purpose for fix @@ -100,7 +100,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | |_________^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:104:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:104:9: TRY004 Prefer `TypeError` exception for invalid type | 104 | pass 105 | else: @@ -108,7 +108,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:111:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:111:9: TRY004 Prefer `TypeError` exception for invalid type | 111 | pass 112 | else: @@ -116,7 +116,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:118:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:118:9: TRY004 Prefer `TypeError` exception for invalid type | 118 | pass 119 | else: @@ -124,7 +124,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:125:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:125:9: TRY004 Prefer `TypeError` exception for invalid type | 125 | pass 126 | else: @@ -132,7 +132,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:132:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:132:9: TRY004 Prefer `TypeError` exception for invalid type | 132 | pass 133 | else: @@ -140,7 +140,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:139:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:139:9: TRY004 Prefer `TypeError` exception for invalid type | 139 | pass 140 | else: @@ -148,7 +148,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:146:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:146:9: TRY004 Prefer `TypeError` exception for invalid type | 146 | pass 147 | else: @@ -156,7 +156,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:153:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:153:9: TRY004 Prefer `TypeError` exception for invalid type | 153 | pass 154 | else: @@ -164,7 +164,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:160:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:160:9: TRY004 Prefer `TypeError` exception for invalid type | 160 | pass 161 | else: @@ -172,7 +172,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:167:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:167:9: TRY004 Prefer `TypeError` exception for invalid type | 167 | pass 168 | else: @@ -180,7 +180,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:174:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:174:9: TRY004 Prefer `TypeError` exception for invalid type | 174 | pass 175 | else: @@ -188,7 +188,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:181:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:181:9: TRY004 Prefer `TypeError` exception for invalid type | 181 | pass 182 | else: @@ -196,7 +196,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:188:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:188:9: TRY004 Prefer `TypeError` exception for invalid type | 188 | pass 189 | else: @@ -204,7 +204,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:195:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:195:9: TRY004 Prefer `TypeError` exception for invalid type | 195 | pass 196 | else: @@ -212,7 +212,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:202:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:202:9: TRY004 Prefer `TypeError` exception for invalid type | 202 | pass 203 | else: @@ -220,7 +220,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:209:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:209:9: TRY004 Prefer `TypeError` exception for invalid type | 209 | pass 210 | else: @@ -228,7 +228,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:216:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:216:9: TRY004 Prefer `TypeError` exception for invalid type | 216 | pass 217 | else: @@ -236,7 +236,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:223:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:223:9: TRY004 Prefer `TypeError` exception for invalid type | 223 | pass 224 | else: @@ -244,7 +244,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:230:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:230:9: TRY004 Prefer `TypeError` exception for invalid type | 230 | pass 231 | elif isinstance(arg2, int): @@ -252,7 +252,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:267:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:267:9: TRY004 Prefer `TypeError` exception for invalid type | 267 | def check_body(some_args): 268 | if isinstance(some_args, int): @@ -260,7 +260,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^^^^^^^^^^^^^^^^^^^^^^ TRY004 | -./resources/test/fixtures/tryceratops/TRY004.py:277:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:277:9: TRY004 Prefer `TypeError` exception for invalid type | 277 | def multiple_elifs(some_args): 278 | if not isinstance(some_args, int): @@ -270,7 +270,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 281 | raise ValueError("...") # this is ok | -./resources/test/fixtures/tryceratops/TRY004.py:288:9: TRY004 Prefer `TypeError` exception for invalid type +TRY004.py:288:9: TRY004 Prefer `TypeError` exception for invalid type | 288 | def multiple_ifs(some_args): 289 | if not isinstance(some_args, int): diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap index 0bb8c378b0..a079efb66b 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-log-message_TRY401.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY401.py:8:45: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:8:45: TRY401 Redundant exception object included in `logging.exception` call | 8 | finish() 9 | except Exception as ex: @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^ TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:19:53: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:19:53: TRY401 Redundant exception object included in `logging.exception` call | 19 | if True is False: 20 | for i in range(10): @@ -19,7 +19,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 23 | logger.exception(f"Found an error: {bad} {bad}") # TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:21:45: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:21:45: TRY401 Redundant exception object included in `logging.exception` call | 21 | logger.exception(f"Found an error: {bad} {good}") # TRY401 22 | except IndexError as bad: @@ -29,7 +29,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 25 | logger.exception(f"Found an error: {bad}") # TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:21:51: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:21:51: TRY401 Redundant exception object included in `logging.exception` call | 21 | logger.exception(f"Found an error: {bad} {good}") # TRY401 22 | except IndexError as bad: @@ -39,7 +39,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 25 | logger.exception(f"Found an error: {bad}") # TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:23:45: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:23:45: TRY401 Redundant exception object included in `logging.exception` call | 23 | logger.exception(f"Found an error: {bad} {bad}") # TRY401 24 | except Exception as bad: @@ -48,7 +48,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 26 | logger.exception(f"Found an error: {bad}") # TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:24:45: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:24:45: TRY401 Redundant exception object included in `logging.exception` call | 24 | except Exception as bad: 25 | logger.exception(f"Found an error: {bad}") # TRY401 @@ -58,14 +58,14 @@ source: crates/ruff/src/rules/tryceratops/mod.rs 28 | if True: | -./resources/test/fixtures/tryceratops/TRY401.py:27:49: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:27:49: TRY401 Redundant exception object included in `logging.exception` call | 27 | if True: 28 | logger.exception(f"Found an error: {bad}") # TRY401 | ^^^ TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:39:47: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:39:47: TRY401 Redundant exception object included in `logging.exception` call | 39 | ... 40 | except Exception as ex: @@ -73,7 +73,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^ TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:46:53: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:46:53: TRY401 Redundant exception object included in `logging.exception` call | 46 | ... 47 | except Exception as ex: @@ -81,7 +81,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^^ TRY401 | -./resources/test/fixtures/tryceratops/TRY401.py:53:47: TRY401 Redundant exception object included in `logging.exception` call +TRY401.py:53:47: TRY401 Redundant exception object included in `logging.exception` call | 53 | ... 54 | except Exception as ex: diff --git a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap index bc24947800..9a311fedc4 100644 --- a/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap +++ b/crates/ruff/src/rules/tryceratops/snapshots/ruff__rules__tryceratops__tests__verbose-raise_TRY201.py.snap @@ -1,7 +1,7 @@ --- source: crates/ruff/src/rules/tryceratops/mod.rs --- -./resources/test/fixtures/tryceratops/TRY201.py:20:15: TRY201 Use `raise` without specifying exception name +TRY201.py:20:15: TRY201 Use `raise` without specifying exception name | 20 | except MyException as e: 21 | logger.exception("process failed") @@ -9,7 +9,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^ TRY201 | -./resources/test/fixtures/tryceratops/TRY201.py:63:19: TRY201 Use `raise` without specifying exception name +TRY201.py:63:19: TRY201 Use `raise` without specifying exception name | 63 | logger.exception("process failed") 64 | if True: @@ -17,7 +17,7 @@ source: crates/ruff/src/rules/tryceratops/mod.rs | ^ TRY201 | -./resources/test/fixtures/tryceratops/TRY201.py:74:23: TRY201 Use `raise` without specifying exception name +TRY201.py:74:23: TRY201 Use `raise` without specifying exception name | 74 | def foo(): 75 | raise e diff --git a/crates/ruff/src/test.rs b/crates/ruff/src/test.rs index 967cb28933..7da48e00ae 100644 --- a/crates/ruff/src/test.rs +++ b/crates/ruff/src/test.rs @@ -99,7 +99,7 @@ pub fn test_path(path: impl AsRef, settings: &Settings) -> Result