Skip to content

Commit 6ca9fe6

Browse files
committed
Update just config
1 parent cae7d53 commit 6ca9fe6

4 files changed

Lines changed: 48 additions & 7 deletions

File tree

‎CLAUDE.md.example‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ Python project template using `uv` for environment/dependency management and `ju
1313
- `just audit` - check dependencies for known vulnerabilities (pip-audit)
1414
- `just markdownlint` - lint Markdown files (markdownlint-cli2, config in `.markdownlint-cli2.jsonc`)
1515
- `just docs-build` - build the docs with Zensical in strict mode (`zensical.toml`, pages in `docs/`)
16+
- `just docs-serve` - serve the docs locally with live reload
1617
- `just zizmor` - audit GitHub Actions workflows for security issues
1718
- `just git-leaks` - scan staged changes for secrets
18-
- `just set-github-labels` - create/update the release labels on GitHub (`scripts/sync-labels.sh`, needs `gh`)
19+
- `just set-github-labels` - remove non-release default labels, then create/update the release labels on GitHub
20+
(`scripts/sync-labels.sh`, needs `gh`, for fresh repos)
1921
- `uv add <pkg>` / `uv add --dev <pkg>` - add a runtime / dev dependency (never edit `uv.lock` by hand)
2022
- `uv run example` - run the app entry point
2123

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@ manage project configuration and commands
3535
* `just audit` - check dependencies for known vulnerabilities with pip-audit
3636
* `just markdownlint` - lint Markdown files with markdownlint-cli2
3737
* `just docs-build` - build the docs site with Zensical (strict mode, output in `site/`)
38-
* `just docs-serve` - serve the docs locally with live reload (commented out in the `justfile`, uncomment to use)
38+
* `just docs-serve` - serve the docs locally with live reload
3939
* `just prek` - run pre-commit hooks via prek
4040
* `just git-leaks` - scan staged changes for secrets with gitleaks
4141
* `just zizmor` - audit GitHub Actions workflows for security issues
42-
* `just set-github-labels` - create or update the release labels on GitHub (requires `gh auth login`)
42+
* `just set-github-labels` - remove GitHub's non-release default labels, then create or update the release labels
43+
(for fresh repos, requires `gh auth login`)
4344
* `uv add {package}` - install a dependency
4445

4546
## CI and Security
@@ -64,7 +65,7 @@ which reads the **release labels** on merged pull requests.
6465
A release label is a GitHub label added to the pull request itself, from the **Labels** section
6566
of the PR sidebar. Release Drafter only reads these labels. Commit messages and PR titles are not
6667
parsed, so prefixes like `feat:` or `fix:` have no effect. Only the labels below count as release
67-
labels; other repository labels (e.g. `good first issue`, `question`) are ignored.
68+
labels; any other repository labels you add are ignored.
6869

6970
| Release label | Version bump | Release notes section |
7071
| ----------------------------------------------------------------- | ------------ | --------------------- |

‎justfile‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,52 @@
1+
# List available recipes
2+
[private]
3+
default:
4+
@just --list
5+
# Check dependencies for known vulnerabilities (pip-audit)
16
audit:
27
uv run pip-audit --skip-editable
8+
# Type check, lint, format check, spell check, and lint workflows without changing files
39
ci-lint:
410
uv run ty check
511
uv run ruff check .
612
uv run ruff format --check .
713
uv run codespell
814
uv run actionlint
15+
# Build the docs in strict mode (output in site/)
916
docs-build:
1017
uv run zensical build --strict
11-
# docs-serve:
12-
# uv run zensical serve
18+
# Serve the docs locally with live reload
19+
docs-serve:
20+
uv run zensical serve
21+
# Scan staged changes for secrets
1322
git-leaks:
1423
gitleaks git --pre-commit --staged --redact
24+
# Type check, lint, format, spell check, and lint workflows, applying fixes
1525
lint:
1626
uv run ty check
1727
uv run ruff check . --fix
1828
uv run ruff format .
1929
uv run codespell
2030
uv run actionlint
31+
# Lint Markdown files
2132
markdownlint:
2233
markdownlint-cli2 "**/*.md"
34+
# Run the git hooks on staged files
2335
prek:
2436
uv run prek
37+
# Remove non-release default labels and sync the release labels on GitHub
2538
set-github-labels:
2639
./scripts/sync-labels.sh
40+
# Install Homebrew tools and sync the project
2741
setup:
2842
brew bundle install
2943
just sync
44+
# Install all dependency groups into .venv
3045
sync:
3146
uv sync --all-groups
47+
# Run unit tests with coverage
3248
test:
3349
uv run pytest
50+
# Audit GitHub Actions workflows for security issues
3451
zizmor:
3552
zizmor . --collect all

‎scripts/sync-labels.sh‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
2-
# Create or update the release labels used by Release Drafter.
2+
# Remove GitHub's default labels that are not release labels, then create or update the
3+
# release labels used by Release Drafter. Intended for fresh repositories: deleting a label
4+
# also removes it from any issues and PRs that have it.
35
# Usage: scripts/sync-labels.sh [owner/repo] (defaults to the current repo)
46
set -euo pipefail
57

@@ -22,6 +24,25 @@ labels=(
2224
"skip-changelog|cccccc|Exclude from release notes"
2325
)
2426

27+
# GitHub's default labels that are not release labels
28+
# (bug, documentation, and enhancement are defaults too, but are updated below)
29+
default_labels=(
30+
"duplicate"
31+
"good first issue"
32+
"help wanted"
33+
"invalid"
34+
"question"
35+
"wontfix"
36+
)
37+
38+
existing=$(gh label list --limit 1000 --json name --jq '.[].name')
39+
for name in "${default_labels[@]}"; do
40+
if grep -qxF "$name" <<< "$existing"; then
41+
gh label delete "$name" --yes
42+
echo "deleted: $name"
43+
fi
44+
done
45+
2546
for entry in "${labels[@]}"; do
2647
IFS='|' read -r name color description <<< "$entry"
2748
gh label create "$name" --color "$color" --description "$description" --force

0 commit comments

Comments
 (0)