-
Notifications
You must be signed in to change notification settings - Fork 142
Expand file tree
/
Copy path.ruff.toml.jinja
More file actions
30 lines (25 loc) · 820 Bytes
/
.ruff.toml.jinja
File metadata and controls
30 lines (25 loc) · 820 Bytes
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
target-version = {% if odoo_version < 14 %}"py37"{% elif odoo_version < 16 %}"py38"{% else %}"py310"{% endif %}
fix = true
cache-dir = "~/.cache/ruff"
{% set prefix = "lint." if odoo_version >= 18 else "" %}
[lint]
extend-select = [
"B",
"C90",
"E501", # line too long (default 88)
"I", # isort
"UP", # pyupgrade
]
exclude = ["setup/*"]
[format]
exclude = ["setup/*"]
[{{ prefix }}per-file-ignores]
"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py
"__manifest__.py" = ["B018"] # useless expression
[{{ prefix }}isort]
section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"]
[{{ prefix }}isort.sections]
"odoo" = ["odoo"]
"odoo-addons" = ["odoo.addons"]
[{{ prefix }}mccabe]
max-complexity = 16