From 9ff562640dabca05f07e27835ebad97a0428578c Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Tue, 18 Nov 2025 09:04:40 +0000 Subject: [PATCH 1/2] cbor2: Silence missing `__eq__` warning. Signed-off-by: Jos Verlinde --- python-ecosys/cbor2/cbor2/_decoder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-ecosys/cbor2/cbor2/_decoder.py b/python-ecosys/cbor2/cbor2/_decoder.py index 965dbfd46..0ddfc31d3 100644 --- a/python-ecosys/cbor2/cbor2/_decoder.py +++ b/python-ecosys/cbor2/cbor2/_decoder.py @@ -34,7 +34,7 @@ class CBORDecodeError(Exception): break_marker = object() -class CBORSimpleValue(object): +class CBORSimpleValue(object): # noqa: PLW1641 """ Represents a CBOR "simple value". :param int value: the value (0-255) From 95fd713b8a0331dfa6730a6fa89f461f5f6c1192 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Thu, 13 Nov 2025 03:00:18 +0100 Subject: [PATCH 2/2] 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 --- pyproject.toml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 83d29405d..a309df1f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,14 @@ [tool.ruff] -exclude = [ +extend-exclude = [ "python-stdlib", "unix-ffi", ] +line-length = 99 +target-version = "py38" # enable use of walrus operator + +[tool.ruff.lint] select = [ - "ASYNC", # flake8-comprehensions + "ASYNC", # flake8-async "C4", # flake8-comprehensions "C90", # McCabe cyclomatic complexity "DTZ", # flake8-datetimez @@ -53,42 +57,40 @@ select = [ # "TRY", # tryceratops # "UP", # pyupgrade ] -ignore = [ +extend-ignore = [ "E722", - "E741", # 'l' is currently widely used + "E741", # 'l' is currently widely used "F401", "F403", "F405", - "E501", # line length, recommended to disable + "E501", # line length, recommended to disable "ISC001", - "ISC003", # micropython does not support implicit concatenation of f-strings - "PIE810", # micropython does not support passing tuples to .startswith or .endswith + "ISC003", # MicroPython does not support implicit concatenation of f-strings + "PIE810", # MicroPython does not support passing tuples to .startswith or .endswith + "PLC0415", # conditional imports are common in MicroPython "PLC1901", - "PLR1704", # sometimes desirable to redefine an argument to save code size + "PLR1704", # sometimes desirable to redefine an argument to save code size "PLR1714", "PLR5501", "PLW0602", "PLW0603", "PLW2901", - "RUF012", - "RUF100", + "RUF012", # mutable default values in class attributes. + "RUF059", # Unpacked variable `foo` is never used + "RUF100", # duplicate noqa directives. "SIM101", - "W191", # tab-indent, redundant when using formatter + "W191", # tab-indent, redundant when using formatter ] -line-length = 99 -target-version = "py37" +mccabe.max-complexity = 61 -[tool.ruff.mccabe] -max-complexity = 61 - -[tool.ruff.pylint] +[tool.ruff.lint.pylint] allow-magic-value-types = ["bytes", "int", "str"] max-args = 14 max-branches = 58 max-returns = 13 max-statements = 166 -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "micropython/aiorepl/aiorepl.py" = ["PGH001"] # manifest.py files are evaluated with some global names pre-defined @@ -97,5 +99,3 @@ max-statements = 166 # ble multitests are evaluated with some names pre-defined "micropython/bluetooth/aioble/multitests/*" = ["F821"] - -[tool.ruff.format]