Skip to content

Commit ab663f9

Browse files
committed
Fixed Linting issues
1 parent f36f9ea commit ab663f9

12 files changed

Lines changed: 90 additions & 24 deletions

File tree

.claude/rules/copier/template-conventions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ Every skill SKILL.md frontmatter must include a `description:` field with these
133133
name: skill-name
134134
description: >-
135135
<Primary purpose in one sentence.>
136-
136+
137137
<When to use it / trigger keywords.>
138-
138+
139139
<What it produces or outputs.>
140140
---
141141
```

.github/CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ the template itself, not the projects generated from it.
1313
| File | Trigger | Purpose |
1414
|---|---|---|
1515
| `tests.yml` | push/PR to main, manual | Full pytest suite across Python 3.11–3.13 matrix; uploads coverage |
16-
| `lint.yml` | push/PR to main | Ruff lint + format check + basedpyright type check |
17-
| `security.yml` | push/PR to main, weekly schedule | pip-audit dependency vulnerability scan |
16+
| `lint.yml` | push/PR to main | Ruff + basedpyright + root/template sync script + pre-commit (all files); docstrings via Ruff `D` in pyproject (same coverage as `just docs-check`) |
17+
| `security.yml` | push/PR to main, weekly schedule | CodeQL + pip-audit (same invocation as `just audit`: `uv run --with pip-audit pip-audit`) |
1818
| `dependency-review.yml` | PR | Review dependency changes for security issues |
1919
| `release.yml` | tag push (`v*`), manual (`workflow_dispatch`) | Bump version, create tag, publish GitHub Release |
2020
| `pre-commit-update.yml` | weekly schedule, manual | Auto-update pre-commit hook versions via PR |
@@ -55,8 +55,8 @@ before pushing a tag.
5555

5656
| Meta-repo (here) | Generated projects (`template/.github/workflows/`) |
5757
|---|---|
58-
| `tests.yml` — tests the template rendering | `ci.yml`tests the generated project's code |
59-
| `lint.yml` — lints meta-repo Python/tests | `lint.yml`lints generated project code |
58+
| `tests.yml` — tests the template rendering | `ci.yml`lint, typecheck, pre-commit, and pytest matrix for generated projects (aligns with `just ci`) |
59+
| `lint.yml` — lints meta-repo Python/tests | `lint.yml`fast Ruff-only check; full gate is `ci.yml` (lint, types, pre-commit, tests) |
6060
| `security.yml` — audits meta-repo deps | `security.yml` — audits generated project deps (conditional) |
6161
| `release.yml` — releases the template | `release.yml` — releases the generated project (conditional) |
6262
| `file-freshness.yml` — tracks template file age | _(no equivalent)_ |

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Lint workflow — runs ruff (format + lint), basedpyright (type checking), and pre-commit
22
# hooks on every push and PR.
33
#
4+
# Docstring rules (D) are enforced by `ruff check` via pyproject `select`. The separate
5+
# `just docs-check` recipe is the same D-only pass for clearer local output; no extra
6+
# GitHub step is required for docstrings beyond this workflow's Ruff step.
7+
#
48
# References:
59
# Ruff documentation: https://docs.astral.sh/ruff/
610
# BasedPyright: https://docs.basedpyright.com/

.github/workflows/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ jobs:
7070
run: uv sync --frozen --extra dev
7171

7272
- name: Run pip-audit
73-
run: uv export --frozen --format requirements-txt --extra dev | uvx pip-audit --requirement /dev/stdin
73+
run: uv export --frozen --format requirements-txt --extra dev | uv run --with pip-audit pip-audit --requirement /dev/stdin

CLAUDE.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ the justfile handles the correct flags and order.
8787
just ci
8888
```
8989

90-
This runs: `fix``fmt``ci-check`.
90+
This runs: `fix``ci-check`.
9191

9292
`ci-check` bundles: `uv sync --frozen`, `fmt-check`, `ruff check`, `basedpyright`,
93-
`docs-check`, `test-ci` (pytest + coverage XML), `pre-commit --all-files`, `audit` (pip-audit).
93+
`sync-check`, `docs-check` (D-only; redundant with `ruff check` for enforcement), `test-ci`
94+
(pytest + coverage XML), `pre-commit run --all-files --verbose`, `audit` (pip-audit).
9495

95-
All steps must pass before a PR is mergeable.
96+
Together, `lint.yml` + `tests.yml` + `security.yml` mirror these checks on GitHub (CodeQL is
97+
GHA-only). All steps must pass before a PR is mergeable.
9698

9799
## Generating a test project from the template
98100

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type:
6464

