Skip to content

how to deactivate MagicNumber issues for 'when' branches in detekt.yml #3796

Discussion options

You must be logged in to vote

I don't know that I agree with the assessment that this would be a valid use case where those numbers should not be considered magic numbers. Maybe there is a different way to model your domain?

But to answer your question; your are right, there is no option to disable magic number detection for when expressions. You can of course disable the rule altogether or add @Suppress("MagicNumber") to the expression.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@christian-draeger
Comment options

@marschwar
Comment options

@christian-draeger
Comment options

@cortinico
Comment options

@radekjezdik
Comment options

Answer selected by schalkms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants