Skip to content

Commit

Permalink
import clj-kondo settings from other PR
Browse files Browse the repository at this point in the history
  • Loading branch information
bhurlow authored and ieugen committed Sep 15, 2024
1 parent 4a2d58c commit fb0cce3
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:paths ["src/clj" "target/classes"]
{:paths ["resources" "src/clj" "target/classes"]
:deps {}
:deps/prep-lib {:alias :build
:fn compile
Expand All @@ -14,4 +14,4 @@
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}
:build {:deps {io.github.clojure/tools.build {:git/tag "v0.7.5" :git/sha "34727f7"}}
:ns-default build}}}
:ns-default build}}}
1 change: 1 addition & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

:min-lein-version "2.0.0"
:source-paths ["src/clj"]
:resource-paths ["resources"]
:java-source-paths ["src/java"]
:pedantic? :warn
:profiles {:dev {:dependencies [[org.clojure/clojure "1.10.3"]]}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(ns clj-kondo.claypoole
(:refer-clojure :exclude [future pmap pvalues])
(:require [clj-kondo.hooks-api :as api]))

(defn pool-and-body
[token]
(fn [{:keys [:node]}]
(let [[pool & body] (rest (:children node))
new-node (api/list-node
(list*
(api/token-node token)
(api/list-node
(list* (api/token-node 'do)
pool
body))))]
{:node (with-meta new-node
(meta node))})))

(defn pool-with-binding-vec-or-exprs-and-body
[token]
(fn [{:keys [:node]}]
(let [[pool binding-vec-or-exprs & body] (rest (:children node))
new-node (api/list-node
[(api/token-node token)
binding-vec-or-exprs
(api/list-node
(list* (api/token-node 'do)
pool
body))])]
{:node (with-meta new-node
(meta node))})))

(def future (pool-and-body 'future))
(def completable-future (pool-and-body 'future))
(def pdoseq (pool-with-binding-vec-or-exprs-and-body 'doseq))
(def pmap (pool-and-body 'map))
(def upmap (pool-and-body 'map))
(def pvalues (pool-and-body 'pvalues))
(def upvalues (pool-and-body 'pvalues))
(def pfor (pool-with-binding-vec-or-exprs-and-body 'for))
(def upfor (pool-with-binding-vec-or-exprs-and-body 'for))
18 changes: 18 additions & 0 deletions resources/clj-kondo.exports/clj-kondo/claypoole/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{:linters {:claypoole {:level :warning}}
:lint-as {com.climate.claypoole/with-shutdown! clojure.core/let}
:hooks {:analyze-call {com.climate.claypoole/future clj-kondo.claypoole/future
com.climate.claypoole/completable-future clj-kondo.claypoole/completable-future
com.climate.claypoole/pdoseq clj-kondo.claypoole/pdoseq
com.climate.claypoole/pmap clj-kondo.claypoole/pmap
com.climate.claypoole/upmap clj-kondo.claypoole/upmap
com.climate.claypoole/pvalues clj-kondo.claypoole/pvalues
com.climate.claypoole/upvalues clj-kondo.claypoole/upvalues
com.climate.claypoole/pfor clj-kondo.claypoole/pfor
com.climate.claypoole/upfor clj-kondo.claypoole/upfor
com.climate.claypoole.lazy/pdoseq clj-kondo.claypoole/pdoseq
com.climate.claypoole.lazy/pmap clj-kondo.claypoole/pmap
com.climate.claypoole.lazy/upmap clj-kondo.claypoole/upmap
com.climate.claypoole.lazy/pvalues clj-kondo.claypoole/pvalues
com.climate.claypoole.lazy/upvalues clj-kondo.claypoole/upvalues
com.climate.claypoole.lazy/pfor clj-kondo.claypoole/pfor
com.climate.claypoole.lazy/upfor clj-kondo.claypoole/upfor}}}

0 comments on commit fb0cce3

Please # to comment.