cljfmt icon indicating copy to clipboard operation
cljfmt copied to clipboard

Do you want the `project.clj` file to be included by default for lein projects?

Open jacobemcken opened this issue 3 years ago • 1 comments

I am seeing this: https://github.com/weavejester/cljfmt/blob/1003c677200e90bc19f7c8d83ea58bd17b900a5e/cljfmt/src/cljfmt/main.clj#L169

But the project.clj file is ignored when running lein cljfmt check (empty configuration), unless I specifically specify it (lein cljfmt check project.clj).

I've narrowed it down to (seq paths) never being empty when the paths come from the Leiningen plugin: https://github.com/weavejester/cljfmt/blob/1003c677200e90bc19f7c8d83ea58bd17b900a5e/cljfmt/src/cljfmt/main.clj#L216

Do you want a PR changing lein-cljfmt to always include the project.clj file?

I was thinking that it could look something like (changing lein-cljfmt/src/leiningen/cljfmt.clj):

-           (filter #(and (.exists %) (.isDirectory %)))))))
+           (filter #(and (.exists %) (.isDirectory %)))
+           (concat '("project.clj"))))))

It seems to be a good fit since the project file is lein specific anyway.

jacobemcken avatar Dec 05 '22 11:12 jacobemcken

This seems a reasonable change.

weavejester avatar Dec 08 '22 19:12 weavejester