Skip to content

Commit a6ccf56

Browse files
authored
Clearer output from lint scripts (#5820)
1 parent f250716 commit a6ccf56

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

scripts/check-goleak-files.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
set -euo pipefail
44

55
bad_pkgs=0
6+
total_pkgs=0
67
failed_pkgs=0
78

89
# shellcheck disable=SC2048
910
for dir in $*; do
11+
((total_pkgs+=1))
1012
if [[ -f "${dir}/.nocover" ]]; then
1113
continue
1214
fi
@@ -22,19 +24,18 @@ for dir in $*; do
2224
fi
2325
done
2426
if ((good == 0)); then
25-
echo "🔴 Error(check-goleak): no goleak check in package ${dir}"
27+
echo "Error(check-goleak): no goleak check in package ${dir}"
2628
((bad_pkgs+=1))
2729
if [[ "${dir}" == "./cmd/jaeger/internal/integration/" || "${dir}" == "./plugin/storage/integration/" ]]; then
28-
echo " this package is temporarily allowed and will not cause linter failure"
30+
echo " ... this package is temporarily allowed and will not cause linter failure"
2931
else
3032
((failed_pkgs+=1))
3133
fi
3234
fi
3335
done
3436

3537
function help() {
36-
echo " See https://github.com/jaegertracing/jaeger/pull/5010/files"
37-
echo " for examples of adding the checks."
38+
echo " See pkg/version/package_test.go as example of adding the checks."
3839
}
3940

4041
if ((failed_pkgs > 0)); then
@@ -44,4 +45,6 @@ if ((failed_pkgs > 0)); then
4445
elif ((bad_pkgs > 0)); then
4546
echo "🐞 Warning(check-goleak): no goleak check in ${bad_pkgs} package(s)."
4647
help
48+
else
49+
echo "✅ Info(check-goleak): no issues after scanning ${total_pkgs} package(s)."
4750
fi

scripts/check-test-files.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
set -euo pipefail
1010

1111
NO_TEST_FILE_DIRS=""
12+
total_pkgs=0
1213

1314
# shellcheck disable=SC2048
1415
for dir in $*; do
16+
((total_pkgs+=1))
1517
mainFile=$(find "${dir}" -maxdepth 1 -name 'main.go')
1618
testFiles=$(find "${dir}" -maxdepth 1 -name '*_test.go')
1719
if [ -z "${testFiles}" ]; then
@@ -42,4 +44,6 @@ if [ -n "${NO_TEST_FILE_DIRS}" ]; then
4244
echo "error: at least one *_test.go file must be in all directories with go files so that they are counted for code coverage" >&2
4345
echo " if no tests are possible for a package (e.g. it only defines types), create empty_test.go" >&2
4446
exit 1
47+
else
48+
echo "✅ Info(check-test-files): no issues after scanning ${total_pkgs} package(s)."
4549
fi

0 commit comments

Comments
 (0)