Skip to content

Commit

Permalink
test/suites/static_analysis: DEBUG
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Jul 9, 2024
1 parent 7c52760 commit 3aecd61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/suites/static_analysis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ test_static_analysis() {
fi

## Functions starting by empty line
OUT=$(grep -r "^$" -B1 . 2>/dev/null | grep "func " | grep -v "}$" | grep -v "./lxd/sqlite/" || true)
OUT="$(grep -r "^$" -B1 . 2>/dev/null | grep "func " | grep -v "}$" | grep -v "./lxd/sqlite/" || true)"
if [ -n "${OUT}" ]; then
echo "ERROR: Functions must not start with an empty line: ${OUT}"
false
fi

## Mixed tabs/spaces in scripts
OUT=$(grep -Pr '\t' . 2>/dev/null | grep '\.sh:' || true)
OUT="$(grep -Pr '\t' . 2>/dev/null | grep '\.sh:' || true)"
if [ -n "${OUT}" ]; then
echo "ERROR: mixed tabs and spaces in script: ${OUT}"
false
fi

## Trailing space in scripts
OUT=$(grep -r " $" . 2>/dev/null | grep '\.sh:' || true)
OUT="$(grep -r " $" . 2>/dev/null | grep '\.sh:' || true)"
if [ -n "${OUT}" ]; then
echo "ERROR: trailing space in script: ${OUT}"
false
Expand Down

0 comments on commit 3aecd61

Please sign in to comment.