Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ jobs:
command: sudo apt-get install -y ripgrep
- run:
name: Check TODO issues
command: ./ops/scripts/todo-checker.sh --verbose <<#parameters.check_closed>> --check-closed <</parameters.check_closed>>
command: ./ops/scripts/todo-checker.sh --verbose --strict <<#parameters.check_closed>> --check-closed <</parameters.check_closed>>
- notify-failures-on-develop

fuzz-golang:
Expand Down
15 changes: 10 additions & 5 deletions ops/scripts/todo-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ for arg in "$@"; do
case $arg in
--strict)
FAIL_INVALID_FMT=true
VERBOSE=true
shift
;;
--verbose)
Expand All @@ -58,7 +59,7 @@ for arg in "$@"; do
done

# Use ripgrep to search for the pattern in all files within the repo
todos=$(rg -o --with-filename -i -n -g '!ops/scripts/todo-checker.sh' 'TODO\(([^)]+)\): [^,;]*')
todos=$(rg -o --with-filename -i -n -g '!ops/scripts/todo-checker.sh' -g '!packages/contracts-bedrock/lib' 'TODO\(([^)]+)\): [^,;]*')

# Check each TODO comment in the repo
IFS=$'\n' # Set Internal Field Separator to newline for iteration
Expand Down Expand Up @@ -88,14 +89,15 @@ for todo in $todos; do
else
if $FAIL_INVALID_FMT || $VERBOSE; then
echo -e "${YELLOW}[Warning]${NC} Invalid TODO format: $todo"
if $FAIL_INVALID_FMT; then
exit 1
fi
fi
((MISMATCH_COUNT++))
continue
fi

# Don't fetch issue status if we aren't checking for closed issues.
if ! $CHECK_CLOSED; then
continue
fi
# Use GitHub API to fetch issue details
GH_URL_PATH="$REPO_FULL/issues/$ISSUE_NUM"
# Grab the status code and response as a two item array [response, status]
Expand Down Expand Up @@ -164,7 +166,10 @@ if [[ $NOT_FOUND_COUNT -gt 0 ]]; then
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} ${CYAN}$MISMATCH_COUNT${NC} TODOs did not match the expected pattern. Run with ${RED}\`--verbose\`${NC} to show details."
echo -e "${RED}[Error]${NC} ${CYAN}$MISMATCH_COUNT${NC} TODOs did not match the expected pattern. Run with ${RED}\`--verbose\`${NC} to show details."
if $FAIL_INVALID_FMT; then
exit 1
fi
fi
if [[ $OPEN_COUNT -gt 0 ]]; then
echo -e "${GREEN}[Info]${NC} ${CYAN}$OPEN_COUNT${NC} TODOs refer to issues that are still open."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ contract DeputyGuardianModule_setRespectedGameType_Test is DeputyGuardianModule_
/// guardian.
function testFuzz_setRespectedGameType_succeeds(GameType _gameType) external {
// Game type(uint32).max is reserved for setting the respectedGameTypeUpdatedAt timestamp.
// TODO(kelvin): Remove this once we've removed the hack.
// TODO(#14638): Remove this once we've removed the hack.
uint32 boundedGameType = uint32(bound(_gameType.raw(), 0, type(uint32).max - 1));
_gameType = GameType.wrap(boundedGameType);

Expand Down