Getting Schema validation: Incompatible types in detekt.yml in Android Studio

305 Views Asked by At

Any way I can fix the schema warning in detekt.yml I am attaching the screenshot and open to add more details

Minimum reproducible detekt.yml below

build:
  maxIssues: 0
  excludeCorrectable: false
  weights:
     complexity: 2
     LongParameterList: 1
     style: 1
     comments: 1

config:
  validation: true
  warningsAsErrors: true
  # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]'
  excludes: ''

processors:
  active: true
  exclude:
    - 'DetektProgressListener'
  # - 'KtFileCountProcessor'
  # - 'PackageCountProcessor'
  # - 'ClassCountProcessor'
  # - 'FunctionCountProcessor'
  # - 'PropertyCountProcessor'
  # - 'ProjectComplexityProcessor'
  # - 'ProjectCognitiveComplexityProcessor'
  # - 'ProjectLLOCProcessor'
  # - 'ProjectCLOCProcessor'
  # - 'ProjectLOCProcessor'
  # - 'ProjectSLOCProcessor'
  # - 'LicenseHeaderLoaderExtension'

style:
  active: true
  ReturnCount:
    active: true
    max: 2
    excludedFunctions: 'equals'
    excludeLabeled: false
    excludeReturnFromLambda: true
    excludeGuardClauses: true

Android version: Android Studio Dolphin | 2021.3.1 Patch 1 Build #AI-213.7172.25.2113.9123335, built on September 30, 2022 Runtime version: 11.0.13+0-b1751.21-8125866 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

Okay after some exploration I found out, in the detekt release v1.21.0 they changed all their configuration from comma-separated string to array of string in detekt.yml.

So initially it used to be excludedFunctions: 'equals, hashCode' now they have become excludedFunctions: ['equals', 'hashCode']

After detekt release v1.22.0, they started throwing error while building the project.