ignore
Ignores check on a declaration that carries one of the whenAnnotatedWith annotations. An annotation is its fully qualified class name:
import org.jetbrains.kotlinx.library.api.watchdog.WatchdogChecks
apiWatchdog {
ignore(
WatchdogChecks.STATEFUL_CLASS_WITHOUT_EQUALS,
whenAnnotatedWith = listOf(
"com.example.GeneratedValue",
"com.example.GeneratedEntity",
),
)
}With recursive, the annotation on a class, a function, or a file also ignores the check on every declaration nested in it. Default is false. Without it, the rule covers an enclosing class only when the @Intentionally* annotation of the check does.
An always-error check doesn't have a severity property, so ignore rejects it.
See Exemptions and internal API for more details about when to use a rule.
Ignores check on a declaration that carries the whenAnnotatedWith annotation. The same as the overload that takes a list of annotations:
apiWatchdog {
ignore(WatchdogChecks.STATEFUL_CLASS_WITHOUT_EQUALS, whenAnnotatedWith = "com.example.GeneratedValue")
}Ignores every check in checks on a declaration that carries one of the whenAnnotatedWith annotations. The same as a call of the single-check overload for each check:
apiWatchdog {
ignore(
listOf(
WatchdogChecks.STATEFUL_CLASS_WITHOUT_EQUALS,
WatchdogChecks.STATEFUL_CLASS_WITHOUT_HASH_CODE,
),
whenAnnotatedWith = listOf(
"com.example.GeneratedValue",
"com.example.GeneratedEntity",
),
)
}Ignores every check in checks on a declaration that carries the whenAnnotatedWith annotation. The same as a call of the single-check overload for each check:
apiWatchdog {
ignore(
listOf(
WatchdogChecks.STATEFUL_CLASS_WITHOUT_EQUALS,
WatchdogChecks.STATEFUL_CLASS_WITHOUT_HASH_CODE,
),
whenAnnotatedWith = "com.example.GeneratedValue",
)
}