MNT #1156: adopt pre-commit for code style#1173
Merged
Conversation
Add .pre-commit-config.yaml with pre-commit-hooks (v6.0.0) for file hygiene checks and ruff-pre-commit (v0.15.7) for linting and formatting, replacing black, flake8, and isort. - Remove [tool.black], [tool.flake8], [tool.isort] from pyproject.toml - Remove standalone .flake8 file - Remove isort from dev dependencies (ruff handles import sorting) - Apply ruff-format to all files (quote normalization, whitespace, PEP 8 operator spacing) - Apply end-of-file-fixer and trailing-whitespace hooks - Restore intentional multi-line formatting in command_list.py and log_utils.py with fmt: off/on fences Generated by OpenCode (argo/claudesonnet46)
Generated by OpenCode (argo/claudesonnet46)
Use pre-commit run --all-files so CI runs the exact same checks as local development. Adding new hooks to .pre-commit-config.yaml automatically updates CI without editing the workflow. Generated by OpenCode (argo/claudesonnet46)
Add instruction to copy the project item Status field from the issue to the PR using the GitHub GraphQL API. Generated by OpenCode (argo/claudesonnet46)
The end-of-file-fixer hook removed trailing blank lines from config_fourc and config_spec. Those blank lines were being parsed as empty unhandled entries. Update assertions to reflect the corrected file content. Generated by OpenCode (argo/claudesonnet46)
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
.pre-commit-config.yamlwithpre-commit-hooks(v6.0.0) for file hygiene andruff-pre-commit(v0.15.7) for linting + formatting (modeled on hklpy2).[tool.black],[tool.flake8],[tool.isort]sections frompyproject.tomland delete standalone.flake8file — ruff replaces all three.isortfrom dev dependencies (already replaced by ruff's import sorting).ruff formatacross all files (50 reformatted): quote normalization, PEP 8 operator spacing, whitespace cleanup.end-of-file-fixerandtrailing-whitespacehooks across all files.command_list.pyandlog_utils.pywith# fmt: off/onfences.pre-commitwas already in dev dependencies; hooks are now installed viapre-commit install.