leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
borkdude 2019-11-28T12:13:19.157900Z

What's a better way of dealing with this problem?

borkdude 2019-11-28T12:13:36.158500Z

I.e. I want to have the version number in some other location than project.clj, so I can use it for other tooling as well

borkdude 2019-11-28T12:13:56.158800Z

So far this has worked, but now my linter is complaining about it ๐Ÿ˜‰

borkdude 2019-11-28T12:17:13.159Z

I guess I could just use a templating script

2019-11-28T14:29:40.159700Z

@borkdude by templating, do you mean generate project.clj?

borkdude 2019-11-28T14:30:19.159900Z

@sogaiu yeah, already fixed it: https://github.com/borkdude/clj-kondo/blob/missing-require/script/update-project.clj

๐Ÿ‘ 1
2019-11-28T22:02:11.161200Z

@borkdude I tend to put stuff like that in a car before the defproject to avoid so much read-eval macro literal things happening.

2019-11-28T22:02:18.161400Z

Inline

borkdude 2019-11-28T22:02:41.161600Z

car?

2019-11-28T22:02:59.161800Z

Var*

2019-11-28T22:03:07.162100Z

Typed from a phone with autocorrect hah

borkdude 2019-11-28T22:04:12.162400Z

oh I forgot you can do that in project.clj....

borkdude 2019-11-28T22:04:35.162600Z

lol, that makes it a lot simpler

2019-11-28T22:09:06.164900Z

Yeah. I may not have a good example but I believe inline reader eval dispatches can have strange behavior with symbol resolution as well. So I tend to push as much as I can into โ€œnormalโ€ code and then just refer to a var or call a fn from the reader dispatch form.

borkdude 2019-11-28T22:09:11.165100Z

so:

(require '[clojure.string :as str])
(defn version [] (str/trim (slurp "resources/CLJ_KONDO_VERSION")))
(defproject clj-kondo #=(version) ...)

2019-11-28T22:09:29.165500Z

Yeah like that.

2019-11-28T22:10:13.166500Z

Lein also supports the tilde as a special case within defproject, so like ~(version)

2019-11-28T22:10:31.167100Z

But according to a comment within the codebase that is deprecated for lein 3 hah

borkdude 2019-11-28T22:11:44.168100Z

I think I'll just stay with templating, since I already wrote it. I might also be able to grab the deps information from deps.edn and wrangle it in the project.clj or vice versa

2019-11-28T23:24:16.168400Z

Sure. I could see that