Use constant for supported Uncrustify version
Define and report the supported Uncrustify version (and remove extra
newlines from version output).
Signed-off-by: David Horstmann <david.horstmann@arm.com>
diff --git a/scripts/code_style.py b/scripts/code_style.py
index be333f0..4aa9a40 100755
--- a/scripts/code_style.py
+++ b/scripts/code_style.py
@@ -22,6 +22,7 @@
import sys
from typing import List
+UNCRUSTIFY_SUPPORTED_VERSION = "0.75.1"
CONFIG_FILE = "codestyle.cfg"
UNCRUSTIFY_EXE = "uncrustify"
UNCRUSTIFY_ARGS = ["-c", CONFIG_FILE]
@@ -125,10 +126,11 @@
"""
Main with command line arguments.
"""
- uncrustify_version = get_uncrustify_version()
- if "0.75.1" not in uncrustify_version:
+ uncrustify_version = get_uncrustify_version().strip()
+ if UNCRUSTIFY_SUPPORTED_VERSION not in uncrustify_version:
print("Warning: Using unsupported Uncrustify version '" \
- + uncrustify_version + "'", file=STDOUT_UTF8)
+ + uncrustify_version + "' (Note: The only supported version" \
+ "is " + UNCRUSTIFY_SUPPORTED_VERSION + ")", file=STDOUT_UTF8)
src_files = get_src_files()