This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-29
Channels
- # announcements (17)
- # aws (12)
- # babashka (27)
- # beginners (85)
- # bristol-clojurians (1)
- # calva (16)
- # cider (3)
- # clara (7)
- # clojure (80)
- # clojure-europe (13)
- # clojure-italy (19)
- # clojure-nl (2)
- # clojure-norway (6)
- # clojure-poland (1)
- # clojure-spec (31)
- # clojure-uk (61)
- # clojurescript (29)
- # core-async (10)
- # cursive (7)
- # data-science (1)
- # datomic (29)
- # docker (3)
- # fulcro (120)
- # graphql (16)
- # hugsql (2)
- # leiningen (17)
- # luminus (2)
- # off-topic (36)
- # other-languages (3)
- # pathom (13)
- # re-frame (12)
- # ring (2)
- # rum (1)
- # shadow-cljs (126)
- # tools-deps (56)
- # vscode (5)
What is the purpose of lein check
? Does it catch anything that would be missed by compile
or uberjar
?
so if you have a project that doesn’t use :aot
(typical), then you haven’t necessarily ensured all your source files can compile
and lastly, lein check
will try to gather up all failures in one pass I believe. so it won’t necessarily stop after one and wait for a fix there, then have to rerun it for next one, etc
since you mentioned uberjar
above, it maybe the case you are using lein uberjar
with something like :aot :all
- which in that case the compile
prep-tasks
that is ran (by default) would catch most of the things lein check
would - but it’s only due to you having more things happening in that profile setup in this case.
and it’s still a potentially slower way, and more step-by-step failing way, to get similar info you’d get by lein check
Thanks @mikerod. We’re calling lein check as part of our CICD process, and I’m wondering if lein check is redundant with all the later steps (compile, uberjar, etc)
if you are using uberjar
+ :aot :all
or some sort of :aot
that includes all your relevant source files you want to ensure can compile,
eg :aot [my.top.level.ns]
,
then it is somewhat redundant for those cases
with the exception that you won’t get *warn-on-reflection*
for “free” if that matters to you
you can set :global-vars {*warn-on-reflection* true}
in the project.clj as well though to get similar even without necessarily using lein check
(I think it’ll be used during compile
as well this way)
I like having check as a separate step, because there's information in that failure (your code isn't loadable as it sits in the repo), while uberjar has other kinds of potential failure
I have a custom version of check which also looks at test files
@kingmob for a use case example: I'm doing a big whole-project refactor and as I iterate I want to ensure I don't break the codebase, so I do one part of the change at a time, and ensure lein check
passes
I don't need to make uberjars or compile classes - that's unrelated to my task
@noisesmith you can get lein check
to check more ns’s by adding them to :source-paths
- like in a profile