-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
162 lines (149 loc) · 5.26 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
[tool.poetry]
name = "ruff-sync"
version = "0.0.1.dev1"
description = "Syncronize ruff linter config settings accross projects"
authors = ["Gabriel Gore <gabriel59kg@gmail.com>"]
license = "MIT"
readme = "README.md"
[tool.poetry.scripts]
ruff-sync = "ruff_sync:main"
[tool.poetry.dependencies]
python = "^3.9"
httpx = "^0.27.0"
tomlkit = "^0.12.3"
[tool.poetry.group.dev.dependencies]
coverage = "^7.4.4"
invoke = "^2.2.0"
mypy = "^1.10.0"
pre-commit = "^3.7.0"
pyfakefs = "^5.4.1"
pytest = "^8.0.0"
pytest-asyncio = "^0.23.5"
pytest-icdiff = "^0.9"
respx = "^0.21.1"
ruamel-yaml = "^0.18.6"
ruff = "^0.3.7"
wily = "^1.25.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.mypy]
python_version = "3.9"
files = ["ruff_sync.py", "tests/", "tasks.py"]
strict = true
warn_unused_configs = true
ignore_missing_imports = true
warn_redundant_casts = true
warn_unused_ignores = true
show_error_codes = true
implicit_reexport = false
disallow_any_generics = true
enable_error_code = ['ignore-without-code', 'explicit-override']
[[tool.mypy.overrides]]
module = "tests.*"
disable_error_code = ['type-arg', 'no-untyped-def']
[tool.ruff-sync]
exclude = ["per_file_ignores", "ignore"]
[tool.ruff]
target-version = "py39"
line-length = 90
# https://docs.astral.sh/ruff/preview/#preview
lint.preview = true
lint.explicit-preview-rules = true
lint.select = [
# https://docs.astral.sh/ruff/rules/#flake8-async-async
"ASYNC", # async rules
# https://beta.ruff.rs/docs/rules/#flake8-bugbear-b
"B", # bugbear - common python bugs & design issues
# https://beta.ruff.rs/docs/rules/#flake8-comprehensions-c4
# https://beta.ruff.rs/docs/rules/#mccabe-c90
"C", # Complexity (mccabe+) & comprehensions
# https://beta.ruff.rs/docs/rules/#flake8-datetimez-dtz
"DTZ", # flake8-datetimez-dtz - prevent use of tz naive datetimes
# https://beta.ruff.rs/docs/rules/#pyflakes-f
"F", # Pyflakes
# https://beta.ruff.rs/docs/rules/#pycodestyle-e-w
"E", # pycodestyle
"W", # Warning
# https://docs.astral.sh/ruff/rules/#flake8-logging-format-g
"G", # logging-format - logging format string issues
# https://beta.ruff.rs/docs/rules/#isort-i
"I", # isort
# https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"ICN", # import-conventions
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N", # pep8-naming
# https://docs.astral.sh/ruff/rules/#flake8-logging-log
"LOG", # logging - logging best practices
# https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PERF", # perflint - performance related rules
# https://beta.ruff.rs/docs/rules/#flake8-pyi-pyi
"PYI", # flake8-pyi - type stub files
# https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PGH", # pygrep-hooks - hooks for pygrep
# https://beta.ruff.rs/docs/rules/#flake8-use-pathlib-pth
"PTH", # use-pathlib - use pathlib for os.path and glob operations
# https://beta.ruff.rs/docs/rules/#pylint-pl
"PL", # pylint
# https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"FA", # future-annotations - enforce future annotations
# https://docs.astral.sh/ruff/rules/#refurb-furb
"FURB", # refurb - refactoring + modernization
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF",
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S", # bandit - security
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM", # simplify - simplify code
# https://docs.astral.sh/ruff/rules/#flake8-slots-slot
"SLOT", # slots - enforce __slots__ usage
# https://beta.ruff.rs/docs/rules/#flake8-type-checking-tch
"TCH", # flake8-type-checking-tch
# https://beta.ruff.rs/docs/rules/#flake8-tidy-imports-tid
"TID", # flake8-tidy-imports
# https://docs.astral.sh/ruff/rules/#tryceratops-try
"TRY", # tryceratops - exception handling
# https://beta.ruff.rs/docs/rules/#pyupgrade-up
"UP", # pyupgrade
]
lint.ignore = [
# formatting conflicts
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"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", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
# other ignores
# # https://docs.astral.sh/ruff/rules/logging-f-string/
"G004", # f-string is performant enough
# https://docs.astral.sh/ruff/rules/raise-vanilla-args/
"TRY003", # overkill for such a small project
]
# https://docs.astral.sh/ruff/linter/#fix-safety
lint.extend-safe-fixes = ["ICN001"]
[tool.ruff.lint.flake8-import-conventions]
# Declare the banned `from` imports.
banned-from = ["pathlib", "datetime"]
[tool.ruff.lint.flake8-import-conventions.aliases]
# Declare the default aliases.
datetime = "dt"
"pprint.pprint" = "pp"
"pprint.pformat" = "pf"
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
[tool.coverage.run]
include = [
"ruff_sync.py",
]
[tool.pytest.ini_options]
log_level = "INFO"