-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruff.toml
90 lines (80 loc) · 2.66 KB
/
ruff.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
target-version = "py38"
# rules to include
lint.select = ["E", "F"]
lint.extend-select = [
"A", # builtins
"ANN", # annotations
"B", # bugbear
"C", # mccabe (complexity)
"C4", # comprehensions
"D", # docstrings
"I", # isort (import order)
"ICN", # import conventions
"PT", # pytest style
"PTH", # pathlib
"RET", # return statements
"RUF100", # flag unused noqa
"T10", # debugger
"UP", # upgrades
]
# rules to ignore
lint.ignore = [
"ANN401", # use of the 'Any' type
"B027", # empty method not marked with abstractmethod
"B905", # zip without explicit 'strict' parameter
"C901", # function is too complex
"D100", # module-level docstring
"D105", # magic method docstring
"D203", # blank line before class docstring
# "D204", # blank line after class docstring
"D205", # blank line between summary and description
"D208", # extra indentation in docstring
"D209", # newline before closing quotes
"D213", # multiline docstring at second line
"D400", # first line ending with period
"D401", # docstrings in imperative mood
"D404", # first word of docstring is "this"
"D406",
"D407",
"D413", # blank line after last section
"D415", # first line ending with punctuation
"E501", # line length
"E731", # assign lambda expression
"PT001", # use of pytest.fixture (with no parens)
"PT013", # use simple import of pytest
"PTH123", # Path.open instead of regular open
"RET501", # return None
"UP006", # deprecated collection types in annotations
"UP007", # | instead of Union
"UP035" # import replacements (collections.abc)
]
# ignore = ["B019", "E203", "E251", "E301", "E302", "E305", "E306", "E501", "E722", "E731", "E741", "W292", "W391"]
# paths to exclude
lint.exclude = [
".venv",
"tmp*",
"scripts/*",
]
line-length = 10000
[lint.per-file-ignores]
"__init__.py" = ["D104", "F401"]
"fancy_dataclass/json.py" = ["A005"]
"fancy_dataclass/subprocess.py" = ["A005"]
"tests/*" = ["ANN", "D"]
[lint.flake8-pytest-style]
parametrize-names-type = "list"
[lint.isort]
# don't separate straight-style and 'from' imports for the same module
force-sort-within-sections = true
# force imports to the top of their section
force-to-top = ["package.utils"]
# patterns to separate into auxiliary blocks, in the order specified
# forced-separate = ["tests"]
# modules to consider first-party
# known-first-party = []
# number of lines after each import block?
lines-after-imports = 2
# whether to order imports by type, rather than strictly alphabetically
order-by-type = true
[lint.pydocstyle]
convention = "google"