WatchdogGradleExtension
Configures the severity of each configurable watchdog diagnostic. Every configurable diagnostic is reported as an error unless demoted to WatchdogSeverity.WARNING or disabled with WatchdogSeverity.NONE here:
apiWatchdog {
undocumentedPublicApi = WatchdogSeverity.WARNING
dataClassPublicApi = WatchdogSeverity.NONE
}The Java-interop diagnostics live in the javaInterop group. They only pay off for libraries with Java consumers, so the group has one off-switch - a Kotlin-only library disables all of them at once, no matter what the individual severities say:
apiWatchdog {
javaInterop {
enabled = false
}
}Properties
Severity of BOOLEAN_PARAMETER_PUBLIC_API: Boolean parameters of public functions.
Severity of DATA_CLASS_PUBLIC_API: data classes in the public API.
Severity of DSL_MARKER_NOOP_TARGET: DSL marker targets without scope-control effect.
Severity of DSL_MARKER_NOOP_TYPE_POSITION: DSL markers on type positions without effect.
Severity of DSL_MARKER_WITHOUT_EXPLICIT_TARGETS: DSL markers with the default target set.
Severity of EXHAUSTIVE_PUBLIC_API: exhaustively matchable enums and sealed hierarchies.
Severity of FUNCTION_TYPE_ALIAS_PUBLIC_API: type aliases that abbreviate function types.
Severity of INCONSISTENT_PARAMETER_ORDER_IN_OVERLOADS: overloads disagreeing on shared parameter order.
Severity of INLINE_FUNCTION_WITH_LOGIC: inline functions and accessors doing more than delegating.
The Java-interop diagnostic group: its off-switch and the individual severities.
Severity of MUTABLE_COLLECTION_PUBLIC_API: mutable collections and arrays in public signatures.
Severity of NULLABLE_BOOLEAN_PUBLIC_API: nullable Booleans in public signatures.
Severity of OPEN_API_WITHOUT_SUBCLASS_OPT_IN: unrestricted external subclassing.
Severity of PAIR_OR_TRIPLE_PUBLIC_API: Pair and Triple in public signatures.
Whether public signatures may only expose types from dependencies published transitively to consumers. Enabled by default. Unlike design diagnostics, a violation is always an error and has no source exemption or warning severity. Setting this Gradle property to false is the check's only off-switch.
Whether PUBLIC_TYPE_WITH_INTERNAL_API is checked. Enabled by default. A violation is always an error when enabled. This Boolean property is the check's only off-switch.
Severity of REQUIRED_PARAMETER_AFTER_OPTIONAL: required parameters declared after optional ones.
Severity of STATEFUL_CLASS_WITHOUT_EQUALS: stateful classes without an equals implementation.
Severity of STATEFUL_CLASS_WITHOUT_HASH_CODE: stateful classes without a hashCode implementation.
Severity of STATEFUL_CLASS_WITHOUT_TO_STRING: stateful classes without a toString implementation.
Severity of SUBCLASS_OPT_IN_WITHOUT_MARKERS: @SubclassOptInRequired with no markers.
Whether to suggest enabling binary compatibility validation when neither the Kotlin Gradle plugin's built-in ABI validation nor the standalone Binary Compatibility Validator plugin is active. The watchdog reviews the shape of new API declarations, while binary compatibility validation guards the API that already shipped, so the plugin recommends it with a build warning. true by default, set to false to silence the suggestion.
Severity of UNDOCUMENTED_PUBLIC_API: public declarations without KDoc.
Functions
Configures the javaInterop diagnostic group.