Also is there no way to define 2 input dirs? previ...
# detekt
p
Also is there no way to define 2 input dirs? previously i was doing:
input = "${rootProject.projectDir}/app/","${rootProject.projectDir}/modules/"
and it worked perfectly. But now it even though i am using
files()
it tries to do a weird concatenation between those paths and fails to run.
m
I would expect
files
to take multiple arguments. So
files("/path/to/first/sources", "path/to/sources")
should work. See: https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#files-java.lang.Object...-
p
Unfortunately it does not. When given multiple files it fails to even start the detekt gradle task or misconstructs the path e.g. input = files(“a”,”b”) will fail with ParameterExcwption can not find path for absolutePathOfA*:*absolutePathOfB
Emphasis on the colon
m
The detekt-CLI is able to handle paths with a colon. So I guess this is the gradle plugin throwing this exception?
p
THe exception is thrown by the Gradle plugin yes. And it’s a Jcommander exception
I even tried omitting input but then it would still not run
We used input to specify that Detekt should check in the app module and the other folder containing the rest of modules.
I would expect it to run when not specified since all of those modules and app one, contain a src/main/java which is the default arg for input
m
That sounds correct to me. Detekt will just iterate into all subdirectories and fish out all the `kt`/`kts` files and analyze them
Can you open an Issue for this with your
detekt
configuration in your
build.gradle
file? Can you maybe also add a
debug = true
to the
detekt {}
closure and print the arguments we're passing to the CLI? Maybe there are some hints showing then
p
Did not think of turning debug on. Will certainly do and open an issue, in case i can not resolve it
Debug shows that it tries to pass the aforementioned paths as input:
--input, /absolute/path/to/app:/absolute/path/to/modules
m
Including the
,
? That looks a bit weird
The paths with the
:
should be fine. That's pretty much how I'd expect it to work
p
my suspicion is that since there is no delimiter for colon, it fails to split to a sequence and treats it as a single value.
i can not find where the concatenation with
:
happens though
the
,
i think is for printing purposes
m
Ah true
I think I found the culprit and this is indeed a bug
p
:
was removed as it was causing issues on Windows, as I saw on a commit. Might need to check what other changes this introduced
p
Yeap what I just said 😂
m
Yep. The COLON was initially added to support exactly what you described. But it was removed. Definitely a bug and something that we need to fix. Do you want to create an issue?
p
Sure, and I would be happy to even submit a PR since this is quite blocking for us, But i am not sure where the concatenation occurs, on the submitted paths
Hmm i think that i found the issue. Will try to fix it an submit a PR
m
💯
p
out of curiosity, how do you run Spek tests apart from executing the related Gradle task? Is there a plugin I should install?
m
There is a Plugin for IntelliJ, yes. But that also only works sometimes for me.
p
ok going to give it a try and see 🙂
m
Awesome! Thanks for the quick fix.
p
No problem. How are releases coordinated for such fixes? Do you know maybe?
m
Not sure. But if we get this fix and a couple more issues that are currently being worked on we might want to go for another RC release to iron out the last kinks before actually going to v1.0.0
p
ok, that makes sense! Thanks for explaining! Will look out for it being released once it’s ready 🙂
m
I guess until then you'd unfortunately have to stick to RC8 or create a custom 2nd detekt task that operates on the 2nd source set so that you'd run 2 detekt tasks each only taking one input path in RC9
p
I tried going back to RC8 but couldn’t 😕
m
If you define RC8 for the plugin version and specify
toolVersion
in the
detekt
closure to also target RC8 that should work
👍 1
p
Ohh yeap, i did not try that combination! I guess we will wait until the fix is released!