-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy path.ruff.toml
More file actions
147 lines (126 loc) · 4.65 KB
/
.ruff.toml
File metadata and controls
147 lines (126 loc) · 4.65 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
line-length = 120
indent-width = 4
target-version = "py313"
[lint]
select = [
"A", # [https://pypi.org/project/flake8-builtins/]
"ARG", # [https://pypi.org/project/flake8-unused-arguments/]
"ASYNC", # [https://pypi.org/project/flake8-async/]
"B", # [https://pypi.org/project/flake8-bugbear/]
"C4", # [https://pypi.org/project/flake8-comprehensions/]
"C90", # [https://pypi.org/project/mccabe/] (complexity)
"DTZ", # [https://pypi.org/project/flake8-datetimez/]
"E", # [https://pypi.org/project/pycodestyle/] errors
"EM", # [https://pypi.org/project/flake8-errmsg/]
"ERA", # [https://pypi.org/project/eradicate/]
"F", # [https://pypi.org/project/pyflakes/]
"FBT", # [https://pypi.org/project/flake8-boolean-trap/]
"FIX", # [https://github.com/tommilligan/flake8-fixme]
"G", # [https://pypi.org/project/flake8-logging-format/0.9.0/]
"I", # [https://pypi.org/project/isort/]
"ICN", # [https://github.com/joaopalmeiro/flake8-import-conventions]
"ISC", # [https://pypi.org/project/flake8-implicit-str-concat/]
"N", # [https://pypi.org/project/pep8-naming/]
"NPY", # NumPy-specific rules
"PERF", # [https://pypi.org/project/perflint/]
"PIE", # [https://pypi.org/project/flake8-pie/]
"PL", # [https://pypi.org/project/pylint/]
"PT", # [https://pypi.org/project/flake8-pytest-style/]
"PTH", # [https://pypi.org/project/flake8-use-pathlib/]
"PYI", # [https://pypi.org/project/flake8-pyi/]
"RET", # [https://pypi.org/project/flake8-return/]
"RSE", # [https://pypi.org/project/flake8-raise/]
"RUF", # RUFF-specific rules
"S", # [https://pypi.org/project/flake8-bandit/] (Automated security testing)
"SIM", # [https://pypi.org/project/flake8-simplify/]
"SLF", # [https://pypi.org/project/flake8-self/]
"SLOT", # [https://pypi.org/project/flake8-slots/]
"T10", # https://pypi.org/project/flake8-debugger/
"T20", # [https://pypi.org/project/flake8-print/]
"TID", # [https://pypi.org/project/flake8-tidy-imports/]
"TRY", # [https://pypi.org/project/tryceratops/1.1.0/] (exception anti-patterns)
"UP", # [https://pypi.org/project/pyupgrade/]
"W", # [https://pypi.org/project/pycodestyle/] warnings
"YTT", # [https://pypi.org/project/flake8-2020/]
]
ignore = [
"S101", # use of `assert` detected hanbled by pylance, does not support noseq
"TID252", # [*] Relative imports from parent modules are banned
"TRY300", # Checks for return statements in try blocks. SEE https://beta.ruff.rs/docs/rules/try-consider-else/
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
task-tags = ["TODO", "FIXME", "XXX", "BUG", "HACK", "NOTE"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[lint.per-file-ignores]
"**/{tests,pytest_simcore}/**" = [
"T201", # print found
"ARG001", # unused function argument
"PT019", # user pytest.mark.usefixture
"PLR2004", # use of magic values
"PLR0913", # too many arguments
"N806", # Uppercase variables in functions
"PT001", # use pytest.fixture over pytest.fixture() whatsoever
"ERA001", # found commented out code
"FBT001", # Boolean positional arg in function definition
]
[lint.flake8-pytest-style]
fixture-parentheses = false
parametrize-names-type = "csv"
[format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[lint.pycodestyle]
ignore-overlong-task-comments = true
[lint.pylint]
# Maximum number of arguments for function / method.
max-args = 10
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr = 5
# Maximum number of branch for function / method body.
max-branches = 13
# Maximum number of locals for function / method body.
max-locals = 15
# Maximum number of public methods for a class (see R0904).
max-public-methods = 20
# Maximum number of return / yield for function / method body.
max-returns = 6
# Maximum number of statements in function / method body.
max-statements = 50