Fork me on GitHub
#clj-kondo
<
2021-02-16
>
verma00:02:11

I noticed that map-node stuff has been commented out in current master: https://github.com/clj-kondo/clj-kondo/blob/master/src/clj_kondo/impl/hooks.clj#L6

verma00:02:18

how would I go about creating a map-node?

verma00:02:01

I need to wrap my function args in a {:keys [..]} destructuring .. [a b c] -> {:keys [a b c]}

verma00:02:17

trying to create a parser for secretary.core/defroute .. which accepts arguments as [a b c] but when the named routes are called they are called as (my-route {:a a :b b :c c})

verma00:02:36

I can may be generate (defn route-name [args] (let [a (:a args) b (:b args) c (:c args)] ...)

verma00:02:52

but wondering if a quicker way

verma00:02:10

I went the wrap-with-let way

(defroute settings "/settings/:view" [view] ...)
==>
(defn settings [args] (let [view (:view args)] ...))

Bartosz Fic08:02:10

Hey guys I would like to run clj-kondo in jenkins Pipeline. Can you tell me preferable way to do it ?

borkdude08:02:10

@verma The map-node isn't available since there is also a namespaced-map-node of which the API isn't clear yet in rewrite-clj so I'm hesitant to expose the current one (cc @lee). But so far I haven't needed it to make hook code. Usually you can get away with what's already there.

Bartosz Fic09:02:11

I am using Jenkins for CI and I tried to do this in 3 ways: NPM package - I was trying to install clj-kondo as npm package locally in node_modules directory - I tried install it locally in /node_modules/clj-kondo/ - But I am getting error: spawn /node_modules/clj-kondo/unpacked_bin/clj-kondo ENOENT - npm i -g clj-kondo is also not working because I cannot locate clj-kondo from $PATH after installation - It works for me locally (without Jenkins) Command in /usr/local/bin - I was trying to curl the clj-kondo and run it - I've installed it successfully - And after installation Jenkins couldn’t find clj-kondo in $PATH (but it was there) Docker - I was trying to docker run borkdude/clj-kondo container - I had a problem with sharing mounted volume between host container and clj-kondo container - It couldn't even find conf file :( I feel I got stuck. Can you help me ?

borkdude09:02:22

@fic.bartosz I would not use the NPM package personally as it isn't maintained very well.

borkdude09:02:43

/usr/local/bin should work, but which binary did you curl and which OS do you have?

borkdude09:02:56

The Docker image is now on cljkondo/clj-kondo btw

borkdude09:02:16

If there are any docs mentioning borkdude/clj-kondo they should be changed

Bartosz Fic09:02:28

Is cljkondo/clj-kondo on docker hub ?

Bartosz Fic09:02:16

You were asking me about os: alpine linux

borkdude09:02:32

For Alpine you should download the linux static binary

borkdude09:02:37

the non-static one doesn't work

Bartosz Fic13:02:17

Hey I found this issue https://github.com/clj-kondo/clj-kondo/issues/703 and there is url to get artifact. But this url is not working anymore. Can you please share me another url ?

borkdude13:02:14

You can download the static binary from the release page, like always: https://github.com/clj-kondo/clj-kondo/releases/tag/v2021.02.13

Bartosz Fic15:02:06

@U04V15CAJ It is working as expected 🙂 Thank you very much for helping me 🙂 Good job !

borkdude13:02:08

Just published a video about the new clj-kondo release from last weekend here: https://youtu.be/OwekorWK3QA It's about core.match support and keyword analysis used by clojure-lsp.

wilkerlucio14:02:52

is there a linter in kondo to give errors when a keyword alias is used, but the namespace isn't imported? I guess that would be something like Unresolved keyword?

borkdude14:02:48

@wilkerlucio

$ clj-kondo --lint - <<< '::str/foo'
<stdin>:1:1: warning: Unresolved namespace str. Are you missing a require?

wilkerlucio14:02:34

oh, my fault, just realized I didn't have kondo setup properly in this project :face_palm: