-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathpyproject.toml
109 lines (101 loc) · 3.38 KB
/
pyproject.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Black section
[tool.black]
line-length = 100 # Must be same as tool.ruff.line-length
target-version = ['py310']
[tool.coverage.run]
omit = ['*tests*']
[tool.coverage.report]
ignore_errors = true
[tool.coverage.html]
directory = "build/coverage"
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [".git", "build", "dist", "var", "share", "collections"]
line-length = 100 # Must be same as tool.black.line-length
# Assume Python 3.10
target-version = "py310"
# Enable
lint.select = [
# "E", # Pycodestyle Error
"F", # Pyflakes
"W", # Pycodestyle Warning
# "C90", # mccabe
# "I", # isort
# "D", # Pydocstyle
# "YTT", # flake8-2020
# "ANN", # flake8-annotations
# "S", # flake8-bandit
# "BLE", # flake8-blind-except
# "B", # flake8-bugbear
"A", # flake8-builtins
# "C4", # flake8-comprehensions
# "EM", # flake8-errmsg
# "ISC", # flake8-implicit-str-concat
# "ICN", # flake8-import-conventions
# "PT", # flake8-pytest-style
# "RET", # flake8-return
# "SIM", # flake8-simplify
"PLC", # pylint
"PLE", # pylint
"PLR", # pylint
# "PLW", # pylint
# "PIE", # flake8-pie
# "RUF", # ruff specific
]
# Always autofix, but never try to fix `F401` (unused imports).
fix = false #fix = true
lint.ignore = [
"A001", # A001 Variable `{name}` is shadowing a python builtin
"A002", # A002 Argument `{name}` is shadowing a python builtin
"A003", # Class attribute `{name}` is shadowing a python builtin"
"D203",
"D212",
"D107",
"PLR0912", # Too many branches
"PLR0911", # Too many return statements
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR2004", # Magic value used in comparison, consider replacing {v} with a constant variable
"PLR2044", # Line with empty comment
"PLR5501", # Use `elif` instead of `else` then `if`, to reduce indentation
"PLR1714", # Consider merging multiple comparisons: `f1 not in (f0, f2)`. Use a `set` if the elements are hashable.
"PLR1730", # Replace `if` statement with `width = max(width, max_column_data_length[c])`
"PLR1704", # Redefining argument with the local name `name`
"PLR1711", # Useless `return` statement at end of function
"F811", # Redefinition of unused `ReportBand` from line 66
]
lint.unfixable = [
"F401",
"F841", # unused-variable
]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
max-complexity = 12
[tool.ruff.lint.per-file-ignores]
"*/migrations/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
]
"cmibs/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
]
"tests/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"S101", # Use of assert detected
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"PT011", # {exc} is to broad
]