Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat config property deprecations as errors #2545

Closed
arturbosch opened this issue Mar 28, 2020 · 3 comments · Fixed by #3026
Closed

Treat config property deprecations as errors #2545

arturbosch opened this issue Mar 28, 2020 · 3 comments · Fixed by #3026

Comments

@arturbosch
Copy link
Member

Expected Behavior

Implement an option to fail the build if any deprecated properties are used:

config:
  validation: true
  warningsAsErrors: true
  excludes: ...

Current Behavior

New behavior treats them as warnings which do not fail the build.

Context

Old behavior treated them as errors which was considered a bug due to updating the detekt version should not unexpectedly break the build - #2523

@NullByte08
Copy link

Current Behaviour

New behavior treats them as warnings which do not fail the build.

and issue title says

Treat config property deprecations as errors

I am confused whether to treat them as errors in my code or not.

I encountered an error
Task :app:detekt Property 'complexity>LongParameterList>threshold' is deprecated. Use 'functionThreshold' and 'constructorThreshold' instead. naming - 5min debt PackageNaming - [HotspotNotificationManager.kt] at F:\Kiwix\kiwix-android\app\src\main\java\org\kiwix\kiwixmobile\webserver\wifi_hotspot\HotspotNotificationManager.kt:18:1 Overall debt: 5min

Is there an error in my code, or should I just replace the deprecated property threshold(if yes then with functionThreshold or contructorThreshold?) ?

@arturbosch
Copy link
Member Author

Current Behaviour

New behavior treats them as warnings which do not fail the build.

and issue title says

Treat config property deprecations as errors

I am confused whether to treat them as errors in my code or not.

Hi @NullByte08 ,
it depends. The default behavior prints a warning. If you want to migrate the properties right away on detekt upgrade, you might want to add warningsAsErrors: true. It's like with compiler warnings. If you want a zero warnings polity, feel free to turn this option on.

I encountered an error
Task :app:detekt Property 'complexity>LongParameterList>threshold' is deprecated. Use 'functionThreshold' and 'constructorThreshold' instead. naming - 5min debt PackageNaming - [HotspotNotificationManager.kt] at F:\Kiwix\kiwix-android\app\src\main\java\org\kiwix\kiwixmobile\webserver\wifi_hotspot\HotspotNotificationManager.kt:18:1 Overall debt: 5min

Is there an error in my code, or should I just replace the deprecated property threshold(if yes then with functionThreshold or contructorThreshold?) ?

There is no error. We just deprecated threshold in favor of two new properties, one just for functions, one just for constructors.
Add both new properties:

LongParameterList:
active: true
functionThreshold: 6
constructorThreshold: 7
ignoreDefaultParameters: false
ignoreDataClasses: true
ignoreAnnotated: []

@NullByte08
Copy link

@arturbosch Ok I am removing threshold and adding those properties. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants