You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to thank you in advance for providing us such a helpful and cool tool!!
I understand that 100% coverage is a myth though, I would like to have an option that only shows the uncovered ones, if possible.
usage: go-carpet [options] [paths]
-256colors
use more colors on 256-color terminal (indicate the level of coverage)
-args string
pass additional arguments for go test
-file string
comma-separated list of files to test (default: all)
-func string
comma-separated functions list (default: all functions)
-include-vendor
include vendor directories for show coverage (Godeps, vendor)
+ -mincov int+ only show files that coverage were less than this value (default: 100)
-summary
only show summary for each file
-version
get version
My current workaround is to create a shell script as below. But it would be nice to have it by default.
#!/bin/bash
name_file_coverage='coverage.out'# getNameFilesUncovered echoes file names in comma-separated list which didn't# cover 100%. This will be used for “go-carpet` -file option.functiongetNameFilesUncovered() {
list=$(go tool cover -func="$name_file_coverage"| grep -v '100.0%\|init\|total'| awk '{print $1}')echo"$list"|while IFS= read -r line;do
basename "${line}"| sed -e 's/\.[^\.]*$/\.go/'done| uniq | tr '\n'','
}
# Run test and create cover profile
go test -timeout 30s -cover -v -coverprofile "$name_file_coverage" ./...
# Run go-carpet by specifing files into test
go-carpet -file "$(getNameFilesUncovered)"
The text was updated successfully, but these errors were encountered:
* chore: add test for `-mincov` option
* feat: "-mincov" option to set coverage threshold (issue #19)
* docs: add description of "-mincov" option
* chore: add more test for `-mincov` option (getCoverForDir)
* fix: skip files early on `getCoverForDir()`
See: #20 (comment)
* fix: remove redundant filtering
Filtering in `getCoverForDir()` is enough.
I would like to thank you in advance for providing us such a helpful and cool tool!!
I understand that 100% coverage is a myth though, I would like to have an option that only shows the uncovered ones, if possible.
My current workaround is to create a shell script as below. But it would be nice to have it by default.
The text was updated successfully, but these errors were encountered: