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

How to use detekt's XML report? #222

Open
jcornaz opened this issue Jul 5, 2019 · 3 comments
Open

How to use detekt's XML report? #222

jcornaz opened this issue Jul 5, 2019 · 3 comments
Labels

Comments

@jcornaz
Copy link

jcornaz commented Jul 5, 2019

Hello,

This plugin seems great, and we are eager to use it.

However, we already have detekt setup with baselines, and even custom rules we wrote ourselves.

So how can we tell Gnag to simply let our detekt plugin do its work and use the detekt XML report?

@stkent
Copy link
Collaborator

stkent commented Jul 5, 2019

Hi @jcornaz!

Gnag is designed to make it easy to add checkers to your project without requiring much (or any) custom configuration. As such, it is not set up to handle cases like yours (where you are providing quite a bit of custom configuration).

I see a couple options for how we could add "escape hatches" to Gnag to allow full customization of embedded tools:

  1. Add a catch-all parameter to the configuration blocks for each tool to accept a raw string of options to be passed to the underlying tool.
  2. Add the ability to specify custom paths to report files from external tools, and then process those files only (rather than first generating them). In your case, this option would mean you'd disable Detekt in the gnag configuration block, then point Gnag to the output of your customized Detekt task instead. There might also need to be some task dependency setup in this case to ensure the file is fresh when Gnag needs it.

Ultimately this is @btkelly's call to make - let's see what he thinks!

@stkent stkent added the question label Jul 5, 2019
@jcornaz
Copy link
Author

jcornaz commented Jul 5, 2019

Gnag is designed to make it easy to add checkers to your project without requiring much (or any) custom configuration. As such, it is not set up to handle cases like yours (where you are providing quite a bit of custom configuration).

That's very unfortunate. I just wanted a tool to automatically comments pull requests based on the detekt's finding. It looks like Gnag is not what I was looking for.

@Fleshgrinder
Copy link

Even a trivial setup in which you just want to use buildUponDefaultConfig = true is not possible, basically forcing you to copy the complete detekt configuration into your repository.

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

No branches or pull requests

3 participants