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
Introduce DefaultValue type #3928
Introduce DefaultValue type #3928
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3928 +/- ##
===========================================
+ Coverage 0 84.10% +84.10%
- Complexity 0 3290 +3290
===========================================
Files 0 475 +475
Lines 0 10808 +10808
Branches 0 2001 +2001
===========================================
+ Hits 0 9090 +9090
- Misses 0 690 +690
- Partials 0 1028 +1028
Continue to review full report at Codecov.
|
8eabb07
to
da46d4a
Compare
da46d4a
to
a0a1c2a
Compare
a0a1c2a
to
1c88c87
Compare
This will need to be reworked after #3964 is merged. |
1c88c87
to
8184dc7
Compare
This PR is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days. |
Can we follow up on this? |
Sorry, I have been "offline" for a while. Will try to update soon. |
8184dc7
to
8cc6367
Compare
Any thoughts on this? Does this make sense to you? |
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.
Sorry for the delay in the review. I didn't saw that this was ready to review. LGTM
override fun getAsPlainString(): String = defaultValue.toString() | ||
} | ||
|
||
private data class ListDefault(private val defaultValue: List<String>) : DefaultValue { |
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.
I would call this ListString
instead of List
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.
Do you mean ListDefault
➡️ ListStringDefault
? If so, I like the idea, but I would prefer StringListDefault
.
...r/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/collection/ConfigurationCollector.kt
Outdated
Show resolved
Hide resolved
...t-generator/src/main/kotlin/io/gitlab/arturbosch/detekt/generator/collection/DefaultValue.kt
Outdated
Show resolved
Hide resolved
...erator/src/test/kotlin/io/gitlab/arturbosch/detekt/generator/collection/RuleCollectorSpec.kt
Show resolved
Hide resolved
…efault-value # Conflicts: # detekt-generator/src/test/kotlin/io/gitlab/arturbosch/detekt/generator/collection/ConfigurationSpec.kt # detekt-generator/src/test/kotlin/io/gitlab/arturbosch/detekt/generator/collection/RuleSetProviderCollectorSpec.kt
This PR resolves #3910. The change set is greater than I anticipated but I think the collection and the generation are better separated now and there is less string manipulation magic involved.