KT.ABSENT_OR_WRONG_FILE_LICENSE

Source file doesn't have the required license header

This rule will report every Kotlin source file which doesn't have the required license header. The rule validates each Kotlin source and operates in two modes: if licenseTemplateIsRegex = false (or missing) the rule checks whether the input file header starts with the read text from the passed file in the licenseTemplateFile configuration option. If licenseTemplateIsRegex = true the rule matches the header with a regular expression produced from the passed template license file (defined via licenseTemplateFile configuration option).

Options

  • licenseTemplateFile (default: license.template)

    path to file with license header template resolved relatively to config file

  • licenseTemplateIsRegex (default: False)

    whether or not the license header template is a regex template

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