blob: 8011fd2812e86eae4f3d286a35c7ed5720fc2963 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/usr/bin/env bash
#
# The following scripts checks whether our invocations of the #[instrument] macro
# use skip_all and are at trace level. It's okay to have instrument macros that
# don't skip_all if the secuirty implications have been thought through. All of
# our instrument macros should be at trace, level, however.
set -euo pipefail
if grep -oPr --include \*.rs "#\[(tracing::)?instrument[(][^\]]+\].*" ./crates | grep -v skip_all; then
echo "Instrument macro is missing skip_all!"
echo "If you have thought through the security implication and this is intentional, add a comment like the following:"
echo ""
echo "#[instrument] // Intentionally omitting skip_all"
exit 1
fi
if grep -oPr --include \*.rs "#\[(tracing::)?instrument[(][^\]]+\].*" ./crates | grep -v trace; then
echo "Instrument macro is not at trace level!"
exit 1
fi
|