KT.FORBIDDEN_COMMENT

Comment which is forbidden in the codebase

This rule allows to set a list of comments which are forbidden in the codebase and should only be used during development. Offending code comments will then be reported.

Noncompliant Code

Copy
val a = "" // TODO: remove please
// FIXME: this is a hack
fun foo() { }
// STOPSHIP:

Options

  • values (default: ['fixme:', 'stopship:', 'todo:'])

    forbidden comment strings

  • allowedPatterns (default: ``)

    ignores comments which match the specified regular expression. For example Ticket|Task.

  • customMessage (default: ``)

    error message which overrides the default one

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