I'm having trouble deciding on a linter to use. Ideally I want the linter to be compatible with Intellij + cursive and vim environment, and my plan is to make an on commit check that runs the linter with GitHub actions. Any help would be great!
All the editor integration you could want with clj-kondo https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md
@jr0cket I saw this clj-kondo, is it a good linter for running a commit check / GitHub actions and have you see any example repos that have it implemented as a github action?
I havent used yet, but there seems to be solutions on the GitHub marketplace https://github.com/marketplace/actions/setup-clj-kondo Or you can just include clj-kondo in your own GitHub action https://rymndhng.github.io/2020/04/03/Integrate-clj-kondo-with-Github-Actions/ https://github.com/marketplace/actions/clj-kondo-checks
Thanks!
clj-kondo
is far and away the most sophisticated and best supported linter for Clojure these days.
Thanks
Check out the #clj-kondo channel if you have any questions @kevin26428
I have a (gen-class :name proj.translator.MyClass ...)
in ns proj.translator
. In proj.core
, I refer to proj.translator.MyClass
, which works fine in 'interactive use' (where :aot proj.translator
is the only entry). When I run lein uberjar
, I also set :aot :all
, which leads to proj.core
being compiled as well; it is at this point that lein complains with a ClassNotFoundException that proj.translator.MyClass
is not found (as it hasn't been compiled yet). Is there anything I can do to make this work? Perhaps some import/require statement?
it seems that compilation happens in alphabetical order, which is clearly not what I want. Is my only practical option to rename proj.translator
to proj.aaaaaatranslator
? It works, but feels ridiculous ๐
If your proj.core
ns requires your proj.translator
ns then it should get AOT'd in the correct order.
(because AOT is transitive)
Hi! Does anyone have an easy way of injecting git commit info (e.g. result of โgit rev-parse --short HEADโ) into a deps.edn build? I have found https://github.com/day8/lein-git-inject for leiningen. Thanks!
I do, but it's not public yet :)
Thank you. Good to know!
How to restart a component, for example responsive for db pooling or amqp/kafka connections, when connection goes down for a few seconds? Im referring to Stuart Sierra Component
Usually a component will wrap something like a connection pool, not a single connection
And the connection pool creates new connections as required, so you don't restart the component
Hello all, I have this
(def active (atom true))
(-> (proxy [Thread] []
(run []
(while @active
(println "Loop")
(Thread/sleep 1000))))
(.start))
to stop it, I have to (reset! active false)
Is there any way to control running process instead of using external atom?Using future-cancel
(def work (future (while (not (Thread/interrupted))
(println [(new java.util.Date) (reduce + (range 1e8))]))))
=> #'user/work
[#inst "2020-09-27T14:31:42.790-00:00" 4999999950000000]
[#inst "2020-09-27T14:31:44.070-00:00" 4999999950000000]
(future-cancel work)
=> true
[#inst "2020-09-27T14:31:45.271-00:00" 4999999950000000]
No
But use future, or just pass function to thread's constructor (they are runnable)
@hiredman do you think itยดs better using future
with future-cancel
?
using an atom is best
is not that ugly way using atom?
you are using state shared between threads
atom
you say that you can stop all thread once?
what?
don't def a global of course
so, how to use it from inside proxy
?
a. don't use proxy, as I said b. proxy, reify, fns, etc will close over locals
(let [stop? (atom false)] (future (while (not @stop) ...)) ... (reset! stop? true))
errr
missed some parens
ok, sure, understood