Skip to content

Commit dc2fcfc

Browse files
committed
all: Upgrade to ruff v0.9.6.
Signed-off-by: Christian Clauss <cclauss@me.com>
1 parent 3f0dd13 commit dc2fcfc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+73
-17
lines changed

.github/workflows/ruff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
steps:
99
- uses: actions/checkout@v4
1010
# ruff version should be kept in sync with .pre-commit-config.yaml
11-
- run: pip install --user ruff==0.1.3
11+
- run: pipx install ruff==0.9.6
1212
- run: ruff check --output-format=github .
1313
- run: ruff format --diff .

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
stages: [commit-msg]
1414
- repo: https://github.com/charliermarsh/ruff-pre-commit
1515
# Version should be kept in sync with .github/workflows/ruff.yml
16-
rev: v0.1.3
16+
rev: v0.9.6
1717
hooks:
1818
- id: ruff
1919
- id: ruff-format

ports/nrf/examples/seeed_tft.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
tf = mount_tf()
4545
os.listdir()
4646
"""
47+
4748
import vfs
4849
import time
4950
import framebuf

pyproject.toml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ line-length = 99
2727
target-version = "py37"
2828

2929
[tool.ruff.lint]
30+
exclude = [ # Ruff finds Python SyntaxError in these files
31+
"tests/cmdline/repl_autocomplete.py",
32+
"tests/cmdline/repl_autoindent.py",
33+
"tests/cmdline/repl_basic.py",
34+
"tests/cmdline/repl_cont.py",
35+
"tests/cmdline/repl_emacs_keys.py",
36+
"tests/cmdline/repl_words_move.py",
37+
"tests/feature_check/repl_emacs_check.py",
38+
"tests/feature_check/repl_words_move_check.py",
39+
"tests/micropython/viper_args.py",
40+
]
3041
extend-select = ["C9", "PLC"]
3142
ignore = [
3243
"E401",
@@ -37,14 +48,12 @@ ignore = [
3748
"F401",
3849
"F403",
3950
"F405",
40-
"PLC1901",
51+
"PLC0206",
4152
]
53+
mccabe.max-complexity = 40
4254

43-
[tool.ruff.mccabe]
44-
max-complexity = 40
45-
46-
[tool.ruff.per-file-ignores]
47-
# Exclude all tests from linting (does not apply to formatting).
55+
[tool.ruff.lint.per-file-ignores]
56+
# Exclude all tests from linting.
4857
"tests/**/*.py" = ["ALL"]
4958
"ports/cc3200/tools/uniflash.py" = ["E711"]
5059
# manifest.py files are evaluated with some global names pre-defined
@@ -57,3 +66,4 @@ max-complexity = 40
5766
# repl_: not real python files
5867
# viper_args: uses f(*)
5968
exclude = ["tests/basics/*.py", "tests/*/repl_*.py", "tests/micropython/viper_args.py"]
69+
quote-style = "preserve"

tests/cpydiff/builtin_next_arg2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
except StopIteration:
1010
val = deflt
1111
"""
12+
1213
print(next(iter(range(0)), 42))

tests/cpydiff/core_class_delnotimpl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7+
78
import gc
89

910

tests/cpydiff/core_fstring_concat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"""
77

88
x, y = 1, 2
9+
# fmt: off
910
print("aa" f"{x}") # works
1011
print(f"{x}" "ab") # works
1112
print("a{}a" f"{x}") # fails
1213
print(f"{x}" "a{}b") # fails
14+
# fmt: on

tests/cpydiff/core_function_argcount.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: MicroPython counts "self" as an argument.
55
workaround: Interpret error messages with the information above in mind.
66
"""
7+
78
try:
89
[].append()
910
except Exception as e:

tests/cpydiff/core_import_all.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: Not implemented.
55
workaround: Manually import the sub-modules directly in __init__.py using ``from . import foo, bar``.
66
"""
7+
78
from modules3 import *
89

910
foo.hello()

tests/cpydiff/core_import_path.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cause: MicroPython doesn't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage.
55
workaround: Details of import handling is inherently implementation dependent. Don't rely on such details in portable applications.
66
"""
7+
78
import modules
89

910
print(modules.__path__)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy