Skip to content

[ci] chore: update pre-commit scripts#1562

Merged
AlpinDale merged 1 commit into
mainfrom
update-precommit
Nov 3, 2025
Merged

[ci] chore: update pre-commit scripts#1562
AlpinDale merged 1 commit into
mainfrom
update-precommit

Conversation

@AlpinDale

Copy link
Copy Markdown
Member

No description provided.

@AlpinDale AlpinDale merged commit 2cf42bb into main Nov 3, 2025
0 of 4 checks passed
@AlpinDale AlpinDale deleted the update-precommit branch November 3, 2025 23:56

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the pre-commit scripts, modernizing the toolchain and adding several new custom checks to improve code quality and maintainability. The changes are generally positive, replacing older tools like yapf and isort with ruff, and codespell with typos. I've found one issue in a new script that appears to be incomplete and non-functional.

Comment on lines +19 to +32
with open(input_file) as f:
lines = f.readlines()

skip_next = False

for line in lines:
if skip_next:
if line.startswith((" ", "\t")) or line.strip() == "":
continue
skip_next = False

if any(k in line.lower() for k in white_list):
skip_next = True
continue

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This script reads from input_file but never writes to output_file, making it non-functional. The logic to filter out packages from the white_list is present, but the filtered lines are not written to any file. Additionally, the docstring mentions splitting content into two files, but there is no logic for the second file (torch_nightly_test.txt). The script needs to be updated to write the processed lines to the output file to be functional.

Suggested change
with open(input_file) as f:
lines = f.readlines()
skip_next = False
for line in lines:
if skip_next:
if line.startswith((" ", "\t")) or line.strip() == "":
continue
skip_next = False
if any(k in line.lower() for k in white_list):
skip_next = True
continue
with open(input_file) as f, open(output_file, "w") as out_f:
lines = f.readlines()
skip_next = False
for line in lines:
if skip_next:
if line.startswith((" ", "\t")) or line.strip() == "":
continue
skip_next = False
if any(k in line.lower() for k in white_list):
skip_next = True
continue
out_f.write(line)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant