KT.BOOLEAN_PROPERTY_NAMING

Boolean property doesn't match a pattern

Reports when a boolean property doesn't match a pattern.

Noncompliant Code

Copy
val progressBar: Boolean = true

Compliant Code

Copy
val hasProgressBar: Boolean = true

Options

  • allowedPattern (default: ^(is|has|are))

    naming pattern

  • ignoreOverridden (default: True)

    ignores properties that have the override modifier

The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html