bradleyfalzon / revgrep

Filters output from static analysis tools, showing only recently changed lines of code
Apache License 2.0
103 stars 15 forks source link

Document or handle passing along exit code #4

Closed bradleyfalzon closed 8 years ago

bradleyfalzon commented 8 years ago

It maybe beneficial to pass along the exit status of the underly static analysis tool.

See below, the refgrep tool's exit code is 0, whereas go vet was 1. This is normal for grep behaviour, and technically expected, however, refgrep could decide to set its own exit code to 1 if entries match OR just document the use of $PIPESTATUS or set -o pipefail

[bradleyf@srv4 dir (master *)]$ go vet
main.go:5: missing argument for Sprintf("%s"): format reads arg 1, have only 0 args
exit status 1
[bradleyf@srv4 dir (master *)]$ echo $?
1
[bradleyf@srv4 dir (master *)]$ go vet | refgrep
main.go:5: missing argument for Sprintf("%s"): format reads arg 1, have only 0 args
[bradleyf@srv4 dir (master *)]$ echo $?
0
bradleyfalzon commented 8 years ago

Fixed in 8d814c0640f3a2fe43f767556d6beddb842d9844