I have been using detekt to improve my code quality. I’ve downloaded default config file from the detekt.dev website and these errors comes into play:
Execution failed for task ':app:detekt'.
> Run failed with 12 invalid config properties.
- Property 'coroutines>SuspendFunSwallowedCancellation' is misspelled or does not exist.
- Property 'potential-bugs>CastNullableToNonNullableType' is misspelled or does not exist.
- Property 'potential-bugs>ElseCaseInsteadOfExhaustiveWhen>ignoredSubjectTypes' is misspelled or does not exist.
- Property 'style>BracesOnIfStatements' is misspelled or does not exist.
- Property 'style>BracesOnWhenStatements' is misspelled or does not exist.
- Property 'style>DataClassContainsFunctions>allowOperators' is misspelled or does not exist.
- Property 'style>DoubleNegativeLambda' is misspelled or does not exist.
- Property 'style>ForbiddenAnnotation' is misspelled or does not exist.
- Property 'style>StringShouldBeRawString' is misspelled or does not exist.
- Property 'style>UnusedParameter' is misspelled or does not exist.
- Property 'style>UnusedPrivateProperty' is misspelled or does not exist.
- Property 'style>UseIfInsteadOfWhen>ignoreWhenContainingVariableDeclaration' is misspelled or does not exist.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
>Solution :
Looks like you are using the latest stable version of the Detekt gradle plugin but not the config file.
The properties in your config file are not available yet in the stable release or are already outdated. You can either use the release candidate versions or just remove or comment on them.
I suggest using the latest release candidate, to use it change your plugin version from 1.22.0 to 1.23.0-RC3
I hope it’ll help. Let me know if you have any other questions.