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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
#
# This file is part of the CodeDiff code diffing tool.
#
# Copyright (C) 2026 Marko Ivankovic
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Runs the fast, deterministic subset of what .github/workflows/ci.yml checks, so a push doesn't
# have to round-trip through GitHub Actions to discover a formatting mistake or a broken build.
#
# Deliberately NOT a full CI mirror:
# - `cargo clippy` here, not CI's `cargo build --release` + `cargo nextest run --release` per
# feature config -
# this crate's release profile is `lto = "fat"`, `codegen-units = 1` (see Cargo.toml), which
# makes a release build genuinely slow; `cargo clippy` catches the same compile errors (it's a
# strict superset of `cargo check`) plus lint violations, in a fraction of the time and
# without running any tests at all. CI still runs the real build+test matrix and remains the
# authoritative gate.
# - `cargo audit` is skipped - it needs `cargo-audit` installed and a network call to the
# RustSec advisory database, and it depends on Cargo.lock, not on what this push changed.
# Enable this hook with `make install-hooks` (or `git config core.hooksPath .githooks` by hand).
# Skip it once, deliberately, with `git push --no-verify`.
#
# For the full mirror - every job in ci.yml, including the release build, the test matrix and the
# quality gate - run `make ci` by hand before pushing. It stays out of this hook on purpose: it
# takes minutes, and a pre-push hook that slow gets bypassed with --no-verify until it may as well
# not exist.
# Mirrors build-and-test's feature matrix (see ci.yml's own comment on why each of these three is
# its own compilation unit) and CI's own (undocumented until now, see clippy job's own comment)
# per-feature-config `cargo clippy -D warnings` gate.
for; do
label=""
done
# Skipped rather than failed when ruff isn't installed: this hook is a convenience for whoever has
# the tools, and CI is the authoritative gate for anyone who doesn't. Same posture as the node
# check below.
if ; then
else
fi
if ; then
# Via the Makefile target rather than naming the files, so adding a third test file here is
# one edit and not three - this hook, CI's mapping-site-js job, and `make test` all have to
# agree, and viewer.test.js was already missed by this line once.
else
fi