Skip to content

Commit 22a875e

Browse files
LukaszMrugalacarlescufi
authored andcommitted
scripts: Fix twisterlib for ruff - SIM115
This fixes ruff linting error SIM115, where files were opened without the use of a context handler. Signed-off-by: Lukasz Mrugala <[email protected]>
1 parent 0c6fd60 commit 22a875e

File tree

4 files changed

+199
-311
lines changed

4 files changed

+199
-311
lines changed

.ruff-excludes.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,6 @@
748748
]
749749
"./scripts/pylib/twister/expr_parser.py" = [
750750
"SIM103", # https://docs.astral.sh/ruff/rules/needless-bool
751-
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
752751
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
753752
]
754753
"./scripts/pylib/twister/scl.py" = [
@@ -778,7 +777,6 @@
778777
"./scripts/pylib/twister/twisterlib/handlers.py" = [
779778
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
780779
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
781-
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
782780
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
783781
"UP030", # https://docs.astral.sh/ruff/rules/format-literals
784782
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
@@ -812,7 +810,6 @@
812810
"./scripts/pylib/twister/twisterlib/runner.py" = [
813811
"E501", # https://docs.astral.sh/ruff/rules/line-too-long
814812
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
815-
"SIM115", # https://docs.astral.sh/ruff/rules/open-file-with-context-handler
816813
"UP031", # https://docs.astral.sh/ruff/rules/printf-string-formatting
817814
"UP032", # https://docs.astral.sh/ruff/rules/f-string
818815
]

0 commit comments

Comments
 (0)