forked from clj-kondo/clj-kondo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiff
executable file
·40 lines (30 loc) · 1021 Bytes
/
diff
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
#!/usr/bin/env bash
mkdir -p /tmp/clj-kondo-diff
cp="$(clojure -Spath -A:cljs)"
read -r -d '' config <<'EOF' || true
{;; :analysis {:keywords true}
:linters
{:redundant-fn-wrapper {:level :warning}
:not-a-function
{:skip-args [clojure.pprint/defdirectives
cljs.pprint/defdirectives
clojure.data.json/codepoint-case]}
:def-fn {:level :warning}}}
EOF
out="/tmp/clj-kondo-diff/branch.txt"
export CLJ_KONDO_DEV=true
echo "Linting and writing output to $out"
rm -rf .clj-kondo/.cache
clojure -M:clj-kondo/dev --lint "$cp" --cache --config "$config" --parallel > "$out"
cd /tmp
rm -rf clj-kondo
git clone https://github.com/clj-kondo/clj-kondo.git
cd clj-kondo
if [ -n "$1" ]; then
echo "git reset $1 --hard"
git reset $1 --hard
fi
out="/tmp/clj-kondo-diff/master.txt"
echo "Linting and writing output to $out"
clojure -M:clj-kondo/dev --lint "$cp" --cache --config "$config" --parallel > "$out"
diff /tmp/clj-kondo-diff/branch.txt /tmp/clj-kondo-diff/master.txt