https://kotlinlang.org logo
#detekt
Title
# detekt
d

dimsuz

12/23/2021, 11:31 AM
Question to detekt maintainers/contributors. How do you usually debug issues with sample projects, what is the best flow for this? I mean if you presented with a project's zip-file, you unpack it, open detekt's
master
in your IDE and then...??? How would you go about attaching debugger to a detekt which is being run on that separate project. Or is it vice versa: you put log-statements in detekt's code, build jar and then run "detekt" task in the sample project?
g

gammax

12/23/2021, 11:33 AM
It really depends on the problem. If you share a zip-file reproducer, I just open it and run it. Try to add a couple of
println
if I can and I’ll debug that way. If I discover that the problem is inside Detekt codebase, then I’ll open the detekt project and use the debugger over there. You can also use Gradle composite build to plug detekt inside another project.
b

Brais Gabin

12/23/2021, 11:37 AM
As nico says: it depends. If the problem is a rule I execute the project to see it. Then I try to create an unit test to reproduce the issue and then I work from there. If the problem isn't in a rule I try to do the same but some times that's not easy. In those cases I use composite builds adding println where needed.
d

dimsuz

12/23/2021, 11:41 AM
Oh, nice, thanks for the tips! I wanted to help debug some issues I've reported, hoping I'll find some time.
❤️ 2
b

Brais Gabin

12/23/2021, 11:47 AM
Let us know if you need something else!
👍 1
g

gammax

12/23/2021, 12:17 PM
I wanted to help debug some issues I’ve reported, hoping I’ll find some time.
That’s awesome 🙏 Thanks for doing it