-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import clj-kondo settings from other PR
- Loading branch information
Showing
4 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
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
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
41 changes: 41 additions & 0 deletions
41
resources/clj-kondo.exports/clj-kondo/claypoole/clj_kondo/claypoole.clj
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,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
18
resources/clj-kondo.exports/clj-kondo/claypoole/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,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}}} |