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
how would I go about creating a map-node?
I need to wrap my function args in a {:keys [..]}
destructuring .. [a b c] -> {:keys [a b c]}
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})
I can may be generate (defn route-name [args] (let [a (:a args) b (:b args) c (:c args)] ...)
but wondering if a quicker way
I went the wrap-with-let way
(defroute settings "/settings/:view" [view] ...)
==>
(defn settings [args] (let [view (:view args)] ...))
Hey guys I would like to run clj-kondo in jenkins Pipeline. Can you tell me preferable way to do it ?
@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.
@fic.bartosz We have a CI integration doc page here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/ci-integration.md
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 ?
@fic.bartosz I would not use the NPM package personally as it isn't maintained very well.
/usr/local/bin
should work, but which binary did you curl and which OS do you have?
The Docker image is now on cljkondo/clj-kondo
btw
If there are any docs mentioning borkdude/clj-kondo
they should be changed
Is cljkondo/clj-kondo
on docker hub ?
yes
We have docs here: https://github.com/clj-kondo/clj-kondo/blob/master/doc/docker.md
You were asking me about os: alpine linux
For Alpine you should download the linux static binary
the non-static one doesn't work
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 ?
You can download the static binary from the release page, like always: https://github.com/clj-kondo/clj-kondo/releases/tag/v2021.02.13
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.
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
?
$ clj-kondo --lint - <<< '::str/foo'
<stdin>:1:1: warning: Unresolved namespace str. Are you missing a require?
oh, my fault, just realized I didn't have kondo setup properly in this project :face_palm:
@borkdude It is working as expected 🙂 Thank you very much for helping me 🙂 Good job !
:thumbsup: