Conversation
codingjoe
commented
Dec 19, 2025
- Add pre-commit hooks
- Apply pre-commit changes
9a093f3 to
24f9e3d
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds pre-commit hooks configuration to the repository and applies automated formatting/linting changes across multiple files. The changes replace manual linting with an automated pre-commit workflow.
- Adds
.pre-commit-config.yamlwith hooks for code quality, formatting, and linting - Replaces the
lintjob in CI with apre-commitjob - Applies automated formatting to YAML files and documentation
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.pre-commit-config.yaml |
Adds pre-commit configuration with multiple hooks for code quality, formatting, and Django-specific checks |
.github/workflows/ci.yml |
Replaces the lint job with a pre-commit job that runs all configured hooks |
pyproject.toml |
Removes the lint extras dependency as linting is now handled by pre-commit |
README.md |
Applies formatting changes including whitespace cleanup and backtick consistency |
.github/workflows/release.yml |
Applies YAML formatting (whitespace cleanup) |
.github/dependabot.yml |
Applies YAML formatting (indentation fixes) |
.readthedocs.yaml |
Applies YAML formatting (whitespace cleanup) |
health_check/contrib/mail/__init__.py |
Removes empty line from file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| outputs: | ||
| file-names: ${{ steps.diff.outputs.file-names }} |
There was a problem hiding this comment.
The 'file-names' output is defined but never used in any subsequent job. Consider removing the outputs section and the corresponding diff step (lines 12-13, 18-19) if this output is not needed, to simplify the workflow.
| - run: echo "file-names=$(git diff --name-only ${{ github.event.pull_request.base.sha }} HEAD | grep '\.py$' | tr '\n' ' ' || true)" >> "$GITHUB_OUTPUT" | ||
| id: diff |
There was a problem hiding this comment.
The git diff command is calculating file names but the output is never used anywhere in the workflow. Consider removing this step if the file-names output is not needed.
| with: | ||
| path: ~/.cache/pre-commit/ | ||
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | ||
| - run: SKIP=$(yq '.ci.skip' -o csv .pre-commit-config.yaml) uvx pre-commit run --all-files --show-diff-on-failure |
There was a problem hiding this comment.
The command "uvx run pre-commit" appears to have incorrect syntax. The correct usage should be either "uvx pre-commit run" or "uv run pre-commit run" depending on whether pre-commit is installed via uvx or uv. The "uvx run" syntax is not a valid uvx command.
| hooks: | ||
| - id: pyupgrade | ||
| - repo: https://github.com/adamchainz/django-upgrade | ||
| rev: 1.29.1 |
There was a problem hiding this comment.
The django-upgrade hook is using a tag format '1.29.1' without the 'v' prefix, which is inconsistent with the other hooks in this configuration file. The correct tag format should be 'v1.29.1' based on the django-upgrade repository's tagging convention.
| rev: 1.29.1 | |
| rev: v1.29.1 |
| - uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.cache/pre-commit/ | ||
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} |
There was a problem hiding this comment.
The workflow uses 'yq' command to parse the pre-commit config file, but 'yq' is not installed in any of the preceding steps. This will cause the job to fail. Consider installing yq using a GitHub Action like 'mikefarah/yq@master' or using an alternative approach to skip hooks.
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Install yq | |
| run: | | |
| YQ_VERSION=v4.44.3 | |
| wget -q "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" -O yq | |
| chmod +x yq | |
| sudo mv yq /usr/local/bin/yq |