forked from gpustack/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
148 lines (138 loc) · 6.99 KB
/
ruff.toml
File metadata and controls
148 lines (138 loc) · 6.99 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
148
# Borrowed from https://github.com/CoreyMSchafer/dotfiles/blob/master/settings/ruff.toml.
exclude = [
".git",
".git-rewrite",
".hg",
"__pycache__",
"build",
"_build",
"dist",
".venv",
"venv",
".mypy_cache",
".pytest_cache",
".eggs",
"*.egg",
"*.egg-info",
".tox",
".nox",
".ruff_cache",
]
[lint]
# (These are all the default groups, even if you don’t currently select them)
# select = [
# "F", # Pyflakes – detects syntax errors and basic mistakes.
# "E4", # Pycodestyle errors (part of E group).
# "E7", # Pycodestyle E7xx errors (naming, etc.).
# "E9", # Pycodestyle E9xx errors (syntax).
# ]
extend-select = [
"E", # Pycodestyle errors (style issues).
"W", # Pycodestyle warnings (style issues).
"C90", # McCabe – complexity metric for functions.
"I", # isort – import ordering checks.
"N", # PEP8 Naming – naming conventions.
"D", # Pydocstyle – docstring formatting.
"UP", # Pyupgrade – upgrades syntax to newer Python versions.
"YTT", # Flake8-2020 – checks for Python 2020 best practices.
# "ANN", # Flake8-annotations – enforces type annotation style.
"ASYNC", # Flake8-async – checks async/await usage.
"S", # Flake8-bandit – security issues.
"BLE", # Flake8-blind-except – flags bare excepts.
# "FBT", # Flake8-boolean-trap – potential pitfalls with booleans.
"B", # Flake8-bugbear – common bug patterns.
"A", # Flake8-builtins – misuse of Python built-in names.
"COM", # Flake8-commas – trailing/comma issues.
# "CPY", # Flake8-copyright – copyright header checks.
"C4", # Flake8-comprehensions – best practices in comprehensions.
"DTZ", # Flake8-datetimez – requires timezone-aware datetime objects.
"T10", # Flake8-debugger – debugger statements (e.g. pdb).
"DJ", # Flake8-django – Django-specific conventions.
"EM", # Flake8-errmsg – error message style.
"EXE", # Flake8-executable – executable file checks.
"FA", # Flake8-future-annotations – future import for annotations.
"ISC", # Flake8-implicit-str-concat – warns on implicit string concatenation.
"ICN", # Flake8-import-conventions – enforces conventional import aliases.
"LOG", # Flake8-logging – proper logging usage.
"G", # Flake8-logging-format – logging format string issues.
"INP", # Flake8-no-pep420 – warns against non-PEP420 namespace usage.
"PIE", # Flake8-pie – Python improvement suggestions.
# "T20", # Flake8-print – disallows print statements.
"PYI", # Flake8-pyi – checks for type stub (.pyi) consistency.
"PT", # Flake8-pytest-style – pytest best practices.
"Q", # Flake8-quotes – enforces quote style consistency.
"RSE", # Flake8-raise – proper raise statement usage.
"RET", # Flake8-return – return statement issues.
"SLF", # Flake8-self – flags instance methods that don't use self.
"SLOT", # Flake8-slots – suggests use of __slots__ where appropriate.
"SIM", # Flake8-simplify – code simplification hints.
"TID", # Flake8-tidy-imports – enforces specific import styles (e.g., no relative imports).
"TC", # Flake8-type-checking – proper import of typing in type checks.
"INT", # Flake8-gettext – checks for proper internationalization usage.
"ARG", # Flake8-unused-arguments – flags unused function arguments.
"PTH", # Flake8-use-pathlib – encourages pathlib over os.path.
"TD", # Flake8-todos – flags TODO comments.
"FIX", # Flake8-fixme – flags FIXME comments.
# "ERA", # Eradicate – detects commented-out code (potentially dangerous).
"PD", # Pandas-vet – checks pandas-specific code practices.
"PGH", # Pygrep-hooks – custom grep hooks for linting.
"PL", # Pylint – integration with Pylint conventions.
"TRY", # Tryceratops – try/except usage suggestions.
"FLY", # Flynt – f-string conversion suggestions.
"NPY", # NumPy-specific rules – ensures NumPy coding standards.
"FAST", # FastAPI – FastAPI-specific linting rules.
"AIR", # Airflow – Airflow-specific linting rules.
"PERF", # Perflint – performance-related checks.
"FURB", # Refurb – rules for code refurbishment.
# "DOC", # Pydoclint – docstring linting and consistency.
"RUF", # Ruff-specific rules – additional Ruff checks.
]
ignore = [
"BLE001", # Flake8-blind-except - Blind except: consider specifying exception instead of using a bare except.
"E501", # Pycodestyle - line too long.
"D1", # Pydocstyle - missing docstring in public module, class, or function.
"D200", # Pydocstyle - one blank line required before summary line.
"D205", # Pydocstyle - one blank line required between summary line and description.
"D203", # Pydocstyle - one blank line required before class docstring.
"D212", # Pydocstyle - summary line should be immediately after the opening quotes.
"D401", # Pydocstyle - Checks for docstring first lines that are not in an imperative mood.
"G004", # Flake8-logging-format - logging format string does not use lazy % formatting.
"INP001", # Flake8-no-pep420 - Checks for packages that are missing an __init__.py file.
"S311", # Flake8-bandit - Standard pseudo-random generators are not suitable for security/cryptographic purposes.
"TD003", # Flake8-todos - Checks that a TODO comment is associated with a link to a relevant issue or ticket.
"FIX002", # Flake8-fixme - Checks for "TODO" comments.
"TRY003", # Tryceratops - Checks for long exception messages that are not defined in the exception class itself.
"TID252", # Flake8-tidy-imports - Checks for relative imports.
"PERF401", # Perflint - Checks for loops that can be replaced by a list comprehension.
"RET504", # Flake8-return - Checks for variable assignments that immediately precede a return of the assigned variable.
"PLW0602", # Pylint - Checks for global variables that are not assigned a value in the current scope.
"PLW0603", # Pylint - Checks for the use of global statements to update identifiers.
]
[lint.flake8-pytest-style]
parametrize-names-type = "csv"
[lint.per-file-ignores]
"gpustack_runtime/deployer/__patches__.py" = ["ALL"]
"gpustack_runtime/detector/pyacl/*.py" = ["ALL"]
"gpustack_runtime/detector/pyamdsmi/*.py" = ["ALL"]
"gpustack_runtime/detector/pyamdgpu/*.py" = ["ALL"]
"gpustack_runtime/detector/pycuda/*.py" = ["ALL"]
"gpustack_runtime/detector/pydcmi/*.py" = ["ALL"]
"gpustack_runtime/detector/pyhsa/*.py" = ["ALL"]
"gpustack_runtime/detector/pyixml/*.py" = ["ALL"]
"gpustack_runtime/detector/pymtml/*.py" = ["ALL"]
"gpustack_runtime/detector/pymxsml/*.py" = ["ALL"]
"gpustack_runtime/detector/pyrocmcore/*.py" = ["ALL"]
"gpustack_runtime/detector/pyrocmsmi/*.py" = ["ALL"]
"tests/*.py" = ["D", "S101"]
[lint.mccabe]
max-complexity = 50
[lint.pylint]
max-branches = 60
max-statements = 150
max-returns = 20
max-args = 20
allow-magic-value-types = ["str", "bytes", "int"]
[format]
indent-style = "space"
docstring-code-format = true
quote-style = "double"