## Summary Closes #542. - Bumped `ci/dagger.json` `engineVersion`, the Forgejo runner Dockerfile (`.forgejo/Dockerfile`), and the example `dagger-engine.service` unit in `DAGGER.md` from `0.20.8` -> `0.21.4` so they match the running engine and the CLI already pinned by `flake.nix`. - Added `scripts/check_dagger_versions.sh` which parses the four pinned references and fails if any drift apart. - Wired the lint into `Taskfile.yml` (`task check-dagger-versions`) and `.pre-commit-config.yaml` (triggered when any of the four pinned files change). ## Verification - `./scripts/check_dagger_versions.sh` -> passes, all four references at `v0.21.4`. - Temporarily edited `ci/dagger.json` to `v0.21.3` and re-ran the script: exits non-zero with a clear "out of sync" error. Generated with Claude Code. Reviewed-on: https://codeberg.org/guettli/sharedinbox/pulls/544
62 lines
2.7 KiB
YAML
62 lines
2.7 KiB
YAML
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0
|
|
hooks:
|
|
- id: check-added-large-files
|
|
args: ['--maxkb=500']
|
|
- id: check-merge-conflict
|
|
- id: check-case-conflict
|
|
- id: detect-private-key
|
|
- id: end-of-file-fixer
|
|
- id: trailing-whitespace
|
|
|
|
- repo: https://github.com/guettli/sync-branch
|
|
rev: v0.0.11
|
|
hooks:
|
|
- id: sync-branch
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: check-no-binary
|
|
name: check for binary files (build artifacts, databases)
|
|
language: system
|
|
entry: bash -c 'cd "$(git rev-parse --show-toplevel)" && scripts/check_no_binary.sh'
|
|
pass_filenames: false
|
|
always_run: true
|
|
- id: forbidden-files-hook
|
|
name: check for forbidden home-directory files
|
|
language: system
|
|
entry: bash -c 'cd "$(git rev-parse --show-toplevel)" && nix develop --command task check-hygiene'
|
|
pass_filenames: false
|
|
always_run: true
|
|
- id: dart-check
|
|
name: dart format (autofix) + check-fast (parallel)
|
|
language: system
|
|
entry: bash -c 'cd "$(git rev-parse --show-toplevel)" && nix develop --command dagger call --progress=plain -q -m ci --source=. check-fast'
|
|
pass_filenames: false
|
|
always_run: true
|
|
- id: ci-no-direct-dagger
|
|
name: check for direct dagger calls in workflows (use Task instead)
|
|
language: system
|
|
entry: "bash -c 'git --no-pager grep \"dagger call\" .forgejo/workflows/ && echo \"ERROR: Direct dagger calls found in workflows. Use Taskfile instead.\" && exit 1 || exit 0'"
|
|
pass_filenames: false
|
|
always_run: true
|
|
- id: dagger-progress-plain
|
|
name: ensure all dagger calls use --progress=plain
|
|
language: system
|
|
entry: "bash -c 'git --no-pager grep \"dagger call\" -- \":!.pre-commit-config.yaml\" | grep -v \"\\-\\-progress=plain\" && echo \"ERROR: All dagger calls must include --progress=plain\" && exit 1 || exit 0'"
|
|
pass_filenames: false
|
|
always_run: true
|
|
- id: ci-image-exists
|
|
name: verify container images in ci/main.go are reachable
|
|
language: system
|
|
entry: bash -c 'cd "$(git rev-parse --show-toplevel)" && nix develop --command task check-ci-images'
|
|
pass_filenames: false
|
|
files: ^(ci/main\.go|\.fvmrc)$
|
|
- id: dagger-versions-aligned
|
|
name: verify Dagger version is consistent across dagger.json, flake.nix, Dockerfile and DAGGER.md
|
|
language: system
|
|
entry: bash -c 'cd "$(git rev-parse --show-toplevel)" && scripts/check_dagger_versions.sh'
|
|
pass_filenames: false
|
|
files: ^(ci/dagger\.json|flake\.nix|\.forgejo/Dockerfile|DAGGER\.md)$
|