Skip to content

pyproject.toml: Add ruff.lint prefixes to format settings. - #1059

Merged
dpgeorge merged 2 commits into
micropython:masterfrom
Josverl:chore_ruff
Nov 18, 2025
Merged

dpgeorge merged 2 commits into
micropython:masterfrom
Josverl:chore_ruff

Conversation

@Josverl

@Josverl Josverl commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

ruff ruff 0.11.6 is warming about the settings.

 ruff format 
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'mccabe' -> 'lint.mccabe'
  - 'pylint' -> 'lint.pylint'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
@Josverl
Josverl force-pushed the chore_ruff branch 2 times, most recently from adf3020 to b0a30e5 Compare November 18, 2025 09:07
Comment thread pyproject.toml
"unix-ffi",
]
line-length = 99
target-version = "py38" # enable use of walrus operator

@Josverl Josverl Nov 18, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped to 3.8 to support the walrus operator which is supported and used.

invalid-syntax: Cannot use named assignment expression (`:=`) on Python 3.7 (syntax was added in Python 3.8)
   --> micropython/bluetooth/aioble/aioble/peripheral.py:137:20
    |
135 |                 (16, _ADV_TYPE_UUID128_COMPLETE),
136 |             ):
137 |                 if uuids := [bytes(uuid) for uuid in services if len(bytes(uuid)) == uuid_len]:
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138 |                     resp_data = _append(adv_data, resp_data, code, b"".join(uuids))

I think this would need the same change on the micropython/micropython repo as well

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would need the same change on the micropython/micropython repo as well

Yes, that's fair enough.

Josverl and others added 2 commits November 19, 2025 00:27
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
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>
@dpgeorge
dpgeorge merged commit 95fd713 into micropython:master Nov 18, 2025
4 checks passed
@dpgeorge

Copy link
Copy Markdown
Member

Thanks for updating.

@Josverl
Josverl deleted the chore_ruff branch November 18, 2025 15:06
jakub-vesely pushed a commit to jakub-vesely/micropython that referenced this pull request Sep 21, 2026
As per 3ee912a the tests now target Python
3.8 syntax and features, so update the ruff configuration to match.

Changes in this commit:
- Update to Python 3.8 syntax.
- Ignore import not at top of module warnings.
- Exclude common SDK folders.
- Exclude cpydiff test with intentional error.

Also see: micropython/micropython-lib#1059

Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants