-
-
Notifications
You must be signed in to change notification settings - Fork 264
/
pyproject.toml
154 lines (146 loc) · 5.91 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
[tool.black]
target-version = ["py37"]
line-length = 79
skip-string-normalization = true
# https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html
preview = true
enable-unstable-feature = ["hug_parens_with_braces_and_square_brackets", "multiline_string_handling", "string_processing", "wrap_long_dict_values_in_parens"]
[tool.ruff]
# https://beta.ruff.rs/docs/settings/
target-version = "py37"
line-length = 79
[tool.ruff.lint]
preview = true
select = [
"ALL", # to get a list of all values: `python3 -m ruff linter`
"PLR5501", # [*] Use `elif` instead of `else` then `if`, to reduce indentation
"PLR6104", # Use `+=` to perform an augmented assignment directly
"PLW0602", # Using global for `x` but no assignment is done
"RUF005", # Consider iterable unpacking instead of concatenation
"RUF010", # [*] f-string, use explicit conversion flag
"RUF021", # [*] Parenthesize `a and b` expressions when chaining `and` and `or` together, to make the precedence clear
"RUF022", # [*] `__all__` is not sorted
"RUF023", # [*] `_CallLater.__slots__` is not sorted
]
ignore = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B904", # Use `raise from` to specify exception cause (PYTHON2.7 COMPAT)
"BLE001", # Do not catch blind exception: `Exception`
"C4", # flake8-comprehensions (PYTHON2.7 COMPAT)
# "C408", # Unnecessary `dict` call (rewrite as a literal)
"C90", # mccabe (function `X` is too complex)
"COM812", # Trailing comma missing
"D", # pydocstyle
"DOC201", # `return` is not documented in docstring
"DOC402", # `yield` is not documented in docstring
"DOC501", # Raised exception `X` missing from docstring
"DTZ", # flake8-datetimez
"E203", # [*] Whitespace before ':' (clashes with black)
"EM", # flake8-errmsg
"ERA001", # Found commented-out code
"FBT", # flake8-boolean-trap
"FIX", # Line contains TODO / XXX / ..., consider resolving the issue
"FURB101", # `open` and `read` should be replaced by `Path(x).read_text()`
"FURB103", # `open` and `write` should be replaced by `Path(...).write_bytes(data)`
"FURB113", # Use `x.extend(("foo", "bar"))` instead of repeatedly calling `x.append()`
"INP", # `docs/conf.py` is part of an implicit namespace package. Add an `__init__.py`.
"N801", # Class name `async_chat` should use CapWords convention (ASYNCORE COMPAT)
"N802", # Function name X should be lowercase.
"N803", # Argument name X should be lowercase.
"N806", # Variable X in function should be lowercase.
"N812", # Lowercase `error` imported as non-lowercase `FooBarError`
"N818", # Exception name `FooBar` should be named with an Error suffix
"PERF", # Perflint
"PGH004", # Use specific rule codes when using `noqa`
"PLC2701", # Private name import `_winreg`
"PLR", # pylint
"PLW", # pylint
"PT003", # `scope='function'` is implied in `@pytest.fixture()`
"PT004", # Fixture `for_each_test_method` does not return anything, add leading underscore
"PT011", # `pytest.raises(OSError)` is too broad, set the `match` parameter or use a more specific exception
"PT021", # Use `yield` instead of `request.addfinalizer`
"PTH", # flake8-use-pathlib
"Q000", # Single quotes found but double quotes preferred
"RET", # flake8-return
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM105", # Use `contextlib.suppress(OSError)` instead of `try`-`except`-`pass`
"SIM115", # Use context handler for opening files
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
"SLF", # flake8-self
"TD", # all TODOs, XXXs, etc.
"TRY003", # Avoid specifying long messages outside the exception class
"TRY300", # Consider moving this statement to an `else` block
"TRY301", # Abstract `raise` to an inner function
"UP031", # Use format specifiers instead of percent format
]
[tool.ruff.lint.per-file-ignores]
".git_pre_commit.py" = ["T201"] # T201 == print()
"demo/*" = ["T201"]
"doc/*" = ["T201"]
"scripts/*" = ["T201"]
"setup.py" = ["T201"]
[tool.ruff.lint.isort]
# https://beta.ruff.rs/docs/settings/#isort
force-single-line = true # one import per line
lines-after-imports = 2
[tool.coverage.report]
omit = [
"pyftpdlib/_compat.py",
"pyftpdlib/test/*",
"setup.py",
]
exclude_lines = [
"except ImportError:",
"if __name__ == .__main__.:",
"if hasattr(select, 'devpoll'):",
"if hasattr(select, 'epoll'):",
"if hasattr(select, 'kqueue'):",
"if hasattr(select, 'kqueue'):",
"if os.name == 'nt':",
"pragma: no cover",
"raise NotImplementedError('must be implemented in subclass')",
]
[tool.pylint.messages_control]
disable = [
"broad-except",
"consider-using-f-string",
"fixme",
"import-outside-toplevel",
"inconsistent-return-statements",
"invalid-name",
"logging-not-lazy",
"misplaced-bare-raise",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-else-continue",
"no-else-raise",
"no-else-return",
"protected-access",
"raise-missing-from",
"redefined-builtin",
"too-few-public-methods",
"too-many-instance-attributes",
"ungrouped-imports",
"unspecified-encoding",
"use-maxsplit-arg",
"useless-object-inheritance",
]
[tool.rstcheck]
ignore_messages = [
"Unexpected possible title overline or transition",
'Hyperlink target "changing-the-concurrency-model" is not referenced.',
'Hyperlink target "ftps-server" is not referenced.',
'Hyperlink target "pre-fork-model" is not referenced.',
]
[tool.tomlsort]
in_place = true
no_sort_tables = true
sort_inline_arrays = true
spaces_before_inline_comment = 2
spaces_indent_inline_array = 4
trailing_comma_inline_array = true