Skip to content

Commit

Permalink
fix: incorrect log about fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Oct 4, 2023
1 parent 0b37fe0 commit 99b1689
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/summary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ Scanned/Changed scripts: \`${#list_of_changed_scripts[@]}\`
get_number_of () {
[[ $# -le 0 ]] && return 1

jq '.defects | length' "../${1}.log"
file="../${1}.log"
[[ -s "${file}" ]] || return 1

jq '.defects | length' "${file}"
}

# Create full Markdown style link to results
Expand Down
7 changes: 5 additions & 2 deletions src/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ get_fixes () {
# It expects file '../fixes.log' to contain fixes
# $? - return value is always 0
evaluate_and_print_fixes () {
if [[ -s ../fixes.log ]]; then
gather_statistics "../fixes.log"

num_of_fixes=$(get_number_of fixes)
if [[ "${num_of_fixes}" -gt 0 ]]; then
echo -e "${GREEN}Fixed defects${NOCOLOR}"
csgrep --embed-context 2 ../fixes.log
else
Expand All @@ -45,7 +48,7 @@ evaluate_and_print_defects () {
gather_statistics "../defects.log"

num_of_defects=$(get_number_of defects)
if [[ -s ../defects.log ]] && [[ "${num_of_defects}" -gt 0 ]] ; then
if [[ "${num_of_defects}" -gt 0 ]] ; then
print_statistics

echo -e "${YELLOW}Defects, NEEDS INSPECTION${NOCOLOR}"
Expand Down

0 comments on commit 99b1689

Please sign in to comment.