chore: add scripts/dev-setup.sh and a CLAUDE.md for working in this repository #12

Merged
Defame1297 merged 1 commits from chore/dev-setup-and-claude-md into main 2026-10-25 16:40:27 +00:00
Owner

Why

Everything in this repository so far was committed through the Gitea API, which skips the pre-commit hooks: four lint failures (a 166-character line, shellcheck SC2155, two --strict yamllint warnings) reached CI after the push instead of being caught at commit time. This sets up the normal way of working: a local clone, where git commit runs the hooks.

Change

  • scripts/dev-setup.sh: creates .venv with the pinned tools (requirements-dev.txt, the versions CI runs), runs pre-commit install --install-hooks, and puts the virtualenv first on PATH inside the installed pre-commit and commit-msg hook scripts. Without that the language: system hooks (REUSE, changelog lint, ansible-lint) fail on a plain git commit with FileNotFoundError: 'reuse'; found while testing in a fresh clone. Idempotent (a marker line per hook), shellcheck-clean.
  • CLAUDE.md: the rules of the repository for Claude Code: commit with git so the hooks run, feature branches with protected main and tags, the workflow rules (no pull_request_target, no secrets on pull_request, values through env:), how the images are versioned and pinned (never-moved version tag, image:<version>@sha256:<digest>), and the 100 MB layer limit. Written for a repository that will be public: no addresses, no host names beyond the public Gitea.
  • CONTRIBUTING.md: points at the script.

Verified

  • Ran the script in a fresh clone, twice (idempotent). With the virtualenv deliberately not on PATH, a plain git commit ran REUSE and passed it, and rejected a non-conventional message; no commit was created.
  • This PR's own commit went through the hooks: secrets scan, REUSE and Conventional Commits passed (the other hooks had no matching files).

Not verified

Whether Claude Code loads this CLAUDE.md when working from a parent directory (the documentation says subdirectory CLAUDE.md files load on demand; whether that holds for a nested clone is not documented). I will check once this is merged.

🤖 Generated with Claude Code

## Why Everything in this repository so far was committed through the Gitea API, which skips the pre-commit hooks: four lint failures (a 166-character line, shellcheck SC2155, two `--strict` yamllint warnings) reached CI after the push instead of being caught at commit time. This sets up the normal way of working: a local clone, where `git commit` runs the hooks. ## Change - **`scripts/dev-setup.sh`**: creates `.venv` with the pinned tools (`requirements-dev.txt`, the versions CI runs), runs `pre-commit install --install-hooks`, and puts the virtualenv first on `PATH` inside the installed `pre-commit` and `commit-msg` hook scripts. Without that the `language: system` hooks (REUSE, changelog lint, ansible-lint) fail on a plain `git commit` with `FileNotFoundError: 'reuse'`; found while testing in a fresh clone. Idempotent (a marker line per hook), shellcheck-clean. - **`CLAUDE.md`**: the rules of the repository for Claude Code: commit with git so the hooks run, feature branches with protected `main` and tags, the workflow rules (no `pull_request_target`, no secrets on `pull_request`, values through `env:`), how the images are versioned and pinned (never-moved version tag, `image:<version>@sha256:<digest>`), and the 100 MB layer limit. Written for a repository that will be public: no addresses, no host names beyond the public Gitea. - **`CONTRIBUTING.md`**: points at the script. ## Verified - Ran the script in a fresh clone, twice (idempotent). With the virtualenv deliberately **not** on `PATH`, a plain `git commit` ran REUSE and passed it, and rejected a non-conventional message; no commit was created. - This PR's own commit went through the hooks: secrets scan, REUSE and Conventional Commits passed (the other hooks had no matching files). ## Not verified Whether Claude Code loads this `CLAUDE.md` when working from a parent directory (the documentation says subdirectory `CLAUDE.md` files load on demand; whether that holds for a nested clone is not documented). I will check once this is merged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Claude added 1 commit 2026-10-25 16:36:57 +00:00
chore: add scripts/dev-setup.sh and a CLAUDE.md for working in this repository
Lint / lint (pull_request) Successful in 6s
Build / build (pull_request) Successful in 8s
44470c3bc3
dev-setup.sh creates the virtualenv with the pinned tools and installs the git
hooks with the virtualenv first on PATH inside the hook scripts. Without that,
the language: system hooks (REUSE, changelog lint, ansible-lint) fail with
"No such file or directory: 'reuse'" on a plain `git commit`; found while testing
the hooks in a fresh clone.

CLAUDE.md records the rules of the repository for Claude Code: commit with git
so the hooks run (the Gitea API skips them, which let four lint failures reach
CI), feature branches and protected main/tags, the workflow rules, how the
images are versioned and pinned, and the 100 MB layer limit. It is written for
a repository that will be public: no addresses, no host names beyond the
public Gitea.

CONTRIBUTING.md points at the script.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Defame1297 approved these changes 2026-10-25 16:40:22 +00:00
Defame1297 merged commit 32018e27f0 into main 2026-10-25 16:40:27 +00:00
Defame1297 deleted branch chore/dev-setup-and-claude-md 2026-10-25 16:40:27 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#12