Skip to content

scripts: Update ruff and generate excludes #90427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions .ruff-excludes.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"./boards/microchip/mec172xevb_assy6906/support/mec172x_remote_flasher.py" = [
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
]
"./doc/_scripts/gen_devicetree_rest.py" = [
"SIM905", # https://docs.astral.sh/ruff/rules/split-static-string
]
"./doc/_scripts/redirects.py" = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
]
Expand Down Expand Up @@ -413,11 +416,10 @@
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./scripts/dts/gen_driver_kconfig_dts.py" = [
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
]
"./scripts/dts/gen_dts_cmake.py" = [
Expand All @@ -428,10 +430,11 @@
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./scripts/dts/python-devicetree/src/devicetree/dtlib.py" = [
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
]
"./scripts/dts/python-devicetree/src/devicetree/edtlib.py" = [
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"SIM905", # https://docs.astral.sh/ruff/rules/split-static-string
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
]
"./scripts/dts/python-devicetree/src/devicetree/grutils.py" = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
Expand All @@ -445,7 +448,7 @@
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
]
"./scripts/dts/python-devicetree/tests/test_edtlib.py" = [
"B905", # https://docs.astral.sh/ruff/rules/zip-without-explicit-strict
Expand Down Expand Up @@ -570,7 +573,7 @@
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
"UP032", # https://docs.astral.sh/ruff/rules/f-string
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
Expand Down Expand Up @@ -612,7 +615,6 @@
]
"./scripts/logging/dictionary/dictionary_parser/log_parser_v3.py" = [
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM401", # https://docs.astral.sh/ruff/rules/if-else-block-instead-of-dict-get
]
"./scripts/logging/dictionary/dictionary_parser/mipi_syst.py" = [
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
Expand Down Expand Up @@ -669,9 +671,6 @@
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
]
"./scripts/pylib/pytest-twister-harness/src/twister_harness/device/utils.py" = [
"SIM105", # https://docs.astral.sh/ruff/rules/suppressible-exception
]
"./scripts/pylib/pytest-twister-harness/src/twister_harness/fixtures.py" = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
Expand Down Expand Up @@ -726,6 +725,9 @@
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
"UP012", # https://docs.astral.sh/ruff/rules/unnecessary-encode-utf8
]
"./scripts/pylib/pytest-twister-harness/tests/resources/zen_of_python.py" = [
"SIM905", # https://docs.astral.sh/ruff/rules/split-static-string
]
"./scripts/pylib/twister/expr_parser.py" = [
"SIM103", # https://docs.astral.sh/ruff/rules/needless-bool
"SIM110", # https://docs.astral.sh/ruff/rules/reimplemented-builtin
Expand Down Expand Up @@ -772,7 +774,7 @@
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM117", # https://docs.astral.sh/ruff/rules/multiple-with-statements
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./scripts/set_assignees.py" = [
Expand All @@ -789,11 +791,6 @@
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./scripts/support/quartus-flash.py" = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
]
"./scripts/tests/twister/conftest.py" = [
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
Expand All @@ -806,6 +803,14 @@
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"UP026", # https://docs.astral.sh/ruff/rules/deprecated-mock-import
]
"./scripts/tests/twister/test_config_parser.py" = [
"B017", # https://docs.astral.sh/ruff/rules/assert-raises-exception
"B033", # https://docs.astral.sh/ruff/rules/duplicate-value
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM117", # https://docs.astral.sh/ruff/rules/multiple-with-statements
"UP026", # https://docs.astral.sh/ruff/rules/deprecated-mock-import
]
"./scripts/tests/twister/test_data/mixins/test_to_ignore.py" = [
"B011", # https://docs.astral.sh/ruff/rules/assert-false
]
Expand Down Expand Up @@ -1070,7 +1075,7 @@
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
"UP004", # https://docs.astral.sh/ruff/rules/useless-object-inheritance
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./scripts/west_commands/bindesc.py" = [
Expand Down Expand Up @@ -1158,7 +1163,6 @@
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
]
"./scripts/west_commands/spdx.py" = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
]
Expand Down Expand Up @@ -1197,9 +1201,8 @@
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
]
"./scripts/west_commands/tests/test_nrf.py" = [
"B011", # https://docs.astral.sh/ruff/rules/assert-false
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
]
"./scripts/west_commands/tests/test_nxp_s32dbg.py" = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
Expand Down Expand Up @@ -1343,7 +1346,7 @@
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM401", # https://docs.astral.sh/ruff/rules/if-else-block-instead-of-dict-get
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation-union
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./tests/drivers/can/host/pytest/test_can.py" = [
Expand All @@ -1358,6 +1361,11 @@
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"UP032", # https://docs.astral.sh/ruff/rules/f-string
]
"./tests/lib/devicetree/memory_region_flags/pytest/test_memory_region_flags.py" = [
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
]
"./tests/misc/check_init_priorities/validate_check_init_priorities_output.py" = [
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
Expand Down Expand Up @@ -1417,6 +1425,7 @@ exclude = [
"./boards/microchip/mec172xevb_assy6906/support/mec172x_remote_flasher.py",
"./doc/_extensions/zephyr/api_overview.py",
"./doc/_extensions/zephyr/application.py",
"./doc/_extensions/zephyr/domain/__init__.py",
"./doc/_extensions/zephyr/doxybridge.py",
"./doc/_extensions/zephyr/doxyrunner.py",
"./doc/_extensions/zephyr/doxytooltip/__init__.py",
Expand Down Expand Up @@ -1486,6 +1495,7 @@ exclude = [
"./scripts/ci/guideline_check.py",
"./scripts/ci/stats/merged_prs.py",
"./scripts/ci/test_plan.py",
"./scripts/ci/twister_report_analyzer.py",
"./scripts/ci/upload_test_results_es.py",
"./scripts/ci/version_mgr.py",
"./scripts/coredump/coredump_gdbserver.py",
Expand Down Expand Up @@ -1550,7 +1560,6 @@ exclude = [
"./scripts/pylib/pytest-twister-harness/src/twister_harness/device/qemu_adapter.py",
"./scripts/pylib/pytest-twister-harness/src/twister_harness/fixtures.py",
"./scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/mcumgr.py",
"./scripts/pylib/pytest-twister-harness/src/twister_harness/helpers/shell.py",
"./scripts/pylib/pytest-twister-harness/src/twister_harness/plugin.py",
"./scripts/pylib/pytest-twister-harness/src/twister_harness/twister_harness_config.py",
"./scripts/pylib/pytest-twister-harness/tests/conftest.py",
Expand Down Expand Up @@ -1588,7 +1597,6 @@ exclude = [
"./scripts/release/list_devicetree_bindings_changes.py",
"./scripts/set_assignees.py",
"./scripts/snippets.py",
"./scripts/support/quartus-flash.py",
"./scripts/tests/twister/conftest.py",
"./scripts/tests/twister/pytest_integration/test_harness_pytest.py",
"./scripts/tests/twister/test_cmakecache.py",
Expand Down Expand Up @@ -1655,6 +1663,7 @@ exclude = [
"./scripts/west_commands/fetchers/core.py",
"./scripts/west_commands/fetchers/http.py",
"./scripts/west_commands/flash.py",
"./scripts/west_commands/patch.py",
"./scripts/west_commands/robot.py",
"./scripts/west_commands/run_common.py",
"./scripts/west_commands/run_tests.py",
Expand Down Expand Up @@ -1737,6 +1746,7 @@ exclude = [
"./soc/nuvoton/npcx/common/ecst/ecst.py",
"./soc/nuvoton/npcx/common/ecst/ecst_args.py",
"./soc/silabs/silabs_sim3/sim3u/gen_crossbar_config.py",
"./tests/bluetooth/classic/sdp_s/pytest/test_sdp.py",
"./tests/boot/with_mcumgr/pytest/test_downgrade_prevention.py",
"./tests/boot/with_mcumgr/pytest/test_upgrade.py",
"./tests/boot/with_mcumgr/pytest/west_sign_wrapper.py",
Expand All @@ -1745,8 +1755,8 @@ exclude = [
"./tests/drivers/can/host/pytest/test_can.py",
"./tests/kernel/timer/timer_behavior/pytest/saleae_logic2.py",
"./tests/kernel/timer/timer_behavior/pytest/test_timer.py",
"./tests/lib/devicetree/memory_region_flags/pytest/test_memory_region_flags.py",
"./tests/misc/check_init_priorities/validate_check_init_priorities_output.py",
"./tests/misc/llext-edk/pytest/test_edk.py",
"./tests/net/lib/lwm2m/interop/pytest/conftest.py",
"./tests/net/lib/lwm2m/interop/pytest/leshan.py",
"./tests/net/lib/lwm2m/interop/pytest/test_blockwise.py",
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements-actions.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pytest
python-magic-bin; sys_platform == "win32"
python-magic; sys_platform != "win32"
pyyaml
ruff==0.8.1
ruff==0.11.11
setuptools>=70.2.0
sphinx-lint
tabulate
Expand Down
Loading
Loading