-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathpyproject.toml
138 lines (117 loc) · 3.53 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
[project]
name = "odoo_upgrade"
authors = [
{ name = "Odoo Upgrade Team", email = "upgrade@odoo.com" }
]
dynamic = ["version"]
dependencies = ["markdown"]
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.build]
only-include = ["src"]
[tool.hatch.build.sources]
"src" = "odoo/upgrade"
[tool.hatch.version]
source = "vcs"
raw-options.version_scheme = "calver-by-date"
[tool.hatch.build.hooks.vcs]
version-file = "src/_version.py"
[tool.ruff]
fix = true
show-fixes = true
output-format = "full"
line-length = 120
target-version = "py37"
[tool.ruff.lint]
ignore = [
"B904", # raise-without-from-inside-except; not python2 compatible
"B905", # zip-without-explicit-strict; not python2 compatible
"D1", # undocumented-*
"E501", # line-too-long; handled by auto-formatting
"E731", # lambda-assignment
"PERF203", # try-except-in-loop
"PLR09", # too-many-*; unwanted code complexity checks
"RUF012", # mutable-class-default; we know about the risk
"PLR2004", # magic-value-comparison; not all comparisons to int or str are magic
"TRY003", # raise-vanilla-args; we can live without it
"RET505", # only true for simple if/elif branches (like in the ruff doc example). if/elif blocks are easier to read in most cases
"ISC001", # avoid incompatibility with the ruff formatter
# not (yet) supported rules
# "E301",
# "E302",
# "E265",
# "E241",
# "W503",
# "E203",
# "B907",
]
select = [
# full rule-sets
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle
"ERA", # eradicate
"F", # Pyflakes
"G", # flake8-logging-format
"I", # isort
"ISC", # flake8-implicit-str-concat
"PERF",# perflint
"PIE", # flake8-pie
"PL", # pylint
"RET", # flake8-return
"RUF", # ruff specific rules
"SIM", # flake8-simplify
"TRY", # tryceratops
"T20", # flake8-print
"W", # pycodestyle
# explicit rules
"COM818", # trailing-comma-on-bare-tuple; other rules handled by autoformatter
"FBT003", # boolean-positional-value-in-call; other rules not python2 compatible
"UP005", # deprecated-unittest-alias
]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["format", "id", "type"]
[tool.ruff.lint.isort]
section-order = ["future", "standard-library", "third-party", "first-party", "odoo-addons", "local-folder"]
known-first-party = ["odoo", "openerp"]
known-local-folder = ["odoo.upgrade", "odoo.addons.base.maintenance.migrations", "openerp.addons.base.maintenance.migrations"]
[tool.ruff.lint.isort.sections]
odoo-addons = ["odoo.addons", "openerp.addons"]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = [
"F401",
"F403",
]
"src/util/*.py" = [
# python3 only rules
"RUF005",
"RUF007",
]
# ignore docstring lint for tests files
"src/*/tests/*.py" = ["D"]
# and for upgrade scripts
"src/*/*/{pre,post,end}-*.py" = ["D"]
[tool.typos.files]
extend-exclude = [
# auto-generated file
"src/util/_inherit.py",
# Use weird words. And it's just a test file, typos can be tolerated.
"src/spreadsheet/tests/test_spreadsheet_tokenizer.py",
]
[tool.typos.type.py]
extend-ignore-re = [
"\\brelease\\.serie\\b",
# ignore `datas` as the whole string
'"datas"',
]
[tool.typos.default.extend-identifiers]
inh = "inh"
_inh = "_inh"
ressource_type_id = "ressource_type_id"
# Used as alias in SQL queries.
fpt = "fpt"