Hi there,
I’d like to request an extension to the configuration options - allowing to exclude files from coverage.
In some language you can exclude an entire file from coverage using a comment at the top of the file - for example in python:
# pragma: no cover
# ... rest of code
Or using Istanbul in JS:
/* Istanbul ignore: next */
// ... rest of code
But in other languages, for example Golang, you cannot skip coverage at all or cannot skip it for files. Some files though are either untestable, or include code that should not be tested - being a waste of time.
For example, I define a datatypes package that is shared with DTOs. The file only contains structs with json tags. While I can nominally test it to get coverage, this is a waste of my time.
I can exclude this file from analysis altogether, but than I wont have other useful metrics such as documentation coverage etc.
What I would like to do is to be able to exclude the file from the coverage analyer - and only from it:
``toml
[[analyzers]]
name = “test-coverage”
enabled = true
coverage_exclude_patterns = [
“services//internal/dto/.go”
]
For example. This can of course be more flexible - like in sonarQube, to have include patterns etc.