refactor: unclosed file handle for readme.md (#620)

The `README.md` file is opened using `open('README.md', 'r')` but is never explicitly closed. This can lead to resource leaks, especially in long-running processes or if the script were to be extended to open many files. While Python's garbage collector might eventually close it, it's not guaranteed and is considered bad practice.

Affected files: ensure_sorted.py

Signed-off-by: toanmap <174589430+maptoan@users.noreply.github.com>
This commit is contained in:
toanmap
2026-03-30 15:10:40 +00:00
committed by GitHub
parent 0e74d801ba
commit 1fd659ceb1
+1 -1
View File
@@ -54,9 +54,9 @@ class Category:
return self.__str__()
def main():
readme_file = open('README.md', 'r')
# start of the Apps section
APPS_LINE_START = '## Apps \n'
with open('README.md', 'r') as readme_file:
lines = readme_file.readlines()
index: int