WatchdogGradleExtension

open class WatchdogGradleExtension(objectFactory: ObjectFactory)(source)

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
}
}

Constructors

Link copied to clipboard
constructor(objectFactory: ObjectFactory)

Properties

Link copied to clipboard

Severity of BOOLEAN_PARAMETER_PUBLIC_API: Boolean parameters of public functions.

Link copied to clipboard

Severity of DATA_CLASS_PUBLIC_API: data classes in the public API.

Link copied to clipboard

Severity of DSL_MARKER_NOOP_TARGET: DSL marker targets without scope-control effect.

Link copied to clipboard

Severity of DSL_MARKER_NOOP_TYPE_POSITION: DSL markers on type positions without effect.

Link copied to clipboard

Severity of DSL_MARKER_WITHOUT_EXPLICIT_TARGETS: DSL markers with the default target set.

Link copied to clipboard

Severity of EXHAUSTIVE_PUBLIC_API: exhaustively matchable enums and sealed hierarchies.

Link copied to clipboard

Severity of FUNCTION_TYPE_ALIAS_PUBLIC_API: type aliases that abbreviate function types.

Link copied to clipboard

Severity of INCONSISTENT_PARAMETER_ORDER_IN_OVERLOADS: overloads disagreeing on shared parameter order.

Link copied to clipboard

Severity of INLINE_FUNCTION_WITH_LOGIC: inline functions and accessors doing more than delegating.

Link copied to clipboard

The Java-interop diagnostic group: its off-switch and the individual severities.

Link copied to clipboard

Severity of MUTABLE_COLLECTION_PUBLIC_API: mutable collections and arrays in public signatures.

Link copied to clipboard

Severity of NULLABLE_BOOLEAN_PUBLIC_API: nullable Booleans in public signatures.

Link copied to clipboard

Severity of OPEN_API_WITHOUT_SUBCLASS_OPT_IN: unrestricted external subclassing.

Link copied to clipboard

Severity of PAIR_OR_TRIPLE_PUBLIC_API: Pair and Triple in public signatures.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Severity of REQUIRED_PARAMETER_AFTER_OPTIONAL: required parameters declared after optional ones.

Link copied to clipboard

Severity of STATEFUL_CLASS_WITHOUT_EQUALS: stateful classes without an equals implementation.

Link copied to clipboard

Severity of STATEFUL_CLASS_WITHOUT_HASH_CODE: stateful classes without a hashCode implementation.

Link copied to clipboard

Severity of STATEFUL_CLASS_WITHOUT_TO_STRING: stateful classes without a toString implementation.

Link copied to clipboard

Severity of SUBCLASS_OPT_IN_WITHOUT_MARKERS: @SubclassOptInRequired with no markers.

Link copied to clipboard

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.

Link copied to clipboard

Severity of UNDOCUMENTED_PUBLIC_API: public declarations without KDoc.

Functions

Link copied to clipboard

Configures the javaInterop diagnostic group.