-
-
Notifications
You must be signed in to change notification settings - Fork 797
Deprecate ignoreOverriddenFunction/s in favor of ignoreOverridden #2132
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
Codecov Report
@@ Coverage Diff @@
## master #2132 +/- ##
============================================
+ Coverage 81.2% 81.34% +0.13%
- Complexity 2064 2067 +3
============================================
Files 340 341 +1
Lines 5910 5965 +55
Branches 1076 1085 +9
============================================
+ Hits 4799 4852 +53
+ Misses 535 532 -3
- Partials 576 581 +5
Continue to review full report at Codecov.
|
Cool, looks good to me. I also like the approach to print deprecation messages in val DEPRECATED_PROPERTIES = CommaSeparatedPattern(setOf(
".*>.*>ignoreOverriddenFunction",
".*>.*>ignoreOverriddenFunctions"
).joinToString(",")).mapToRegex()
@Suppress("UNCHECKED_CAST", "ComplexMethod")
fun validateConfig(
config: Config,
baseline: Config,
excludePatterns: Set<Regex> = CommaSeparatedPattern(DEFAULT_PROPERTY_EXCLUDES).mapToRegex()
): List<Notification> {
....
fun testKeys(current: Map<String, Any>, base: Map<String, Any>, parentPath: String?) {
for (prop in current.keys) {
val propertyPath = "${if (parentPath == null) "" else "$parentPath>"}$prop"
if (excludePatterns.any { it.matches(propertyPath) }) {
continue
}
if (DEPRECATED_PROPERTIES.isNotEmpty() && DEPRECATED_PROPERTIES.any { it.matches(propertyPath) }) {
notifications.add(propertyIsDeprecated(propertyPath))
}
....
} |
I did the change, but if I add something to notifications the build run fails. So they are not warnings, they are errors. Do I add a level to the In the other hand the notification is not really useful:
It say that they're deprecated but the messages don't point out how to fix them. |
Ok, I did some little changes to this PR and I added a new property |
detekt-cli/src/main/kotlin/io/gitlab/arturbosch/detekt/cli/runners/Runner.kt
Outdated
Show resolved
Hide resolved
Ah, I totally missed your message. Level sounds good to me. Lets introduce a third level |
Done |
Closes #2096
EmptyFunctionBlock
,FunctionParameterNaming
andMemberNameEqualsClassName
uses the configuration flagignoreOverriddenFunction(s)
but the rest of rules uses the genericignoreOverridden
. This PR change this to get an API a bit more consistent.