6565
# -------------------------------------------------------------------------
6666
# Testing
67-
#
67+
#
6868
# Default: Minimal logging (quiet mode, dots only, warnings/errors only)
6969
# For verbose output with test names, use: just test-verbose
7070
# For full debug output, use: just test-debug

template/.github/workflows/ci.yml.jinja

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- uses: actions/checkout@v6
3636

3737
- name: Install uv
38-
uses: astral-sh/setup-uv@v8
38+
uses: astral-sh/setup-uv@v8.0.0
3939
with:
4040
enable-cache: true
4141

@@ -46,10 +46,10 @@ jobs:
4646
run: uv sync --frozen --extra dev --extra test{% if include_docs %} --extra docs{% endif %}
4747

4848
- name: Run Ruff (format check)
49-
run: uv run ruff format --check .
49+
run: uv run ruff format --check src tests
5050

5151
- name: Run Ruff (lint)
52-
run: uv run ruff check .
52+
run: uv run ruff check src tests
5353

5454
typecheck:
5555
name: Type Check
@@ -58,7 +58,7 @@ jobs:
5858
- uses: actions/checkout@v6
5959

6060
- name: Install uv
61-
uses: astral-sh/setup-uv@v8
61+
uses: astral-sh/setup-uv@v8.0.0
6262
with:
6363
enable-cache: true
6464

@@ -71,6 +71,26 @@ jobs:
7171
- name: Run BasedPyright
7272
run: uv run basedpyright
7373

74+
precommit:
75+
name: Pre-commit
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/checkout@v6
79+
80+
- name: Install uv
81+
uses: astral-sh/setup-uv@v8.0.0
82+
with:
83+
enable-cache: true
84+
85+
- name: Set up Python
86+
run: uv python install {{ python_min_version }}
87+
88+
- name: Install dependencies
89+
run: uv sync --frozen --extra dev --extra test{% if include_docs %} --extra docs{% endif %}
90+
91+
- name: Pre-commit (all files)
92+
run: uv run pre-commit run --all-files --verbose
93+
7494
test:
7595
name: Test (Python {% raw %}${{ matrix.python-version }}{% endraw %})
7696
runs-on: ubuntu-latest
@@ -83,7 +103,7 @@ jobs:
83103
- uses: actions/checkout@v6
84104

85105
- name: Install uv
86-
uses: astral-sh/setup-uv@v8
106+
uses: astral-sh/setup-uv@v8.0.0
87107
with:
88108
enable-cache: true
89109

@@ -107,13 +127,13 @@ jobs:
107127

108128
check:
109129
name: All Checks Passed
110-
needs: [lint, typecheck, test]
130+
needs: [lint, typecheck, precommit, test]
111131
runs-on: ubuntu-latest
112132
if: always()
113133
steps:
114134
- name: Check results
115135
run: |
116-
if {% raw %}[[ "${{ needs.lint.result }}" != "success" || "${{ needs.typecheck.result }}" != "success" || "${{ needs.test.result }}" != "success" ]]{% endraw %}; then
136+
if {% raw %}[[ "${{ needs.lint.result }}" != "success" || "${{ needs.typecheck.result }}" != "success" || "${{ needs.precommit.result }}" != "success" || "${{ needs.test.result }}" != "success" ]]{% endraw %}; then
117137
echo "One or more checks failed"
118138
exit 1
119139
fi

template/.github/workflows/lint.yml.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: uv sync --frozen --extra dev --extra test{% if include_docs %} --extra docs{% endif %}
4343

4444
- name: Ruff format (check)
45-
run: uv run ruff format --check .
45+
run: uv run ruff format --check src tests
4646

4747
- name: Ruff lint
48-
run: uv run ruff check .
48+
run: uv run ruff check src tests

template/.github/workflows/security.yml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ jobs:
8282
run: uv sync --frozen --extra dev
8383

8484
- name: Run pip-audit
85-
run: uv export --frozen --format requirements-txt --extra dev | uvx pip-audit --requirement /dev/stdin
85+
run: uv export --frozen --format requirements-txt --extra dev | uv run --with pip-audit pip-audit --requirement /dev/stdin

template/CLAUDE.md.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Load a skill by reading its `SKILL.md`: e.g. `.claude/skills/tdd-workflow/SKILL.
131131

132132
A feature or fix is **done** when all of the following are true:
133133

134-
1. `just ci` passes with zero errors (lint → types → docstrings → tests → pre-commit).
134+
1. `just ci` passes with zero errors (lint → types → docstrings → `test-ci` → pre-commit; matches `.github/workflows/ci.yml`).
135135
2. Every new public function/class/method has a Google-style docstring (Args/Returns/Raises where applicable).
136136
3. Every new function/method has complete type annotations (parameters + return type).
137137
4. At least one test case covers each new public symbol.

0 commit comments

Comments
 (0)