clj-kondo

https://github.com/clj-kondo/clj-kondo
verma 2021-02-16T00:01:11.195500Z

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

verma 2021-02-16T00:01:18.195900Z

how would I go about creating a map-node?

verma 2021-02-16T00:02:01.196800Z

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

verma 2021-02-16T00:03:17.198100Z

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})

verma 2021-02-16T00:04:36.199100Z

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

verma 2021-02-16T00:04:52.199400Z

but wondering if a quicker way

verma 2021-02-16T00:44:10.199900Z

I went the wrap-with-let way

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

2021-02-16T08:20:10.200100Z

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

borkdude 2021-02-16T08:47:10.201400Z

@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.

borkdude 2021-02-16T08:47:43.201700Z

@fic.bartosz We have a CI integration doc page here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/ci-integration.md

đź‘Ť 1
2021-02-16T09:28:11.202400Z

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 <https://npm.io/package/clj-kondo> 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 ?

borkdude 2021-02-16T09:30:22.202600Z

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

borkdude 2021-02-16T09:30:43.202800Z

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

borkdude 2021-02-16T09:30:56.203Z

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

borkdude 2021-02-16T09:31:16.203200Z

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

2021-02-16T09:32:28.203400Z

Is cljkondo/clj-kondo on docker hub ?

borkdude 2021-02-16T09:33:23.203600Z

yes

borkdude 2021-02-16T09:34:11.203800Z

We have docs here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/docker.md

2021-02-16T09:34:16.204200Z

You were asking me about os: alpine linux

borkdude 2021-02-16T09:34:32.204400Z

For Alpine you should download the linux static binary

borkdude 2021-02-16T09:34:37.204600Z

the non-static one doesn't work

2021-02-16T13:20:17.204800Z

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 ?

borkdude 2021-02-16T13:21:14.205100Z

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

borkdude 2021-02-16T13:56:08.205400Z

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.

wilkerlucio 2021-02-16T14:34:52.206200Z

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?

borkdude 2021-02-16T14:35:48.206600Z

@wilkerlucio

$ clj-kondo --lint - &lt;&lt;&lt; '::str/foo'
&lt;stdin&gt;:1:1: warning: Unresolved namespace str. Are you missing a require?

wilkerlucio 2021-02-16T14:36:34.206700Z

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

2021-02-16T15:26:06.206900Z

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

borkdude 2021-02-16T15:26:40.207100Z

:thumbsup: