Format code and configure ruff linting for scripts directory#5428
Open
ludeeus wants to merge 1 commit into
Open
Format code and configure ruff linting for scripts directory#5428ludeeus wants to merge 1 commit into
ludeeus wants to merge 1 commit into
Conversation
The ruff-check and ruff-format pre-commit hooks filtered files with a regex that referenced "script" (singular) instead of "scripts", so nothing under scripts/ was ever linted or formatted by the hooks. This let formatting drift accumulate. - Reformat the 5 drifted files under scripts/ with ruff format. - Fix the files regex in both ruff hooks (script -> scripts) so the directory is covered going forward. - Add per-file-ignores for scripts/** (T201, PTH118, PTH109, ASYNC230, DTZ003) so the newly-covered ruff check passes without changing script behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YYn1cR8ELdBU4Ko4c4WsSd
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes formatting in the scripts/ Python utilities and updates linting configuration so the repo’s Ruff hooks correctly include scripts/ while allowing a small, documented set of CLI-script-appropriate exceptions.
Changes:
- Added PEP 257-compliant spacing after module docstrings in several
scripts/modules. - Applied Ruff formatting to collapse/normalize multi-line statements in the data generation/validation scripts.
- Updated linting configuration:
pyproject.tomladds Ruff per-file ignores forscripts/**, and pre-commit patterns now targetscripts/(plural) instead ofscript/.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update/manifest.py | Adds a blank line after the module docstring for PEP 257 compliance. |
| scripts/update/default_repositories.py | Adds a blank line after the module docstring for PEP 257 compliance. |
| scripts/data/validate_category_data.py | Formatting-only changes to simplify wrapped calls and strings. |
| scripts/data/generate_category_data.py | Ruff-formatting across several statements/log calls without behavioral changes. |
| scripts/data/common.py | Adds a blank line after the module docstring for PEP 257 compliance. |
| pyproject.toml | Adds Ruff per-file-ignores for scripts/** to permit CLI-utility patterns. |
| .github/pre-commit-config.yaml | Updates Ruff hook file globs to include scripts/ (plural) consistently. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ludeeus
marked this pull request as ready for review
July 24, 2026 20:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR applies code formatting improvements and updates the ruff linting configuration to properly handle the
scripts/directory with appropriate rule exceptions.Key Changes
scripts/data/generate_category_data.pyandscripts/data/validate_category_py, collapsing multi-line statements where appropriate to improve readabilitypyproject.tomlto exclude specific linting rules for scripts (T201, PTH118, PTH109, ASYNC230, DTZ003) that are acceptable in CLI/dev utility scripts.github/pre-commit-config.yamlto includescripts/directory in ruff check and format file patterns (changedscripttoscripts)scripts/data/common.py,scripts/data/validate_category_data.py,scripts/update/default_repositories.py, andscripts/update/manifest.pyfor PEP 257 complianceNotable Details
print()statements,os.pathoperations, and blocking I/Ohttps://claude.ai/code/session_01YYn1cR8ELdBU4Ko4c4WsSd