Does someone have a custom script or Gradle task t...
# detekt
j
Does someone have a custom script or Gradle task to merge detekt reports on the root directory? I had a workaround that was running detekt on the root project over all files, but it is problematic with Gradle 8
s
j
wow, I didn't know that exists, it will not work with project isolation, but it will be better than the workaround I just get working now and it was scaling really... bad
@Sebastian Schuberth it only works with one kind of output, right? is it not possible to merge all types?
it is not working for me
image.png
s
I believe it works for most report formats, like SARIF and XML, but not for e.g. MD, see https://github.com/detekt/detekt/issues/5034
j
I created a reportMerge task for each type of file, the
detekt
dir is created at the root build dir, but there are no files
I will remove md and retry, but looks like I am doing something wrong
image.png
After deleting the md task, it still doesn't work
after moving to finalizedBy and some fixes it works, but sadly it doesn't work with html which is what I was looking for 😞
e
Don't the gradle docs recommend not starting to address project isolation yet?
j
I didn't create an issue because, AFAIK, Detekt is applied to only one project, so there is no cross project configurations which can break project isolation
other different things is that there aren't merged reports and the proposed solutions are not project isolation friendly tho
e
I want a multimodule repo to use a single baseline. Because, as far as I can tell, the IntelliJ plug-in only supports a single baseline file. The proposed setup uses cross configuration which I’m not keen on introducing.
j
But that is not related to project isolation support AFAIK
you can use the same file in all projects as you can access to that file without referencing any project, for example,
rootDir.resolve("my common detekt file")
e
Each task to generate baseline overwrites the previous baseline instead of aggregating into it
j
Ah, right. Then maybe the refactor is more needed, cc @Brais Gabin
b
I never used the intellij plugin but, to me, that sounds like a missing feature in it. It should support multiple baselines.
I must say that I like to have each module with their own baselines.
e
Would be terrific if the IntelliJ plugin supported wildcard matchers (
**/detekt-baseline.xml
) 🙂
b
If you can, open an issue on the plugin repo.
I don't usually follow that repo but I'm sure that any pr on that regard will be more than welcome.
e