feat tidy formatting, add pre-commit CI, and fix tests- Reformat dict comprehension and log.error lines in routes.py a more compact, consistent style and to remove spurious line breaks that caused uneven diff noise. - #23
Conversation
… comprehension and log.error lines in routes.py a more compact, consistent style and to remove spurious line breaks that caused uneven diff noise. Add a pre-commit job to the Git Actions workflow to run pre-commit hooks (with Python3.13, uv, and dependency install) and skip commit-message hooks in CI. This enforces repository coding standards before. - Restore/test steps: unify dependency installation and replace the previous combined lint/test step with a dedicated pytest step to simplify CI behavior. - Normalize license header duplication and list formatting in tests to inconsistent spacing and bracket placement that could trigger style. Minor whitespace/format adjustments files to improve consistency and reduce unnecessary diffs. Reason: - Maintain consistent code style and reduce noisy diffs. - Enforce precommit checks in CI to catch issues early. Simplify CI job steps be and robust for test runs.
Review Summary by QodoAdd pre-commit CI job and refactor code formatting
WalkthroughsDescription• Add pre-commit CI job to GitHub Actions workflow • Refactor dict comprehension and log.error formatting in routes.py • Simplify CI workflow by removing separate lint step • Fix duplicate license header in test file Diagramflowchart LR
A["GitHub Actions Workflow"] -->|"Add pre-commit job"| B["Pre-commit Hooks"]
A -->|"Simplify build job"| C["Remove ruff lint step"]
D["routes.py"] -->|"Compact formatting"| E["Dict comprehension & log.error"]
F["test_routes_case_update.py"] -->|"Fix duplicate header"| G["Single license header"]
File Changes1. .github/workflows/python-package.yml
|
Code Review by Qodo
|
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.13" | ||
| - uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| version: "latest" | ||
| - name: Install dependencies | ||
| run: uv sync --extra dev | ||
| - name: Run pre-commit hooks | ||
| run: uv run pre-commit run --all-files | ||
| env: | ||
| # Commit-message hooks check `git log` HEAD — not meaningful in CI | ||
| SKIP: conventional-gitmoji,commitizen | ||
|
|
||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
There was a problem hiding this comment.
1. Ci missing black --check 📘 Rule violation ✧ Quality
The updated GitHub Actions workflow runs pre-commit and pytest but does not run Black in check mode, so Black formatting is not enforced in CI. The project configuration also lacks a [tool.black] section, so Black cannot be applied consistently using project settings.
Agent Prompt
## Issue description
The CI workflow does not enforce Black formatting, and the project lacks a `[tool.black]` configuration section.
## Issue Context
Compliance requires Black to be configured via project configuration and executed in CI check mode.
## Fix Focus Areas
- .github/workflows/python-package.yml[14-53]
- pyproject.toml[92-127]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Add a pre-commit job to the Git Actions workflow to run pre-commit
hooks (with Python3.13, uv, and dependency install) and skip
commit-message hooks in CI. This enforces repository coding standards
before.
previous combined lint/test step with a dedicated pytest step to
simplify CI behavior.
inconsistent spacing and bracket placement that could trigger style.
Minor whitespace/format adjustments files to improve consistency and
reduce unnecessary diffs.
Reason:
Simplify CI job steps be and robust for test runs.