File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 3
3
set -euo pipefail
4
4
5
5
bad_pkgs=0
6
+ total_pkgs=0
6
7
failed_pkgs=0
7
8
8
9
# shellcheck disable=SC2048
9
10
for dir in $* ; do
11
+ (( total_pkgs+= 1 ))
10
12
if [[ -f " ${dir} /.nocover" ]]; then
11
13
continue
12
14
fi
@@ -22,19 +24,18 @@ for dir in $*; do
22
24
fi
23
25
done
24
26
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} "
26
28
(( bad_pkgs+= 1 ))
27
29
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"
29
31
else
30
32
(( failed_pkgs+= 1 ))
31
33
fi
32
34
fi
33
35
done
34
36
35
37
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."
38
39
}
39
40
40
41
if (( failed_pkgs > 0 )) ; then
@@ -44,4 +45,6 @@ if ((failed_pkgs > 0)); then
44
45
elif (( bad_pkgs > 0 )) ; then
45
46
echo " 🐞 Warning(check-goleak): no goleak check in ${bad_pkgs} package(s)."
46
47
help
48
+ else
49
+ echo " ✅ Info(check-goleak): no issues after scanning ${total_pkgs} package(s)."
47
50
fi
Original file line number Diff line number Diff line change 9
9
set -euo pipefail
10
10
11
11
NO_TEST_FILE_DIRS=" "
12
+ total_pkgs=0
12
13
13
14
# shellcheck disable=SC2048
14
15
for dir in $* ; do
16
+ (( total_pkgs+= 1 ))
15
17
mainFile=$( find " ${dir} " -maxdepth 1 -name ' main.go' )
16
18
testFiles=$( find " ${dir} " -maxdepth 1 -name ' *_test.go' )
17
19
if [ -z " ${testFiles} " ]; then
@@ -42,4 +44,6 @@ if [ -n "${NO_TEST_FILE_DIRS}" ]; then
42
44
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
43
45
echo " if no tests are possible for a package (e.g. it only defines types), create empty_test.go" >&2
44
46
exit 1
47
+ else
48
+ echo " ✅ Info(check-test-files): no issues after scanning ${total_pkgs} package(s)."
45
49
fi
You can’t perform that action at this time.
0 commit comments