generated from ublue-os/image-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlint.sh
More file actions
executable file
·18 lines (13 loc) · 797 Bytes
/
lint.sh
File metadata and controls
executable file
·18 lines (13 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
set -euo pipefail
trap 'echo Failed!' ERR
# See 8f01ed1063e61407dc71f01863b0256f5082fd94 for rationale
echo 'Checking that all `flatpak` invocations pass `--noninteractive --system`.'
# We use () to make this a subshell to avoid ! not triggering a `set -e` bailout; see bash(1)'s documentation on this flag for more
( ! grep -rn --exclude-dir=.git flatpak | grep -ve systemctl -e /var/lib/flatpak | grep -v -- '--noninteractive --system')
for i in bin/* sbin/*; do
echo 'Checking that `'"$i"'` contains `set -euo pipefail`.'
grep -q 'set -euo pipefail' $i
done
echo 'Checking that all `jq` invocations pass `-r`.' # Otherwise results tend to be quoted, which is almost never what you want in this project.
( ! grep --exclude-dir=.git -rn 'jq ' | grep -ve rpm-ostree -e 'jq -r')