-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
52 lines (43 loc) · 2.21 KB
/
Copy pathjustfile
File metadata and controls
52 lines (43 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
set shell := ["bash", "-euo", "pipefail", "-c"]
# File discovery lives inside recipes (not `just` variables) because `git ls-files`
# returns newline-separated paths and a multiline just variable expanded inline
# makes bash interpret every path after the first as a new command — which will
# happily *execute* scripts like `bin/maint` instead of passing them as arguments.
# Using `xargs` keeps things literal and lazy-evaluated.
shell_pathspec := "'*.sh' '*.bash' 'bin/' ':!:bin/nextdns-configure'"
# Default: show available recipes
_default:
@just --list
# Run all lint checks across the whole repo (not just staged files)
lint:
git ls-files -z -- {{shell_pathspec}} | xargs -0 mise x -- shellcheck
git ls-files -z -- {{shell_pathspec}} | xargs -0 mise x -- shfmt -d -i 2 -ci
mise x -- ruff check bin/nextdns-configure
git ls-files -z -- '*.toml' | xargs -0 mise x -- taplo fmt --check
# prettier 3.1.0+ hard-errors on explicitly-passed symlinks (glob-expanded ones it skips
# silently); drop symlinked tracked files so linked skills don't fail the check.
git ls-files -z -- '*.md' '*.json' '*.yml' '*.yaml' \
| while IFS= read -r -d '' f; do [ -L "$f" ] || printf '%s\0' "$f"; done \
| xargs -0 mise x -- prettier --check
# Run the test suites. Free and offline; tests/probe-*.sh are opt-in and cost
# tokens, so they are deliberately not here.
test:
bash tests/test-review-gate.sh
bash tests/test-tailscale-dns.sh
python3 .claude/hooks/test-hooks.py
# Audit the machine for drift without making changes
dry-run:
./setup.sh --dry-run
# Full pre-push gate: lint everything + verify setup.sh still parses and runs
check: lint test dry-run
# Auto-fix everything that has an auto-fixer. Leaves the repo lint-clean.
fmt:
git ls-files -z -- {{shell_pathspec}} | xargs -0 mise x -- shfmt -w -i 2 -ci
mise x -- ruff check --fix bin/nextdns-configure
git ls-files -z -- '*.toml' | xargs -0 mise x -- taplo fmt
git ls-files -z -- '*.md' '*.json' '*.yml' '*.yaml' | xargs -0 mise x -- prettier --write
# Install dev tools (via mise) and activate git hooks (via lefthook).
# Run this once after cloning.
deps:
mise install
mise x -- lefthook install