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

Create a tool for rule authors to contribute to the default configuration #4457

Open
BraisGabin opened this issue Jan 5, 2022 · 3 comments

Comments

@BraisGabin
Copy link
Member

BraisGabin commented Jan 5, 2022

After merging #4315 that allow the rule authors to provide its own configuration we should provide a tool to generate those files and then document the feature.

We could document and then create the tool, but I think that it will be easier to create the tool than explain how to generate the config files by hand.


Right now inside :detekt-generator generates some files related with documentation and configuration of the rules that are in our own repo. Exactly:

  • Generates a .md with the documentation of the rules of each rule set. That information is extracted from the kdoc and annotations that the rules have.
  • Generates the config.yml file of :detekt-formatting. That information is extracted from the annotations that those rules have. (The generation of deket-default-config.yml is really similar but it's not exactly the same and that's something that only detekt needs)

With this issue what we want is to make the things that :detekt-generator does available for any rule author out there.

@VitalyVPinchuk
Copy link
Contributor

Hey @BraisGabin I'd like to work on this but need more profound description and some guidelines if you don't mind.

@BraisGabin
Copy link
Member Author

@VitalyVPinchuk I just updated the issue to give a bit more of context.

To be honest I don't know exactly what should be done here. I imagine the tool as a cli. Something like:

detekt-generator config path/to/rules >config.yml
detekt-generator documentation path/to/rules >documentation.md

Or even two cli:

detekt-config-generator path/to/rules >config.yml
detekt-documentation-generator path/to/rules >documentation.md

Once the cli is/are done we can wrap it/hem inside a gradle task. But that would be other task.

But this part is just an idea, the important thing is to have something that auto generates the config.yml file. The documentation has lower priority. And if it's not a cli that's ok too.

@cortinico
Copy link
Member

And if it's not a cli that's ok too.

A Gradle Task would also work imho

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

No branches or pull requests

3 participants