Is there a good way to temporarily run detekt with...
# detekt
l
Is there a good way to temporarily run detekt with the strictest possible ruleset? I’d like to be able to do housekeeping every once in a while, without adding too much restriction to the project most of the time.
l
Running with a baseline and removing the base line file might be a quick workaround
a
Just have a stricter rules file and swap that temporarily with the default one.
b
Stricter possible rules is tricky. There is a option to enable all the rules. But, usually, that's not what you want because there are some opinated or controversial rules on detekt.
l
Really? I treat detekt almost dogmatically 😂 Do you have an example of a rule that you feel might cause conflict in a team or that has had controversies before?
b
We cae about of the default configuration. In general there are not any controversial rule enabled by default. But we have rules that can be useful for some projects but not for others. Examples: •
AbsentOrWrongFileLicense
(or any one in the documentation) •
FunctionMaxLength
why on earth a long function name is a bad thing?
In general I think that it’s good to take the full configuration of detekt and talk with the team which rules you agree on and which don’t. And keep the configuration as something like that goes evolving. If you think that a rule is “important” but you never have time to handle it there is no point to keep it enabled.
If detekt makes far too much noise the people start ignoring it.