Skip to content

MNT #1156: adopt pre-commit for code style#1173

Merged
prjemian merged 6 commits intomainfrom
1156-pre-commit
Mar 27, 2026
Merged

MNT #1156: adopt pre-commit for code style#1173
prjemian merged 6 commits intomainfrom
1156-pre-commit

Conversation

@prjemian
Copy link
Copy Markdown
Contributor

Summary

  • Add .pre-commit-config.yaml with pre-commit-hooks (v6.0.0) for file hygiene and ruff-pre-commit (v0.15.7) for linting + formatting (modeled on hklpy2).
  • Remove legacy [tool.black], [tool.flake8], [tool.isort] sections from pyproject.toml and delete standalone .flake8 file — ruff replaces all three.
  • Remove isort from dev dependencies (already replaced by ruff's import sorting).
  • Apply ruff format across all files (50 reformatted): quote normalization, PEP 8 operator spacing, whitespace cleanup.
  • Apply end-of-file-fixer and trailing-whitespace hooks across all files.
  • Restore intentional multi-line formatting in command_list.py and log_utils.py with # fmt: off/on fences.
  • pre-commit was already in dev dependencies; hooks are now installed via pre-commit install.

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)
@prjemian prjemian added this to the 1.7.10 milestone Mar 27, 2026
@prjemian prjemian self-assigned this Mar 27, 2026
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)
@prjemian prjemian merged commit 9399691 into main Mar 27, 2026
7 checks passed
@prjemian prjemian deleted the 1156-pre-commit branch March 27, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pre-commit for code style

1 participant