-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
190 lines (173 loc) · 6.21 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
[project]
name = "zaimcsvconverter"
version = "0.1.0"
requires-python = ">=3.9"
[tool.setuptools.packages.find]
include = ["zaimcsvconverter", "zaimcsvconverter.*"]
[tool.bandit.assert_used]
skips = [
"*_test.py",
"*/test_*.py",
]
# see: https://black.readthedocs.io/en/stable/pyproject_toml.html#configuration-format
[tool.black]
line-length = 119
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
# Assume `if TYPE_CHECKING: ... else: ...` block is covered · Issue #831 · nedbat/coveragepy
# https://github.com/nedbat/coveragepy/issues/831#issuecomment-517778185
"if TYPE_CHECKING:",
# Pylint will detect instead:
# - abstract-method / W0223 - Pylint 2.17.0-dev0 documentation
# https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/abstract-method.html
"raise NotImplementedError",
]
[tool.coverage.run]
source = ["zaimcsvconverter"]
[tool.docformatter]
recursive = true
wrap-descriptions = 119
wrap-summaries = 119
[tool.isort]
# see:
# - Using Black with other tools - Black 23.1.0 documentation
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#custom-configuration
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 119
# For compatibility with PyLint and Hacking, Google also supports,
# Black doesn't have any opinions
# see:
# - https://pycqa.github.io/isort/docs/configuration/profiles.html
# - https://qiita.com/kaityo256/items/5b0b55d105ef2366cb0c
# - https://www.xn--ebkc7kqd.com/entry/hacking-isort
force_sort_within_sections = true
lexicographical = true
# Google supports, Black doesn't have any opinions
# see: https://pycqa.github.io/isort/docs/configuration/profiles.html
order_by_type = false
[tool.mypy]
strict = true
plugins = [
"pydantic.mypy",
"returns.contrib.mypy.returns_plugin",
"sqlalchemy.ext.mypy.plugin"
]
[[tool.mypy.overrides]]
module = [
"factory",
"inflector"
]
ignore_missing_imports = true
[tool.pydocstyle]
# To add Google convention
# see:
# - Error Codes — pydocstyle 6.1.1 documentation
# http://www.pydocstyle.org/en/stable/error_codes.html#default-conventions
add_select = ["D212", "D214", "D410", "D411", "D415", "D416", "D417"]
# D400: First line may ends with ":" for expression.
# D402: First line may ends with function signature for expression.
# D415: First line may ends with ":" for expression.
# D101: Docstring may be missed in public class since docstring-min-length is set.
# D102: Docstring may be missed in public method since docstring-min-length is set.
# D103: Docstring may be missed in public function since docstring-min-length is set.
# D105: Docstring may be missed in magic method since docstring-min-length is set.
# D105: Docstring may be missed in public nested class since docstring-min-length is set.
# D107: Docstring may be missed in __init__ method since docstring-min-length is set.
add_ignore = ["D400", "D401", "D402", "D415", "D101", "D102", "D103", "D105", "D106", "D107"]
[tool.pylint.basic]
docstring-min-length = "7"
[tool.pylint.format]
max-line-length = 119
[tool.pylint.options]
# Since this rule against single responsibility principle.
# @see https://stackoverflow.com/questions/28722314/why-does-pylint-want-2-public-methods-per-class/40258006#40258006
min-public-methods = "1"
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "DEBUG"
log_format = "%(asctime)s %(process)d %(levelname)s %(name)s:%(filename)s:%(lineno)d %(message)s"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
[tool.ruff]
line-length = 119
[tool.ruff.lint]
select = [
"F", # Pyflakes
"E", # pycodestyle
"W", # pycodestyle
"C90", # mccabe
# "I", # isort
"N", # pep8-naming
# "D", # pydocstyle
"UP", # pyupgrade
"YTT", # flake8-2020
"ANN", # flake8-annotations
"S", # flake8-bandit
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"DJ", # flake8-django
"EM", # flake8-errmsg
"EXE", # flake8-executable
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # eradicate
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PL", # Pylint
"TRY", # tryceratops
"NPY", # NumPy-specific rules
"RUF", # Ruff-specific rules
]
ignore = [
"UP032", # [*] Use f-string instead of `format` call
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed, These warnings are disabled by default
# Python 3.9 incompatible
"UP007", # Use X | Y for type annotations
]
fixable = [
"COM812", # Trailing comma missing
"EM102", # Exception must not use an f-string literal, assign to variable first
"PT001", # Use `@pytest.fixture()` over `@pytest.fixture`
"PT006", # Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`
"UP006", # Use {} instead of {} for type annotations
"UP015", # Unnecessary open mode parameters
"UP037", # Remove quotes from type annotation
]
unfixable = [
# When fix `return a and b != ""` as `return a and b`, mypy will report warning:
# error: Incompatible return value type (got "Union[Literal[False], str]", expected "bool") [return-value]
"PLC1901",
# To handle mypy's bug in case when use Pydantic custom data type.
"SIM108", # Use ternary operator `extra_context = {} if extra_context is None else request.param` instead of `if`-`else`-block
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101"]