mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 05:51:03 -05:00
Improve exclusion syntax to match exact files (#209)
This commit is contained in:
27
test/F823.py
Normal file
27
test/F823.py
Normal file
@@ -0,0 +1,27 @@
|
||||
my_dict = {}
|
||||
my_var = 0
|
||||
|
||||
|
||||
def foo():
|
||||
my_var += 1
|
||||
|
||||
|
||||
def bar():
|
||||
global my_var
|
||||
my_var += 1
|
||||
|
||||
|
||||
def baz():
|
||||
global my_var
|
||||
global my_dict
|
||||
my_dict[my_var] += 1
|
||||
|
||||
|
||||
def dec(x):
|
||||
return x
|
||||
|
||||
|
||||
@dec
|
||||
def f():
|
||||
dec = 1
|
||||
return dec
|
||||
9
test/directory/F706.py
Normal file
9
test/directory/F706.py
Normal file
@@ -0,0 +1,9 @@
|
||||
def f() -> int:
|
||||
return 1
|
||||
|
||||
|
||||
class Foo:
|
||||
return 2
|
||||
|
||||
|
||||
return 3
|
||||
9
test/directory/F707.py
Normal file
9
test/directory/F707.py
Normal file
@@ -0,0 +1,9 @@
|
||||
def f() -> int:
|
||||
return 1
|
||||
|
||||
|
||||
class Foo:
|
||||
return 2
|
||||
|
||||
|
||||
return 3
|
||||
9
test/ignore.py
Normal file
9
test/ignore.py
Normal file
@@ -0,0 +1,9 @@
|
||||
def f() -> int:
|
||||
return 1
|
||||
|
||||
|
||||
class Foo:
|
||||
return 2
|
||||
|
||||
|
||||
return 3
|
||||
3
test/pyproject.toml
Normal file
3
test/pyproject.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
extend-exclude = ["./directory/*"]
|
||||
Reference in New Issue
Block a user