go-cover-ignore

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 7 Imported by: 0

README

Go Cov

Go cov is a simple tool to filter out results from the go test coverage profile. This usually means that we'll filter out generated files for which we don't want to write unit tests. However, we don't want these files to negatively impact our overall test coverage.

The rool reads a given coverage profile, filters out the lines that match the specified regulare expressions in the .coverage-ignore.yaml and writes the result back to the coverage report.

Installing

go install github.com/wimspaargaren/go-cover-ignore@latest

Running

GO_COVER_IGNORE_SPEC_PATH=".coverage-ignore.yaml" GO_COVER_IGNORE_COVER_PROFILE_PATH="cover.out" go-cover-ignore

Coverage Ignore Yaml

The program expectes a file called .coverage-ignore.yaml to be specified, which has the following structure:

module: "github.com/<my_org>/<my_project>"
ignore_rules:
    - <my_regex_to_ignore>

Documentation

Overview

Package main provides a simple tool removing ignored files from the code coverage report.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL