Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple config.edn files #336

Open
juszczakn opened this issue Feb 21, 2024 · 3 comments
Open

Support multiple config.edn files #336

juszczakn opened this issue Feb 21, 2024 · 3 comments

Comments

@juszczakn
Copy link

It's possible I'm just missing this and it's already possible, but it seems like cljfmt currently doesn't support a way to split up the config across multiple files?

clj-kondo supports projects exporting their own configs, such that downstream projects can import and make use of them. This sort of feature seems like it would be super helpful in cljfmt as well!

For example, a utility library that defines a common macro used by lots of projects could specify a cljfmt.edn, and downstream projects could choose to import and merge that config into their own root config in some way.

It wouldn't even necessarily have to be as complicated as what clj-kondo has, simply being able to specify other config files in your root config file, and having all the configs deep-merged into one seems like it would be a useful first step to me.

Something like being to specify this in your config.edn:

{:additional-configs ["../other-project/.cljfmt.edn"]}
@weavejester
Copy link
Owner

I don't believe there's any support for this currently. Allowing cljfmt to find config files on the classpath would be useful functionality. An :extra-configs or :include-configs key might also be useful.

@juszczakn
Copy link
Author

juszczakn commented Feb 21, 2024

@weavejester just made #337 as a quick poc, I have no idea if it's even correct, but something like that as the basic idea?

@juszczakn
Copy link
Author

@weavejester I updated the poc, I think it's at a state where it might be worthy of an initial code review, although it's still a little rough maybe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants