File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ jobs:
33
33
path : target_branch_dir
34
34
ref : ${{ github.base_ref }}
35
35
36
- - name : Compare panics, expects, and unwraps between source and target brach
36
+ - name : Compare panics, expects, and unwraps between source and target branch
37
37
run : |
38
38
for branch_dir in source_branch_dir target_branch_dir; do
39
39
cd $branch_dir
40
- echo "Calculating violations in & branch_dir..."
41
- VIOLATIONS=$(nix develop -c cargo clippy --no-deps -- -W clippy::unwrap_used -W clippy::expect_used -W clippy::panic 2> >(grep -e "warning: \`panic\`" -e "warning: used" -e "warning: usage of" | wc -l ))
40
+ echo "Calculating violations in $ branch_dir..."
41
+ VIOLATIONS=$(nix develop -c cargo clippy --no-deps -- -W clippy::unwrap_used -W clippy::expect_used -W clippy::panic 2> >(grep -e "warning: \`panic\`" -e "warning: used" -e "warning: usage of" | tee violations.txt | wc -l ))
42
42
echo $VIOLATIONS > violations
43
43
cd ..
44
44
done
49
49
echo "You added panic/unwrap/expect, in this PR their count increased from $TARGET_VIOLATIONS to $SOURCE_VIOLATIONS."
50
50
echo "These calls can kill the REPL, try alternative error handling."
51
51
echo ""
52
+ echo "New violations:"
53
+ diff target_branch_dir/violations.txt source_branch_dir/violations.txt | grep "^>" || true
54
+ echo ""
52
55
echo "TIP: Ask AI \"In rust, how can I rewrite code that contains panic or unwrap so it doesn't crash?\""
53
56
echo ""
54
57
echo "If you believe your panic/unwrap/expect is justified, ask Anton-4, rtfeldman or lukewilliamboswell to bypass this workflow failure."
You can’t perform that action at this time.
0 commit comments