Skip to content

Commit 1a7f87a

Browse files
vemvlread
authored andcommitted
Setup and satisfy Eastwood
1 parent 080bea3 commit 1a7f87a

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.github/workflows/unit-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,8 @@ jobs:
147147
#
148148
- name: Run CI tests
149149
run: bb ci-unit-tests
150+
151+
# Runs after ci-unit-tests (which runs clj-kondo), for fail-fast behavior (as Eastwood is slower)
152+
- name: Lint with Eastwood
153+
run: clojure -A:test-common:eastwood
154+

deps.edn

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
:clj-kondo {:extra-deps {clj-kondo/clj-kondo {:mvn/version "2021.04.23"}}
2525
:main-opts ["-m" "clj-kondo.main"]}
2626

27-
27+
:eastwood {:extra-deps {jonase/eastwood {:mvn/version "0.6.0"}}
28+
:main-opts ["-m" "eastwood.lint" {:ignored-faults {:deprecations {rewrite-clj.regression-test true
29+
rewrite-clj.zip.whitespace-test true}}}]}
2830

2931
:test-common {:extra-deps {org.clojure/test.check {:mvn/version "1.1.0"}}
3032
:extra-paths ["test"]}

test/rewrite_clj/examples/cljx_test.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
(defn- handle-reader-macro
6565
"Handle a reader macro node by either removing it completely or only the macro part."
6666
[active-profiles zloc]
67-
{:pre (= (z/tag zloc) :reader-macro)}
67+
{:pre [(= (z/tag zloc) :reader-macro)]}
6868
(let [profile (-> zloc z/down z/sexpr name)
6969
active? (contains? active-profiles (subs profile 1))
7070
print? (.startsWith profile "+")]

test/rewrite_clj/paredit_test.cljc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ First line
231231
z/of-string
232232
z/down z/right z/down ;at 2
233233
pe/slurp-forward)]
234-
(is (= "[1 [2 [3 4] 5]]" (-> res z/root-string))
235-
(= "2" (-> res z/string)))))
234+
(is (= "[1 [2 [3 4] 5]]" (-> res z/root-string)))
235+
(is (= "2" (-> res z/string)))))
236236

237237
(deftest slurp-forward-keep-linebreak
238238
(let [sample "
@@ -405,22 +405,22 @@ First line
405405
(pe/wrap-fully-forward-slurp :vector)
406406
z/root-string))))
407407

408-
(deftest splice-killing-backward []
408+
(deftest splice-killing-backward
409409
(let [res (-> (z/of-string "(foo (let ((x 5)) (sqrt n)) bar)")
410410
z/down z/right z/down z/right z/right
411411
pe/splice-killing-backward)]
412412
(is (= "(foo (sqrt n) bar)" (z/root-string res)))
413413
(is (= "(sqrt n)" (z/string res)))))
414414

415415

416-
(deftest splice-killing-forward []
416+
(deftest splice-killing-forward
417417
(let [res (-> (z/of-string "(a (b c d e) f)")
418418
z/down z/right z/down z/right z/right
419419
pe/splice-killing-forward)]
420420
(is (= "(a b c f)" (z/root-string res)))
421421
(is (= "c" (z/string res)))))
422422

423-
(deftest splice-killing-forward-at-leftmost []
423+
(deftest splice-killing-forward-at-leftmost
424424
(let [res (-> (z/of-string "(a (b c d e) f)")
425425
z/down z/right z/down
426426
pe/splice-killing-forward)]

0 commit comments

Comments
 (0)