Conversation
I was thinking before that this should be fixed in ktlint. But having a second round of thinking, I found an easy way to support both behaviors of the ktlint plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of questions, as I don't understand what's going on exactly. I will try to play with this branch myself and understand more.
plugin/src/main/groovy/com/novoda/staticanalysis/internal/ktlint/KtlintConfigurator.groovy
Outdated
Show resolved
Hide resolved
plugin/src/test/groovy/com/novoda/staticanalysis/internal/ktlint/KtlintIntegrationTest.groovy
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not merge this just now. Ktlint plugin is being updated again and will break backward compatibility again. I think I can still fix it.
But going forward, we should really think about implementing our own. It is not super easy but also not super hard.
Looking at sourcesets are enough for configuration.
22f3f40
to
cc13587
Compare
cc13587
to
5ab15b1
Compare
Hey @mr-archano, did some changes to support the upcoming ktlint changes. I think this is ready to review and merge. Once they publish the plugin, I will add new tests for Also had a small addition in test to enable the commented out test. |
@@ -63,6 +63,13 @@ ${project.additionalConfiguration} | |||
file.text = text | |||
} | |||
|
|||
public T copyIntoSourceSet(String sourceSet, File srcDir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@hal90002 retest this please |
Ktlint integration is fixed for 6.x and upcoming 7.x versions.
For Ktlint integration, we only depend on task names and a certain property (
reportOutputFiles
). Extracted taskmatching
into a function and support resolving the tasks from all versions of ktlint.Tests
6.1.0 is also fixed but has a bug affecting our test setup. I don't think it is worth to fix that only for tests. 6.2.x and 6.3.x are supported.Also enabled tests for
6.1.0
version by allowing test fixtures to be copied into the actual test project.