Is there an API in the detekt gradle plugin for lo...
# detekt
e
Is there an API in the detekt gradle plugin for loading a config from a jar (e.g. from maven central)? Or would I have to use Gradle APIs to extract the config file from the jar?
b
There's nothing in the Detekt plugin as far as I know.
e
So I'd have to extract the file from the jar, put it in the filesystem, and then point the config parameter at it?
b
Yes, that's one way. Have a versioned file and use https://github.com/michel-kraemer/gradle-download-task is other option.
e
Any opposition to a contribution that allows a config to specified from a maven artifact?
b
I don't think we would like to add that complexity to our current plugin.
e
What if it wasn't complex 😅
b
Honestly, missing artifact config support is one of the biggest pain point with using detekt at the moment... Just look how popular eslint config packages are on npm to see the benefits of it.
b
I mean, I'm not against it directly. But I think that something like that was proposed already. A good issue explaining use cases and links to those other tools is always appreciated.
To be honest, I also think that the configuration of detekt is one of the biggest pain points of detekt 1.0 but I never thought that making it "sharable" would help. I would like to hear your ideas :). Detekt is a community project so please open an issue with pain points, use cases, examples... Anything that could help to make detekt better.
e
I'll open an issue later today with my use case
b
Please post back the link here. I'd like to butt in some ideas too
@Brais Gabin Took a quick look and I think this could be done by having a
detektConfig
configuration the same way that there's a
detektPlugin
configuration. Would you be OK with something like that if it works? Seems relatively simple to do.
b
I don't follow what you mean with that. And I think it's better to keep the conversation of this on the issue so anyone can follow the progress. For example 3flex is the main contributor to see detekt gradle plugin and I think it's not here.
Don't hesitate to
@
me there if you want my direct feedback :)
So if you can write an example there would be great :)
e
I added as a comment on that issue
b
Answered. It looks like a nice api.