From 0a0e691750e31ce5589a3abecb59ebfbb03e997e Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Sat, 24 May 2025 21:47:34 +0200 Subject: [PATCH] scripts: west_commands: zspdx: cmakecache: Fix linter issue Fix redundant open mode. Signed-off-by: Pieter De Gendt --- .ruff-excludes.toml | 3 --- scripts/west_commands/zspdx/cmakecache.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.ruff-excludes.toml b/.ruff-excludes.toml index 04a6cad7681..db1f56fba0b 100644 --- a/.ruff-excludes.toml +++ b/.ruff-excludes.toml @@ -1190,9 +1190,6 @@ "UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes "UP032", # https://docs.astral.sh/ruff/rules/f-string ] -"./scripts/west_commands/zspdx/cmakecache.py" = [ - "UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes -] "./scripts/west_commands/zspdx/cmakefileapi.py" = [ "F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports diff --git a/scripts/west_commands/zspdx/cmakecache.py b/scripts/west_commands/zspdx/cmakecache.py index 612cee0170f..323db9812d7 100644 --- a/scripts/west_commands/zspdx/cmakecache.py +++ b/scripts/west_commands/zspdx/cmakecache.py @@ -11,7 +11,7 @@ def parseCMakeCacheFile(filePath): log.dbg(f"parsing CMake cache file at {filePath}") kv = {} try: - with open(filePath, "r") as f: + with open(filePath) as f: # should be a short file, so we'll use readlines lines = f.readlines()