forked from giampaolo/pyftpdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
129 lines (123 loc) · 4.36 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
[tool.ruff]
# https://beta.ruff.rs/docs/settings/
target-version = "py37"
line-length = 79
select = [
"ALL", # to get a list of all values: `python3 -m ruff linter`
]
ignore = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B007", # Loop control variable `x` not used within loop body
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` (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
"DTZ", # flake8-datetimez
"EM", # flake8-errmsg
"ERA001", # Found commented-out code
"FBT", # flake8-boolean-trap
"FIX", # Line contains TODO / XXX / ..., consider resolving the issue
"FLY", # flynt (PYTHON2.7 COMPAT)
"INP", # flake8-no-pep420
"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`
"PLR", # pylint
"PLW", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"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
"TRY200", # Use `raise from` to specify exception cause (PYTHON2.7 COMPAT)
"TRY300", # Consider moving this statement to an `else` block
"TRY301", # Abstract `raise` to an inner function
"UP010", # [*] Unnecessary `__future__` import `print_function` for target Python version (PYTHON2.7 COMPAT)
"UP024", # [*] Replace aliased errors with `OSError` (PYTHON2.7 COMPAT)
"UP031", # [*] Use format specifiers instead of percent format
]
[tool.ruff.per-file-ignores]
".git_pre_commit.py" = ["T201"] # T201 == print()
"demo/*" = ["T201"]
"doc/*" = ["T201"]
"pyftpdlib/test/runner.py" = ["T201"]
"scripts/*" = ["T201"]
"setup.py" = ["T201"]
[tool.ruff.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 PY3:",
"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",
]
[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