echo-e"$YELLOW[Warning]:$NC Invalid TODO format: $todo"
if[[$FAIL_INVALID_FMT]];then
if$FAIL_INVALID_FMT||$VERBOSE;then
echo-e"${YELLOW}[Warning]:${NC} Invalid TODO format: $todo"
if$FAIL_INVALID_FMT;then
exit 1
fi
fi
...
...
@@ -76,12 +89,13 @@ for todo in $todos; do
fi
# Use GitHub API to fetch issue details
RESPONSE=$(curl -sL-H"$AUTH"--request GET "https://api.github.com/repos/$REPO_FULL/issues/$ISSUE_NUM")
GH_URL_PATH="$REPO_FULL/issues/$ISSUE_NUM"
RESPONSE=$(curl -sL-H"$AUTH"--request GET "https://api.github.com/repos/$GH_URL_PATH")
# Check if issue was found
if echo"$RESPONSE" | rg -q"Not Found";then
if[[$VERBOSE]];then
echo-e"$YELLOW[Warning]:$NC Issue not found: $RED$REPO_FULL/$ISSUE_NUM$NC"
echo-e"${YELLOW}[Warning]:${NC} Issue not found: ${RED}$REPO_FULL/$ISSUE_NUM${NC}"
fi
((NOT_FOUND_COUNT++))
continue
...
...
@@ -91,30 +105,44 @@ for todo in $todos; do
STATE=$(echo"$RESPONSE" | jq -r .state)
if[["$STATE"=="closed"]];then
echo-e"$RED[Error]:$NC Issue #$issue_num is closed. Please remove the TODO: $todo"
echo-e"${RED}[Error]:${NC} Issue #$ISSUE_NUM is closed. Please remove the TODO in ${GREEN}$FILE:$LINE_NUM${NC} referencing ${YELLOW}$ISSUE_REFERENCE${NC} (${CYAN}https://github.com/$GH_URL_PATH${NC})"
echo-e"$YELLOW[Warning]:$NC$NOT_FOUND_COUNT TODOs referred to issues that were not found."
echo-e"${YELLOW}[Warning]:${NC}${CYAN}$NOT_FOUND_COUNT${NC} TODOs referred to issues that were not found."
fi
if[[$MISMATCH_COUNT-gt 0 ]];then
echo-e"$YELLOW[Warning]:$NC$MISMATCH_COUNT TODOs did not match the expected pattern."
echo-e"${YELLOW}[Warning]:${NC}${CYAN}$MISMATCH_COUNT${NC} TODOs did not match the expected pattern. Run with ${RED}\`--verbose\`${NC} to show details."
fi
if[[$OPEN_COUNT-gt 0 ]];then
echo-e"$GREEN[Info]:$NC$OPEN_COUNT TODOs refer to issues that are still open."