Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove todo macro from tcp sink. #573

Merged
merged 2 commits into from
Nov 6, 2020
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
17 changes: 15 additions & 2 deletions .github/checks/safety.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sink/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ impl Sink for Tcp {
}
}
fn is_active(&self) -> bool {
todo!()
self.stream.is_some()
}
}