Discourage use of :nocov: code comment
Problem
The use of Simplecov's # :nocov: (see docs) code comment excludes code from the coverage report.
Currently, there are 31 instances of # :nocov::
Click to expand
# :nocov: the class including this concern is expected to test this method.# :nocov:# :nocov: the class including this concern is expected to test this method.# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov: Tested on subclasses.# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:# :nocov:
Proposed solution
As mentioned by @tkuah using # :nocov: "skews the percentage % of this Performance Indicator (https://about.gitlab.com/handbook/engineering/development/performance-indicators/#backend-unit-test-coverage)".
Any code should be covered by tests/specs. For this reason we should:
- Mention ban of
:nocov:in development guidelines - Add a
👮 rule to flag its use - !92671 (merged)
Refs
@tkuah: I think we should discourage
:nocov:as it skews the percentage % of this Performance Indicator (https://about.gitlab.com/handbook/engineering/development/performance-indicators/#backend-unit-test-coverage).
Edited by Peter Leitzen