-
Notifications
You must be signed in to change notification settings - Fork 22
/
pyproject.toml
152 lines (144 loc) · 4.69 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
[tool.black]
line-length = 100
skip-string-normalization = true
target-version = ["py310"]
[tool.isort]
atomic = true
profile = "black"
src_paths = ["autowsgr", "examples"]
known_first_party = ["autowsgr"]
extra_standard_library = ["typing_extensions"]
indent = 4
line_length = 100
lines_after_imports = 2
multi_line_output = 3
[tool.codespell]
ignore-words = "docs/spelling_wordlist.txt"
[tool.ruff]
target-version = "py310"
line-length = 100
output-format = "full"
src = ["autowsgr", "examples"]
[tool.ruff.lint]
select = [
"E", "W", # pycodestyle
"F", # pyflakes
"N", # pep8-naming
"UP", # pyupgrade
"ANN", # flake8-annotations
"S", # flake8-bandit
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"COM", # flake8-commas
"C4", # flake8-comprehensions
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"LOG", # flake8-logging
"ISC", # flake8-implicit-str-concat
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"PERF", # perflint
"FURB", # refurb
"TRY", # tryceratops
"RUF", # ruff
]
ignore = [
# E501: line too long
# W505: doc line too long
# too long docstring due to long example blocks
"E501",
"W505",
# ANN002 Missing type annotation for `*args`
# ANN003 Missing type annotation for `**kwargs`
"ANN002",
"ANN003",
# ANN401: dynamically typed expressions (typing.Any) are disallowed
"ANN401",
# S101: use of `assert` detected
# internal use and may never raise at runtime
"S101",
# S311: random number generator not cryptographically secure
# not a security-sensitive application
"S311",
# SIM105: use `contextlib.suppress(...)` instead of try-except-pass
# reduce unnecessary function call
"SIM105",
# TRY003: avoid specifying long messages outside the exception class
# long messages are necessary for clarity
"TRY003",
# RUF001 String contains ambiguous `:` (FULLWIDTH COLON)
# RUF002 Docstring contains ambiguous `,` (FULLWIDTH COMMA)
# RUF003 Comment contains ambiguous `,` (FULLWIDTH COMMA)
# allow Chinese characters in docstrings
"RUF001",
"RUF002",
"RUF003",
# S307 Use of possibly insecure function; consider using `ast.literal_eval`
# S602 `subprocess` call with `shell=True` identified, security issue
# S603 `subprocess` call: check for execution of untrusted input
# S605 Starting a process with a shell, possible injection detected
# S607 Starting a process with a partial executable path
# allow some unsafe cases
"S307",
"S602",
"S603",
"S605",
"S607",
# N801 Class name `EventFightInfo20230117_2` should use CapWords convention
# N806 Variable `SIZE` in function should be lowercase
# allow some abuse of naming conventions
"N801",
"N806",
# ANN001 Missing type annotation for function argument
# ANN201 Missing return type annotation for public function
# ANN202 Missing return type annotation for private function
# TODO: temporarily ignore until all annotations are added
"ANN001",
"ANN201",
"ANN202",
# E722 Do not use bare `except`
# BLE001 Do not catch blind exception
# B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None`
# TRY002 Create your own exception
# TRY201 Use `raise` without specifying exception name
# TRY300 Consider moving this statement to an `else` block
# TRY301 Abstract `raise` to an inner function
# TRY400 Use `logging.exception` instead of `logging.error`
# PERF203 `try`-`except` within a loop incurs performance overhead
# TODO: temporarily ignore until all exceptions are handled
"E722",
"BLE001",
"B904",
"TRY002",
"TRY201",
"TRY300",
"TRY301",
"TRY400",
"PERF203",
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
"F401", # unused-import
]
"examples/**/*.py" = [
"ANN", # flake8-annotations
"TID252", # relative-imports
]
"docs/conf.py" = [
"INP001", # flake8-no-pep420
]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
multiline-quotes = "double"
inline-quotes = "single"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"