scripts: Update and lock ruff
The ruff linter and formatter should get a locked version to be installed for compliance. This prevents new linter issues because of ruff updates itself. Ruff version 0.8.0 removed the deprecated UP027 rule so it's removed from the ignore list. Update the excludes file to match the actual reported issues. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
9ca1b0ffe7
commit
f2b51887a4
3 changed files with 11 additions and 17 deletions
|
@ -126,6 +126,7 @@
|
||||||
"SIM113", # https://docs.astral.sh/ruff/rules/enumerate-for-loop
|
"SIM113", # https://docs.astral.sh/ruff/rules/enumerate-for-loop
|
||||||
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
||||||
"UP010", # https://docs.astral.sh/ruff/rules/unnecessary-future-import
|
"UP010", # https://docs.astral.sh/ruff/rules/unnecessary-future-import
|
||||||
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
"./samples/modules/tflite-micro/magic_wand/train/train_test.py" = [
|
"./samples/modules/tflite-micro/magic_wand/train/train_test.py" = [
|
||||||
|
@ -199,6 +200,7 @@
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
"UP030", # https://docs.astral.sh/ruff/rules/format-literals
|
"UP030", # https://docs.astral.sh/ruff/rules/format-literals
|
||||||
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
"./scripts/build/gen_isr_tables_parser_local.py" = [
|
"./scripts/build/gen_isr_tables_parser_local.py" = [
|
||||||
|
@ -206,6 +208,7 @@
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
"UP030", # https://docs.astral.sh/ruff/rules/format-literals
|
"UP030", # https://docs.astral.sh/ruff/rules/format-literals
|
||||||
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
"./scripts/build/gen_kobject_list.py" = [
|
"./scripts/build/gen_kobject_list.py" = [
|
||||||
|
@ -254,6 +257,7 @@
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
]
|
]
|
||||||
"./scripts/build/gen_syscalls.py" = [
|
"./scripts/build/gen_syscalls.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
|
@ -365,12 +369,14 @@
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
||||||
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
"UP039", # https://docs.astral.sh/ruff/rules/unnecessary-class-parentheses
|
"UP039", # https://docs.astral.sh/ruff/rules/unnecessary-class-parentheses
|
||||||
]
|
]
|
||||||
"./scripts/coredump/coredump_parser/log_parser.py" = [
|
"./scripts/coredump/coredump_parser/log_parser.py" = [
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
||||||
"UP030", # https://docs.astral.sh/ruff/rules/format-literals
|
"UP030", # https://docs.astral.sh/ruff/rules/format-literals
|
||||||
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
"./scripts/coredump/coredump_serial_log_parser.py" = [
|
"./scripts/coredump/coredump_serial_log_parser.py" = [
|
||||||
|
@ -748,6 +754,8 @@
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/expr_parser.py" = [
|
"./scripts/pylib/twister/expr_parser.py" = [
|
||||||
"SIM103", # https://docs.astral.sh/ruff/rules/needless-bool
|
"SIM103", # https://docs.astral.sh/ruff/rules/needless-bool
|
||||||
|
"SIM110", # https://docs.astral.sh/ruff/rules/reimplemented-builtin
|
||||||
|
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
||||||
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
|
||||||
]
|
]
|
||||||
"./scripts/pylib/twister/scl.py" = [
|
"./scripts/pylib/twister/scl.py" = [
|
||||||
|
@ -786,6 +794,7 @@
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
"./scripts/release/list_devicetree_bindings_changes.py" = [
|
"./scripts/release/list_devicetree_bindings_changes.py" = [
|
||||||
|
"E402", # https://docs.astral.sh/ruff/rules/module-import-not-at-top-of-file
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
"SIM117", # https://docs.astral.sh/ruff/rules/multiple-with-statements
|
"SIM117", # https://docs.astral.sh/ruff/rules/multiple-with-statements
|
||||||
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
"UP006", # https://docs.astral.sh/ruff/rules/non-pep585-annotation
|
||||||
|
@ -833,7 +842,6 @@
|
||||||
]
|
]
|
||||||
"./scripts/tests/twister/test_data/mixins/test_to_ignore.py" = [
|
"./scripts/tests/twister/test_data/mixins/test_to_ignore.py" = [
|
||||||
"B011", # https://docs.astral.sh/ruff/rules/assert-false
|
"B011", # https://docs.astral.sh/ruff/rules/assert-false
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
]
|
]
|
||||||
"./scripts/tests/twister/test_environment.py" = [
|
"./scripts/tests/twister/test_environment.py" = [
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
|
@ -1259,7 +1267,6 @@
|
||||||
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
"UP032", # https://docs.astral.sh/ruff/rules/f-string
|
||||||
]
|
]
|
||||||
"./scripts/west_commands/zspdx/cmakecache.py" = [
|
"./scripts/west_commands/zspdx/cmakecache.py" = [
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
]
|
]
|
||||||
"./scripts/west_commands/zspdx/cmakefileapi.py" = [
|
"./scripts/west_commands/zspdx/cmakefileapi.py" = [
|
||||||
|
@ -1275,7 +1282,6 @@
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
]
|
]
|
||||||
"./scripts/west_commands/zspdx/datatypes.py" = [
|
"./scripts/west_commands/zspdx/datatypes.py" = [
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
||||||
]
|
]
|
||||||
"./scripts/west_commands/zspdx/getincludes.py" = [
|
"./scripts/west_commands/zspdx/getincludes.py" = [
|
||||||
|
@ -1290,7 +1296,6 @@
|
||||||
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
||||||
]
|
]
|
||||||
"./scripts/west_commands/zspdx/scanner.py" = [
|
"./scripts/west_commands/zspdx/scanner.py" = [
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM113", # https://docs.astral.sh/ruff/rules/enumerate-for-loop
|
"SIM113", # https://docs.astral.sh/ruff/rules/enumerate-for-loop
|
||||||
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
"UP008", # https://docs.astral.sh/ruff/rules/super-call-with-parameters
|
||||||
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
|
||||||
|
@ -1336,14 +1341,6 @@
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
"UP009", # https://docs.astral.sh/ruff/rules/utf8-encoding-declaration
|
"UP009", # https://docs.astral.sh/ruff/rules/utf8-encoding-declaration
|
||||||
]
|
]
|
||||||
"./soc/mediatek/mtk_adsp/gen_img.py" = [
|
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
|
||||||
]
|
|
||||||
"./soc/mediatek/mtk_adsp/mtk_adsp_load.py" = [
|
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
|
||||||
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
|
|
||||||
]
|
|
||||||
"./soc/microchip/mec/common/spigen/mec_spi_gen.py" = [
|
"./soc/microchip/mec/common/spigen/mec_spi_gen.py" = [
|
||||||
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
|
||||||
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
|
||||||
|
@ -1465,11 +1462,11 @@ exclude = [
|
||||||
"./doc/_extensions/zephyr/link-roles.py",
|
"./doc/_extensions/zephyr/link-roles.py",
|
||||||
"./doc/_scripts/gen_boards_catalog.py",
|
"./doc/_scripts/gen_boards_catalog.py",
|
||||||
"./doc/_scripts/gen_devicetree_rest.py",
|
"./doc/_scripts/gen_devicetree_rest.py",
|
||||||
"./doc/_scripts/gen_helpers.py",
|
|
||||||
"./doc/_scripts/redirects.py",
|
"./doc/_scripts/redirects.py",
|
||||||
"./doc/conf.py",
|
"./doc/conf.py",
|
||||||
"./doc/develop/test/twister/sample_blackbox_test.py",
|
"./doc/develop/test/twister/sample_blackbox_test.py",
|
||||||
"./modules/mbedtls/create_psa_files.py",
|
"./modules/mbedtls/create_psa_files.py",
|
||||||
|
"./samples/boards/nordic/coresight_stm/pytest/test_stm.py",
|
||||||
"./samples/modules/tflite-micro/magic_wand/train/data_augmentation.py",
|
"./samples/modules/tflite-micro/magic_wand/train/data_augmentation.py",
|
||||||
"./samples/modules/tflite-micro/magic_wand/train/data_augmentation_test.py",
|
"./samples/modules/tflite-micro/magic_wand/train/data_augmentation_test.py",
|
||||||
"./samples/modules/tflite-micro/magic_wand/train/data_load.py",
|
"./samples/modules/tflite-micro/magic_wand/train/data_load.py",
|
||||||
|
@ -1770,8 +1767,6 @@ exclude = [
|
||||||
"./soc/intel/intel_adsp/tools/cavstool_client.py",
|
"./soc/intel/intel_adsp/tools/cavstool_client.py",
|
||||||
"./soc/intel/intel_adsp/tools/remote-fw-service.py",
|
"./soc/intel/intel_adsp/tools/remote-fw-service.py",
|
||||||
"./soc/intel/intel_ish/utils/build_ish_firmware.py",
|
"./soc/intel/intel_ish/utils/build_ish_firmware.py",
|
||||||
"./soc/mediatek/mtk_adsp/gen_img.py",
|
|
||||||
"./soc/mediatek/mtk_adsp/mtk_adsp_load.py",
|
|
||||||
"./soc/microchip/mec/common/spigen/mec_spi_gen.py",
|
"./soc/microchip/mec/common/spigen/mec_spi_gen.py",
|
||||||
"./soc/nuvoton/npcm/common/esiost/esiost.py",
|
"./soc/nuvoton/npcm/common/esiost/esiost.py",
|
||||||
"./soc/nuvoton/npcm/common/esiost/esiost_args.py",
|
"./soc/nuvoton/npcm/common/esiost/esiost_args.py",
|
||||||
|
|
|
@ -22,7 +22,6 @@ select = [
|
||||||
ignore = [
|
ignore = [
|
||||||
# zephyr-keep-sorted-start
|
# zephyr-keep-sorted-start
|
||||||
"SIM108", # Allow if-else blocks instead of forcing ternary operator
|
"SIM108", # Allow if-else blocks instead of forcing ternary operator
|
||||||
"UP027", # deprecated pyupgrade rule
|
|
||||||
# zephyr-keep-sorted-stop
|
# zephyr-keep-sorted-stop
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ pykwalify
|
||||||
pylint>=3
|
pylint>=3
|
||||||
python-magic
|
python-magic
|
||||||
python-magic-bin; sys_platform == "win32"
|
python-magic-bin; sys_platform == "win32"
|
||||||
ruff
|
ruff==0.8.1
|
||||||
sphinx-lint
|
sphinx-lint
|
||||||
unidiff
|
unidiff
|
||||||
yamllint
|
yamllint
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue