-
Notifications
You must be signed in to change notification settings - Fork 4
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
Global configuration as resource #8
Comments
@vemv You can do this by adding the config to a dependency in Just make sure that library with exported config isn't used by anyone else, since exported configs should normally be just be about one specific library. |
Nice! Got it, thanks |
I kept thinking about my scenario and perhaps a .jar isn't the best solution to begin with. We use a plugin similar to https://github.com/achin/lein-parent . So a kondo config could be defined in a parent project as Lein config. Example: ;; project.clj
:clj-kondo {:config {:linters {:docstring-leading-trailing-whitespace {:level :warning}
:reduce-without-init {:level :warning}
:single-key-in {:level :warning}
:used-underscored-binding {:level :warning}}}} This would be similar to Eastwood config (which also is often expresed inline in project.clj or deps.edn) and overall a pretty vanilla feature that could serve various use cases. PR OK? |
I'm fine with this, as long as it doesn't raise the expectation that "vanilla" clj-kondo supports reading configs from project.clj. |
Maybe you're not aware of this, but if the shared config is part of a git mono-repo, say in |
Yes, I had heard of monorepo niceties, however I'm using a polyrepo in this scenario |
OK, even if you have polyrepos it works, as long as the directory structure matches. If the directory doesn't exist, then it won't crash, but it will just not include the config. |
* Bump clj-kondo * Translate :clj-kondo config expressed in Leiningen project maps Closes #8
Hey there,
for a particular scenario I'd like to have a clj-kondo config released as a resource in a .jar and consumed from lein-clj-kondo.
The use case is definining org-wide preferences, etc.
I wonder if this is something that is possible OOTB already, or would it need some hacking?
The main feature/constraint is that the config should be a resource, not a file.
Maybe one could specify this as a Lein plugin option?
{:config-resources ["mega/corp/clj_kondo_config.edn"]}
which the plugin would convert into anio/resource
call, slurp it, and pass that edn as https://github.com/clj-kondo/clj-kondo/blob/ab3172541dd07e52486962c762c6bd739ab25a09/src/clj_kondo/main.clj#L41-L42WDYT?
The text was updated successfully, but these errors were encountered: