WatchdogGradleExtension
The apiWatchdog block: the enabled switch and the severity of each configurable diagnostic. Default severity is WatchdogSeverity.ERROR unless the property states another.
See Configuration for more details.
apiWatchdog {
undocumentedPublicApi = WatchdogSeverity.WARNING
dataClassPublicApi = WatchdogSeverity.NONE
}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 with different positions for shared parameters.
Severity of INLINE_FUNCTION_WITH_LOGIC: inline functions and accessors that do more than delegate.
Fully qualified names of annotation classes that mark internal API, besides those that carry @InternalAnnotationMarker. The watchdog skips the declarations under such an annotation, and PUBLIC_TYPE_WITH_INTERNAL_API reports a public declaration that exposes a type marked with it. Use it for the internal-API annotation of a dependency:
The Java-interop diagnostics, see WatchdogJavaInteropExtension.
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_TYPE_FROM_NON_TRANSITIVE_DEPENDENCY runs. Default is true. A violation is always an error. To accept the types of selected dependencies, declare them on the apiWatchdogExemptNonTransitive configuration instead.
Whether PUBLIC_TYPE_WITH_INTERNAL_API runs. Default is true. A violation is always an error. @IntentionallyExposedInternalApiForBackwardsCompatibility exempts a published declaration.
The formats of the report that generateApiWatchdogReport and exemptExistingApi write, see WatchdogReports. Both formats are on by default.
Whether UNDOCUMENTED_PUBLIC_API reports the member properties of a class. Default is false, because the check doesn't read the @property tags of the class KDoc.
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 without markers.
Whether the build warns when neither the Kotlin Gradle plugin's ABI validation nor the Binary Compatibility Validator plugin is active. Default is true.
Severity of UNDOCUMENTED_PUBLIC_API: public declarations without KDoc. Default is WatchdogSeverity.WARNING.
Functions
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:
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:
Ignores check on a declaration that carries the whenAnnotatedWith annotation. The same as the overload that takes a list of annotations:
Ignores check on a declaration that carries one of the whenAnnotatedWith annotations. An annotation is its fully qualified class name:
Configures javaInterop.
Configures reports.