forked from mhammond/pywin32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruff.toml
54 lines (49 loc) · 1.86 KB
/
ruff.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
target-version = "py37" # Target the oldest supported version
[lint]
select = [
"C4", # flake8-comprehensions
"F811", # redefined-while-unused
"I", # isort
"PLC", # Pylint Convention
"PLE", # Pylint Error
"RSE", # flake8-raise
"W", # pycodestyle Warning
"YTT", # flake8-2020
# String formatting, concatenating, interpolation, ...
"FLY", # static-join-to-f-string
"G", # flake8-logging-format
# Note, we still want to allow multiline ISC
"ISC001", # single-line-implicit-string-concatenation
"UP025", # Remove unicode literals from strings
"UP030", # Use implicit references for positional format fields
# TODO: Still lots of manual fixes needed
# "UP031", # Use format specifiers instead of percent format
# "UP032", # Use f-string instead of format call
# Ensure modern type annotation syntax and best practices
# Not including those covered by type-checkers
"FA", # flake8-future-annotations
"F404", # late-future-import
"PYI", # flake8-pyi
"UP006", # non-pep585-annotation
"UP007", # non-pep604-annotation
"UP010", # unnecessary-future-import
"UP037", # quoted-annotation
]
[lint.per-file-ignores]
# Explicit re-exports is fine in __init__.py, still a code smell elsewhere.
"__init__.py" = ["PLC0414"]
# TODO: Make adodbapi changes in their own PRs
"adodbapi/*" = ["C4", "YTT301", "UP031", "UP032", "ISC002"]
[lint.isort]
combine-as-imports = true
# Because pywin32 has a mix of relative and absolute imports, with undetectable first-party c-extensions
# This makes import grouping more consistent
detect-same-package = false
known-third-party = [
"__main__",
# This forces distutils imports to always be after setuptools
# setuptools must be imported before distutils because it monkey-patches it.
# distutils is also removed in Python 3.12 and deprecated with setuptools
"distutils",
]
extra-standard-library = ["setuptools"]