-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sean Corfield <[email protected]>
- Loading branch information
1 parent
e40ace1
commit 05af681
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.clj-kondo/imports/com.github.seancorfield/expectations/config.edn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{:hooks | ||
{:analyze-call | ||
{expectations.clojure.test/more-> | ||
hooks.com.github.seancorfield.expectations/more-> | ||
expectations.clojure.test/more-of | ||
hooks.com.github.seancorfield.expectations/more-of}} | ||
:lint-as | ||
{expectations.clojure.test/defexpect clojure.test/deftest | ||
expectations.clojure.test/from-each clojure.core/for | ||
expectations.clojure.test/=? clojure.core/=}} |
29 changes: 29 additions & 0 deletions
29
...com.github.seancorfield/expectations/hooks/com/github/seancorfield/expectations.clj_kondo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(ns hooks.com.github.seancorfield.expectations | ||
(:require [clj-kondo.hooks-api :as api])) | ||
|
||
(defn more-> [{:keys [node]}] | ||
(let [tail (rest (:children node)) | ||
rewritten | ||
(api/list-node | ||
(list* | ||
(api/token-node 'cond->) | ||
(api/token-node 'nil) | ||
tail))] | ||
{:node rewritten})) | ||
|
||
(defn more-of [{:keys [node]}] | ||
(let [bindings (fnext (:children node)) | ||
pairs (partition 2 (nnext (:children node))) | ||
rewritten | ||
(api/list-node | ||
(list* | ||
(api/token-node 'fn) | ||
(api/vector-node (vector bindings)) | ||
(map (fn [[e a]] | ||
(api/list-node | ||
(list | ||
(api/token-node 'expectations.clojure.test/expect) | ||
e | ||
a))) | ||
pairs)))] | ||
{:node rewritten})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters