Skip to content

Commit 95fd713

Browse files
Josverldpgeorge
authored andcommitted
pyproject.toml: Reorganize ruff lint settings for newer ruff.
Changes are: - Reorganize lint settings to new sections. - Align ignore rules with micropython/micropython repo. - Update to python38 syntax to enable `:=` operator. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
1 parent 9ff5626 commit 95fd713

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

pyproject.toml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
[tool.ruff]
2-
exclude = [
2+
extend-exclude = [
33
"python-stdlib",
44
"unix-ffi",
55
]
6+
line-length = 99
7+
target-version = "py38" # enable use of walrus operator
8+
9+
[tool.ruff.lint]
610
select = [
7-
"ASYNC", # flake8-comprehensions
11+
"ASYNC", # flake8-async
812
"C4", # flake8-comprehensions
913
"C90", # McCabe cyclomatic complexity
1014
"DTZ", # flake8-datetimez
@@ -53,42 +57,40 @@ select = [
5357
# "TRY", # tryceratops
5458
# "UP", # pyupgrade
5559
]
56-
ignore = [
60+
extend-ignore = [
5761
"E722",
58-
"E741", # 'l' is currently widely used
62+
"E741", # 'l' is currently widely used
5963
"F401",
6064
"F403",
6165
"F405",
62-
"E501", # line length, recommended to disable
66+
"E501", # line length, recommended to disable
6367
"ISC001",
64-
"ISC003", # micropython does not support implicit concatenation of f-strings
65-
"PIE810", # micropython does not support passing tuples to .startswith or .endswith
68+
"ISC003", # MicroPython does not support implicit concatenation of f-strings
69+
"PIE810", # MicroPython does not support passing tuples to .startswith or .endswith
70+
"PLC0415", # conditional imports are common in MicroPython
6671
"PLC1901",
67-
"PLR1704", # sometimes desirable to redefine an argument to save code size
72+
"PLR1704", # sometimes desirable to redefine an argument to save code size
6873
"PLR1714",
6974
"PLR5501",
7075
"PLW0602",
7176
"PLW0603",
7277
"PLW2901",
73-
"RUF012",
74-
"RUF100",
78+
"RUF012", # mutable default values in class attributes.
79+
"RUF059", # Unpacked variable `foo` is never used
80+
"RUF100", # duplicate noqa directives.
7581
"SIM101",
76-
"W191", # tab-indent, redundant when using formatter
82+
"W191", # tab-indent, redundant when using formatter
7783
]
78-
line-length = 99
79-
target-version = "py37"
84+
mccabe.max-complexity = 61
8085

81-
[tool.ruff.mccabe]
82-
max-complexity = 61
83-
84-
[tool.ruff.pylint]
86+
[tool.ruff.lint.pylint]
8587
allow-magic-value-types = ["bytes", "int", "str"]
8688
max-args = 14
8789
max-branches = 58
8890
max-returns = 13
8991
max-statements = 166
9092

91-
[tool.ruff.per-file-ignores]
93+
[tool.ruff.lint.per-file-ignores]
9294
"micropython/aiorepl/aiorepl.py" = ["PGH001"]
9395

9496
# manifest.py files are evaluated with some global names pre-defined
@@ -97,5 +99,3 @@ max-statements = 166
9799

98100
# ble multitests are evaluated with some names pre-defined
99101
"micropython/bluetooth/aioble/multitests/*" = ["F821"]
100-
101-
[tool.ruff.format]

0 commit comments

Comments
 (0)