Skip to content

Commit

Permalink
Add sanity check to tell us if we're using log::warn! directly
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Dec 20, 2022
1 parent efc84fd commit f60019f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
run: |
./scripts/check-parity-bw-extrinsics-benchmarks-weights.sh
- name: Check for direct usage of log::warn vs. warn_or_panic in migrations
run: |
./scripts/check-usage-of-log-warn.sh
fmt:
name: Rustfmt
runs-on: ubuntu-latest
Expand Down
13 changes: 13 additions & 0 deletions scripts/check-usage-of-log-warn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -xeuo pipefail

OUTPUT=$(find . -wholename "*/migrations/*.rs" | xargs grep "log::warn" || true)
if [ -n "$OUTPUT" ]; then
echo "FAIL"
echo "$OUTPUT"
exit 1
fi

echo "PASS"
exit 0

0 comments on commit f60019f

Please sign in to comment.