[PATCH 2/3] check-syntax: ignore "bad" astyle versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Create a list of known bad versions of astyle and ignore them.

Signed-off-by: Paul Moore <paul@xxxxxxxxxxxxxx>
---
 tools/check-syntax | 31 ++++++++++++++++++++-----------
 1 file changed, 20 insertions(+), 11 deletions(-)

diff --git a/tools/check-syntax b/tools/check-syntax
index 2775eb46c6c4..c55c51420142 100755
--- a/tools/check-syntax
+++ b/tools/check-syntax
@@ -54,17 +54,26 @@ EOF
 #     1    Source file
 #
 function tool_c_style() {
-	astyle --options=none --lineend=linux --mode=c \
-		--style=linux \
-		--indent=force-tab=8 \
-		--indent-col1-comments \
-		--min-conditional-indent=0 \
-		--max-continuation-indent=80 \
-		--pad-oper \
-		--align-pointer=name \
-		--align-reference=name \
-		--max-code-length=80 \
-		--break-after-logical < "$1"
+	# filter on astyle version
+	case "$(astyle -V)" in
+	"Artistic Style Version 3.6.3")
+		# continuation lines indented vs aligned
+		cat "$1"
+		;;
+	*)
+		astyle --options=none --lineend=linux --mode=c \
+			--style=linux \
+			--indent=force-tab=8 \
+			--indent-col1-comments \
+			--min-conditional-indent=0 \
+			--max-continuation-indent=80 \
+			--pad-oper \
+			--align-pointer=name \
+			--align-reference=name \
+			--max-code-length=80 \
+			--break-after-logical < "$1"
+		;;
+	esac
 }
 
 #
-- 
2.47.0





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux