Debian Codegraph @

.ci/check_code_formatting.sh

raw
1 #!/usr/bin/env bash
2
3 set -euo pipefail
4
5 VENV=build/venv-code-formatting
6
7 if [[ ! -d $VENV ]]; then
8 python3 -mvenv "$VENV"
9 "$VENV/bin/pip" install \
10 jinja2 \
11 pyyaml
12 fi
13
14 set +u # ignore errors in virtualenv's activate
15 source "$VENV/bin/activate"
16 set -u
17
18 cd cpp/formatting
19 make distclean all
20 if ! git diff --exit-code README.md ;then
21 cat >&2 <<EOF
22
23 Error: README.md has changed! 💥 💔 💥
24 Please rebuild it and commit its changes with commands:
25
26 .ci/check_code_formatting.sh
27 git add cpp/formatting/README.md
28 git commit
29 EOF
30 exit 1
31 fi