Skip to content

Commit 217a9df

Browse files
committed
Squashed 'tools/' changes from 1fe184f..ccc8316
ccc8316 Revert "Gocyclo should return error code if issues detected" (#124) git-subtree-dir: tools git-subtree-split: ccc831682b5d51e068b17fe9ad482f025abd1fbb
1 parent 93d5cb1 commit 217a9df

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lint

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ lint_go() {
9494
# don't have it installed. Also never blocks a commit,
9595
# it just warns.
9696
if type gocyclo >/dev/null 2>&1; then
97-
cycloutput=$(gocyclo -over 25 "${filename}")
98-
if [ -n "$cycloutput" ]; then
99-
lint_result=1
100-
echo "${filename}": higher than 25 cyclomatic complexity - "${cycloutput}"
101-
fi
97+
gocyclo -over 25 "${filename}" | while read -r line; do
98+
echo "${filename}": higher than 25 cyclomatic complexity - "${line}"
99+
done
102100
fi
103101

104102
return $lint_result

0 commit comments

Comments
 (0)