diff --git a/.github/checks/safety.sh b/.github/checks/safety.sh index f8f91815c0..546126b758 100755 --- a/.github/checks/safety.sh +++ b/.github/checks/safety.sh @@ -14,6 +14,7 @@ code sanity checker -l check for let _ -e check for expect -d check for dbg! + -t check for todo! -x check for std::process::exit -b check for bracket access -c check for pedantic and other checks @@ -25,14 +26,14 @@ EOF files=$(find . -name '*.rs' | grep -v -f .checkignore) -while getopts hauiprebldxcf opt; do +while getopts hauiprebldxcft opt; do case $opt in h) help exit 0 ;; a) - exec "$0" -uirpeldxcf + exec "$0" -uirpeldxcft ;; u) for file in $files @@ -99,6 +100,18 @@ while getopts hauiprebldxcf opt; do fi done ;; + t) + for file in $files + do + if sed -e '/mod test.*/,$d' -e '/ALLOW: /{N;d;}' "$file" | grep 'todo!' > /dev/null + then + echo "##[error] todo! found in \"$file\". Just do it!." + grep -nH 'todo!' "$file" + count=$((count + 1)) + fi + done + ;; + x) for file in $files diff --git a/src/sink/tcp.rs b/src/sink/tcp.rs index 87b8570aeb..3937e603de 100644 --- a/src/sink/tcp.rs +++ b/src/sink/tcp.rs @@ -148,6 +148,6 @@ impl Sink for Tcp { } } fn is_active(&self) -> bool { - todo!() + self.stream.is_some() } }