~kris/dots

srice

ref: e98f3b030dc24445bd55c68d95d2d81933fd68b3 srice/.local/bin/tkcheck -rw-r--r-- 734 bytes
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
# tkcheck -- find TK/TODO/XXX/FIXME/TBD markers across a project
set -euo pipefail

target="${1:-.}"
pattern='\bTK\b|TODO|XXX|FIXME|\bTBD\b|\bNOTE\b|\bHACK\b'

echo "Scanning for markers in: $target"
echo ""

if [ -f "$target" ]; then
    grep -n -E --color=always "$pattern" "$target" || echo "No markers found."
else
    results=$(grep -rn -E --color=always "$pattern" "$target" \
        --include='*.md' --include='*.mdx' --include='*.txt' \
        --include='*.tex' --include='*.rst' 2>/dev/null) || true
    if [ -n "$results" ]; then
        echo "$results"
        echo ""
        count=$(echo "$results" | wc -l)
        echo "$count marker(s) found."
    else
        echo "No markers found."
    fi
fi