From 6bf42edf13a9f4d26df5886ed295a5f026c74e68 Mon Sep 17 00:00:00 2001 From: Amit Verma Date: Mon, 6 Oct 2025 01:33:54 +0530 Subject: [PATCH] Fix: Use context manager for file reads (with open(...) as f) --- scripts/rtl_ltr_linter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/rtl_ltr_linter.py b/scripts/rtl_ltr_linter.py index 70e52a798..c935bcf92 100644 --- a/scripts/rtl_ltr_linter.py +++ b/scripts/rtl_ltr_linter.py @@ -210,7 +210,8 @@ def lint_file(path, cfg): # Try to read the file content and handle potential errors try: - lines = open(path, encoding='utf-8').read().splitlines() + with open(path, encoding='utf-8') as f: + lines = f.read().splitlines() except Exception as e: return [f"::error file={path},line=1::Cannot read file: {e}"] # Return as a list of issues