Review how global suppressions are made in default config. #4924
TWiStErRob
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
In theory, I understand the value of your suggestion (i.e. using Practically, this suffers of two problems:
|
Beta Was this translation helpful? Give feedback.
3 replies
-
I would like to add to this discussion that the current default exclusion method has some issues:
TheRule
excludes: []
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
History
Some time ago the only way to suppress was a global
filters = '.*/test/.*'
or--filter
.Then came
Both of these were deprecated in favor of the new:
which we could configure per rule giving us way more flexibility.
Now the latest addition is suppressors.
Proposal
With every new (more specific) way of suppression the exclusions were migrated to the new solution. I think there might be time for another look at the
**
excludes and use the newignore*
solutions where possible. This would help improve the quality of test code bases around the world.Background
#4921 (comment) triggered me to write this recommendation.
Some arguments
Tests are sometimes even more important to be readable than production code as they define what the production code should be doing. You can have golfed Kotlin code in production, if you have tests, you know what it is doing.
If test break, we should be able to see why it broke in order to know if it's the test or the production code broken, because these require different actions.
Based on this: helper functions, utility classes, fixture factories, etc. shouldn't have long names, or allow for wildcard imports, magic numbers, magic strings, etc.
Tests protect us making mistakes in the production code, but if they're internally broken, they don't help much; to bring an analogy: "one wouldn't want a shield with holes in it".
Beta Was this translation helpful? Give feedback.
All reactions