I tried running `AbsentOrWrongFileLicense` in my p...
# detekt
a
I tried running
AbsentOrWrongFileLicense
in my project, my
detekt
config.yml
file is inside a convention plugin. But
AbsentOrWrongFileLicense
is not detecting anything while If I enable the same rule in
detekt
repo
AbsentOrWrongFileLicense
is correctly detecting all the violations. Only difference is that in my setup
detekt
integration is inside my custom plugin while in
detekt
repo it is configure in top level
build.gradle
Below is my setup
Copy code
class CustomDetektPlugin : Plugin<Project>
{
    override fun apply(target: Project)
    {
        with(target) {
            apply<DetektPlugin>()
            extensions.configure<DetektExtension> {
                // If set to `true` the build does not fail when the
                // maxIssues count was reached. Defaults to `false`.
                ignoreFailures = false
                // point to your custom config defining rules to run, overwriting default behavior
                config.setFrom("$rootDir/Configs/config/detekt/detekt.yml")
                // a way of suppressing issues before introducing detekt
                baseline = file("$projectDir/config/detekt/baseline.xml")
                // Specify the base path for file paths in the formatted reports.
                // If not set, all file paths reported will be absolute file path.
                basePath = projectDir.toString()
                // Adds debug output during task execution. `false` by default.
                debug = true
                parallel = true
                buildUponDefaultConfig = true
                // Turn this on for auto correcting the code on Gradle build
                // autoCorrect = true
            }
            dependencies.add(CONFIGURATION_DETEKT_PLUGINS, libs.findLibrary("detekt.ktlint").get())

        }
    }
}
My rule setup is
Copy code
comments:
  active: true
  AbsentOrWrongFileLicense:
    active: true
    licenseTemplateFile: 'license.template'
    licenseTemplateIsRegex: true
I have license processor enabled as below
Copy code
processors:
  active: false
  exclude:
    - 'DetektProgressListener'
  # - 'KtFileCountProcessor'
  # - 'PackageCountProcessor'
  # - 'ClassCountProcessor'
  # - 'FunctionCountProcessor'
  # - 'PropertyCountProcessor'
  # - 'ProjectComplexityProcessor'
  # - 'ProjectCognitiveComplexityProcessor'
  # - 'ProjectLLOCProcessor'
  # - 'ProjectCLOCProcessor'
  # - 'ProjectLOCProcessor'
  # - 'ProjectSLOCProcessor'
  # - 'LicenseHeaderLoaderExtension'
AbsentOrWrongFileLicense
rule uses
UserDataHolder
. Can it be the case that
UserDataHolder
doesn't work inside a convention plugin?
Resolved.. My processor block was not active 😅
Copy code
processors:
  active: false