From ba4651da576255d3a56c78bf8ddab7eb8ed47d8d Mon Sep 17 00:00:00 2001
From: Simon Deziel <simon.deziel@canonical.com>
Date: Tue, 9 Jul 2024 15:41:00 -0400
Subject: [PATCH] test/suites/static_analysis: skip doc/ directory

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
---
 test/suites/static_analysis.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/suites/static_analysis.sh b/test/suites/static_analysis.sh
index b9932b8e01db..6f7a35b31dbe 100644
--- a/test/suites/static_analysis.sh
+++ b/test/suites/static_analysis.sh
@@ -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 -v '^\./doc/' | 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 -v '^\./doc/' | 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 -v '^\./doc/' | grep '\.sh:' || true)"
     if [ -n "${OUT}" ]; then
       echo "ERROR: trailing space in script: ${OUT}"
       false