Is there an easy way to get the relative path to a...
# detekt
s
Is there an easy way to get the relative path to a file WRT the Gradle root project in a `Rule`'s
visitPackageDirective
function?
I'm current using
directive.containingKtFile.name
which return the absolute path. Does a detekt rule even know about the Gradle project structure?
b
It does not. But right now there's a PR that implements exactly that: https://github.com/detekt/detekt/pull/3319 the initial idea was for reporting proposes but you could use it.
c
Hopefully it will arrive soon.
s
Thanks for pointing out that PR to me, I'll continue commenting over there!
❤️ 1