33 lines
725 B
Bash
33 lines
725 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Description:
|
|
# Search source files for special comment markers (TODO, FIXME, NOTE, HACK)
|
|
# while excluding certain paths like scripts/ by default.
|
|
#
|
|
# Usage:
|
|
# ./find-comments.sh [path]
|
|
# path Optional. Defaults to current directory.
|
|
|
|
set -e
|
|
|
|
# Default search directory
|
|
DIR="${1:-.}"
|
|
|
|
# Tags to search for
|
|
TAGS='TODO|FIXME|NOTE|HACK|BUG|XXX|OPTIMIZE|REFACTOR|DEPRECATED|UNDONE'
|
|
|
|
|
|
# Excluded directories (can be expanded)
|
|
EXCLUDES=(
|
|
'--glob=!scripts/**'
|
|
'--glob=!build/**'
|
|
'--glob=!.git/**'
|
|
)
|
|
|
|
# Header
|
|
echo -e "\033[1;33m🔍 Scanning for: ${TAGS}\033[0m"
|
|
echo -e "In directory: \033[1;36m$DIR\033[0m"
|
|
echo
|
|
|
|
# Execute ripgrep
|
|
rg -n --color=always -e "($TAGS)" "${EXCLUDES[@]}" "$DIR"
|