-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathruff.toml
More file actions
134 lines (123 loc) · 3.88 KB
/
ruff.toml
File metadata and controls
134 lines (123 loc) · 3.88 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
preview = true
target-version = "py310"
exclude = [
"apps",
"scripts",
"tasks.py",
"docs",
"demos",
]
lint.select = [
"ALL",
]
lint.extend-ignore = [
# Never
"PD", # We're not using Pandas
# Later (or never)
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"BLE", # flake8-blind-except
"CPY", # Copyright
"D", # pydocstyle
"DOC", # pydocstyle
"ERA", # eradicate
"FIX", # flake8-fixme
"PTH", # flake8-use-pathlib
"S", # flake8-bandit
"T20", # flake8-print
"TD", # flake8-todos
"FBT",
# False positive, don't remove
"A004", # ... is shadowing a Python standard library module
"A005", # ... is shadowing a Python builtin module
"COM812", # Missing trailing comma
"FURB113", # repeated-append
"INP001", # implicit-namespace-package
"ISC001", # (The following rules may cause conflicts when used with the formatter)
"PGH003", # Use specific rule codes when ignoring type issues
"PLC0414", # Import alias does not rename original package
"PLC1901", # An empty string is falsey; consider using `not s` if this is intended
"PLR2004", # Magic number
"PLR6301", # Method could be a function
"PLR0904", # too-many-public-methods
"PLW1514", # `pathlib.Path(...).write_text` without explicit `encoding` argument
"RET504", # Unnecessary assignment before `return` statement
"S101", # Use of `assert` detected
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM108", # Use ternary operator
"TRY300", # Consider moving this statement to an `else` block
"PERF401", # 7 - PERF401 manual-list-comprehension
"RUF067", # `__init__` module should only contain docstrings and re-exports
"RUF070", # ...
"E501", # [ ] line-too-long
#
# Fix this (later)
#
"PLR0913", # [ ] too-many-arguments
"PLR0917", # [ ] too-many-positional-arguments
"F841", # [ ] unused-variable
"PERF203", # [ ] try-except-in-loop
"TRY301", # [ ] raise-within-try
"PLW0603", # [ ] global-statement
"PLR0911", # [ ] too-many-return-statements
"PLR0914", # [ ] too-many-locals
"PLW2901", # [ ] redefined-loop-name
"SIM117", # [ ] multiple-with-statements
"RUF001", # [ ] ambiguous-unicode-character-string
"A002",
]
[lint.mccabe]
# TODO: Set max-complexity = 10
max-complexity = 11
[lint.isort]
combine-as-imports = true
required-imports = ["from __future__ import annotations"]
known-first-party = ["hop3"]
[lint.per-file-ignores]
"**/src/**/*.py" = [
"PT", # Pytest warnings in source code are probably false positives
]
"packages/hop3-server/src/hop3/orm/**/*.py" = [
"TC",
]
"packages/hop3-server/src/hop3/server/cli/**/*.py" = [
"T20", # flake8-print
]
"packages/hop3-testing/**/*.py" = [
"FBT",
"T20", # flake8-print
]
"packages/hop3-tui/**/*.py" = [
"FBT",
"T20", # flake8-print
]
"packages/hop3-installer/src/**/*.py" = [
# Real imports are needed by the bundler
"TC001",
"RUF005", # collection-literal-concatenation
"DTZ005", # call-datetime-now-without-tzinfo
"TRY003", # raise-vanilla-args
]
"packages/hop3-installer/src/hop3_installer/cli_installer/*.py" = [
# Real imports are needed by the bundler
"TC001"
]
"packages/hop3-installer/src/hop3_installer/server_installer/*.py" = [
# Real imports are needed by the bundler
"TC001"
]
"**/tests/**/*.py" = [
"SLF001", # private-member-access
"RUF069", # float-equality-comparison
"PT011", # pytest-raises-too-broad
"N806", # non-lowercase-variable-in-function
"PT012", # pytest-raises-with-multiple-statements
"PLR0915", # too-many-statements
"B904", # raise-without-from-inside-except
"PLC2701", # import-private-name
"C901", # complex-structure
"PLR0912", # too-many-branches
]
"**/noxfile.py" = [
"INP001", # implicit namespace package
]