-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
316 lines (278 loc) · 10.3 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["loggerplus", "utility"]
[project]
name = "loggerplus"
version = "0.1.2"
description = "A wrapper around the Python logging module that provides a more flexible and powerful logging solution."
readme = "README.md"
authors = [
{name = "Benjamin Auquite", email = "[email protected]"},
]
license = {file = "LICENSE"}
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU Lesser General Public License v2 (LGPLv2)",
"Operating System :: OS Independent",
]
requires-python = ">=3.8"
dependencies = []
[project.optional-dependencies]
color = ["colorama"]
[project.urls]
Homepage = "https://github.com/th3w1zard1/LoggerPlus"
Documentation = "https://github.com/th3w1zard1/LoggerPlus/blob/master/README.md"
Repository = "https://github.com/th3w1zard1/LoggerPlus.git"
Issues = "https://github.com/th3w1zard1/LoggerPlus/issues"
#Changelog = "https://github.com/th3w1zard1/LoggerPlus/blob/master/CHANGELOG.md"
######################
## Poetry ##
######################
[tool.poetry]
name = "loggerplus"
version = "0.1.2"
description = "A wrapper around the Python logging module that provides a more flexible and powerful logging solution."
authors = ["Benjamin Auquite <[email protected]>"]
readme = "README.md"
license = "LGPL-2.0"
homepage = "https://github.com/th3w1zard1/LoggerPlus"
repository = "https://github.com/th3w1zard1/LoggerPlus.git"
documentation = "https://github.com/th3w1zard1/LoggerPlus/blob/master/README.md"
keywords = ["logging", "python", "wrapper"]
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.extras]
color = ["colorama"]
[tool.poetry.urls]
Homepage = "https://github.com/th3w1zard1/LoggerPlus"
Documentation = "https://github.com/th3w1zard1/LoggerPlus/blob/master/README.md"
Repository = "https://github.com/th3w1zard1/LoggerPlus.git"
Issues = "https://github.com/th3w1zard1/LoggerPlus/issues"
# Changelog = "https://github.com/th3w1zard1/LoggerPlus/blob/master/CHANGELOG.md"
########################################################
## define only linter configurations below this point ##
########################################################
[tool.black]
line-length = 175
skip-magic-trailing-comma = false
target-version = ['py38']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.github
| \.mypy_cache
| \.tox
| \.venv
| venv
| _build
| buck-out
| build
| __pycache__
| dist
| nuitka_dist
| \.history
| \.idea
| \.chat
| \.ruff_cache
| \.trunk
| .mdx
| .mdl
)/
'''
[tool.pyright]
reportMissingImports = true
reportMissingTypeStubs = true
pythonVersion = "3.8"
[tool.isort]
atomic = true
profile = "black"
line_length = 175
skip_gitignore = true
multi_line_output = 3
[tool.yapf]
column_limit = 175
ALLOW_SPLIT_BEFORE_DEFAULT_OR_NAMED_ASSIGNS = false
ALLOW_SPLIT_BEFORE_DICT_VALUE = false
DISABLE_SPLIT_LIST_WITH_COMMENT = true
INDENT_DICTIONARY_VALUE = true
join_multiple_lines = false
no_spaces_around_selected_binary_operators = "*,/"
split_before_dict_set_generator = true
split_before_expression_after_opening_paren = false
split_complex_comprehension = true
split_penalty_after_opening_bracket = 50
split_penalty_excess_character = 75 # Lower penalty for going over the column limit
split_penalty_for_added_line_split = 100 # Discourage adding new line splits
[tool.ruff]
line-length = 175
# Enable preview features.
preview = false
fix = true
force-exclude = true
show-fixes = true
output-format = "grouped" # Group violations by containing file.
respect-gitignore = false
src = [
"loggerplus",
"utility"
]
[tool.ruff.lint]
external = ["V"]
task-tags = ["TODO", "FIXME", "HACK"]
select = ["ALL"]
exclude = [".venv", ".venv*"]
unfixable = [
"F841",
"ERA001",
"N815",
"RUF100", # Unused `noqa` directive
#"UP035", # replaces deprecated/outdated imports (we want to support older versions of python in the future)
#"UP038", # non-pep604-isinstance (python 3.10 syntax)
]
ignore = [
# The following rules are too strict to be realistically used by ruff:
"ANN002", # Checks that function *args arguments have type annotations.
"ANN003", # Checks that function **kwargs arguments have type annotations.
"ANN101", # Checks that instance method self arguments have type annotations.
"ANN102", # Checks that class method cls arguments have type annotations.
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name}
"ANN204", # Missing return type annotation for special method
"ARG002", # Unused method argument: `method`
"COM812", # missing-trailing-comma
"ERA001", # Found commented out code.
# "FBT001", # Boolean positional arg in function definition
# "FBT002", # Boolean default value in function definition
"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
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D205", # 1 blank line required between summary line and description
# "D213", # Multi-line docstring summary should start at the second line
# "D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"D413", # Missing blank line after last section 'xyz'
# "D403", # First word of the first line should be capitalized: {} -> {}
# "D404", # First word of the docstring should not be "This"
"D417", # Missing argument description in the docstring for {definition}: {name}
"G004", # Logging statement uses f'' string.
"N802", # Function name `screenToWorld` should be lowercase
"N806", # Variable `jumpToOffset` in function should be lowercase
"N815", # Variable `var` in class scope should not be mixedCase
"PLR0904", # Too many public methods
"RET504", # Unnecessary assignment to `varname` before `return` statement
"RUF100", # Unused `noqa` directive (non-enabled: `PLC0415`)
"T201", # 'print' detected
"TD001", # Invalid TODO tag: `FIXME`
"TRY003", # Avoid specifying long messages outside the exception class
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"SIM108", # Use ternary operator instead of 'if' 'else' block
"SIM114", # Combine `if` branches using logical `or` operator
"S101", # Use of `assert` detected.
# The following are currently violated by the codebase.
# "D205", # 1 blank line required between summary line and description
# "E402", # Module level import not at top of file
# "FIX004", # Line contains HACK, consider resolving the issue
# "PD901", # df is a bad variable name. Be kinder to your future self.
# "PERF203", # `try`-`except` within a loop incurs performance overhead
# "PLR0913", # Too many arguments to function call (N > 5)
# "PLR2004", # Magic value used in comparison, consider replacing X with a constant variable
# "S101", # Use of assert detected
# "S314", # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
# "S605", # Starting a process with a shell, possible injection detected
# "SLF001", # Private member accessed
#
# According to ruff documentation, the following rules should be avoided when using its formatter:
#
# "W191", # tab-indentation
# "E111", # indentation-with-invalid-multiple
# "E114", # indentation-with-invalid-multiple-comment
# "E117", # over-indented
# "D206", # indent-with-spaces
# "D300", # triple-single-quotes
# "Q000", # bad-quotes-inline-string
# "Q001", # bad-quotes-multiline-string
# "Q002", # bad-quotes-docstring
# "Q003", # avoidable-escaped-quote
# "COM812", # missing-trailing-comma
# "COM819", # prohibited-trailing-comma
"ISC001",
]
[tool.ruff.lint.per-file-ignores]
"*.pyi" = [
"I002", # from __future__ import annotations
]
"tests/*.py" = ["ALL"]
".github/*py" = ["INP001"]
"__init__.py" = ["I001", "F401"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
parametrize-names-type = "list"
parametrize-values-row-type = "list"
parametrize-values-type = "list" # default
raises-require-match-for = ["requests.RequestException"]
[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true
mypy-init-return = true
suppress-none-returning = true
[tool.ruff.lint.flake8-bandit]
check-typed-exception = true
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
multiline-quotes = "double"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all" # Disallow all relative imports.
[tool.ruff.lint.flake8-type-checking]
# Add quotes around type annotations, if doing so would allow an import to be moved into a type-checking block.
quote-annotations = true # Does nothing when from __future__ import annotations is used
exempt-modules = ["typing", "typing_extensions"]
strict = true
[tool.ruff.lint.flake8-unused-arguments]
ignore-variadic-names = true
[tool.ruff.lint.isort]
case-sensitive = true
force-wrap-aliases = false
combine-as-imports = true
lines-between-types = 1
required-imports = ["from __future__ import annotations"]
[tool.ruff.format]
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
preview = false
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = false
[tool.mccabe]
max-complexity = 25
[tool.bandit]
exclude_dirs = ["tests"]
tests = ["B201", "B301"]
skips = ["B101", "B601"]
[tool.ruff.lint.pycodestyle]
max-doc-length = 200
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.style]
based_on_style = "google"
split_before_named_assigns = true
split_complex_comprehension = true
split_arguments_when_comma_terminated = true
[tool.pylintrc]
max-line-length = 200
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "CRITICAL"
log_cli_format = "%(message)s"
log_file = "pytest.log"
log_file_level = "DEBUG"
log_file_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
log_file_date_format = "%Y-%m-%d %H:%M:%S"