summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJos Verlinde <jos_verlinde@hotmail.com>2025-11-18 12:06:55 +0100
committerDamien George <damien@micropython.org>2025-11-30 23:08:07 +1100
commit83131c106d2a7d78055fb83f9a17c9c9c348ea73 (patch)
tree8b57f548c1b03f6d9254497f7ace387716405182
parent2fbd72ad78a490bab19797e768707f0190fbd4a9 (diff)
pyproject.toml: Update ruff configuration to target Python 3.8.HEADorigin/masterorigin/HEADmaster
As per 4c9ce826cbfbd99cff10cc933064f87a13bee4ac 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: https://github.com/micropython/micropython-lib/pull/1059 Signed-off-by: Jos Verlinde <jos_verlinde@hotmail.com>
-rw-r--r--pyproject.toml15
1 files changed, 12 insertions, 3 deletions
diff --git a/pyproject.toml b/pyproject.toml
index f3693eae1..1cf57166e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -22,11 +22,17 @@ ACKNOWLEDGEMENTS,\
[tool.ruff]
# Exclude third-party code from linting and formatting
-extend-exclude = ["lib"]
+extend-exclude = [
+ "lib",
+ "esp-idf",
+ "pico-sdk",
+ "emsdk",
+ "tests/cpydiff/syntax_assign_expr.py" # intentionally incorrect CPython code
+]
# Include Python source files that don't end with .py
extend-include = ["tools/cc1"]
line-length = 99
-target-version = "py37"
+target-version = "py38"
[tool.ruff.lint]
exclude = [ # Ruff finds Python SyntaxError in these files
@@ -44,7 +50,7 @@ exclude = [ # Ruff finds Python SyntaxError in these files
"tests/micropython/viper_args.py",
]
extend-select = ["C9", "PLC"]
-ignore = [
+extend-ignore = [
"E401",
"E402",
"E722",
@@ -54,6 +60,7 @@ ignore = [
"F403",
"F405",
"PLC0206",
+ "PLC0415", # conditional imports are common in MicroPython
]
mccabe.max-complexity = 40
@@ -64,6 +71,8 @@ mccabe.max-complexity = 40
# manifest.py files are evaluated with some global names pre-defined
"**/manifest.py" = ["F821"]
"ports/**/boards/**/manifest_*.py" = ["F821"]
+# Uses assignment expressions.
+"tests/cpydiff/syntax_assign_expr.py" = ["F821"]
[tool.ruff.format]
# Exclude third-party code, and exclude the following tests: