-
-
Notifications
You must be signed in to change notification settings - Fork 798
Cleaner merging of Gradle blocks for functionalTests #5830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...-gradle-plugin/src/testFixtures/kotlin/io/gitlab/arturbosch/detekt/testkit/DslTestBuilder.kt
Fixed
Show fixed
Hide fixed
Codecov Report
@@ Coverage Diff @@
## main #5830 +/- ##
=========================================
Coverage 84.59% 84.59%
Complexity 3790 3790
=========================================
Files 546 546
Lines 12918 12918
Branches 2268 2268
=========================================
Hits 10928 10928
Misses 861 861
Partials 1129 1129 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -25,37 +27,40 @@ constructor( | |||
private val rootDir: File = Files.createTempDirectory("applyPlugin").toFile().apply { deleteOnExit() } | |||
private val randomString = UUID.randomUUID().toString() | |||
|
|||
@Language("gradle.kts") |
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.
TIL you can do this with "gradle.kts"
👀
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.
Funny thing: I only learned this 2 days ago while writing this PR too :)
Before that I knew kotlin
and gradle
were languages, but recently I was having chats about .gradle.kts
files as convention plugins (which are way awesome btw), so while I was writing these annotations I just naturally wrote it, and it worked! 😅
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.
👏👏👏 Good one! And the diff of those two files looks WAY WAY better.
Follow-up on #5819 (comment)
Related #5827
Closes #5828
Changes:
@Language
annotations, the build code in functionalTests will be highlighted properly (requires trimMargin removal).|
being present in the input string,@Suppress("TrimMultilineRawString")
reIndent
andmergeGradleBlocks
.Their usages are pretty localized and make the fragment re-use be at a higher level of abstraction (like
"""$a $b"""
->merge(a, b)
).You can look at the resulting changes by diffing these two files (note: console output trims empty lines so the effect of
\n\n
is not clearly visible here, but it is in the JUnit test report):main.txt
pr.txt