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>
This commit is contained in:
David Horstmann 2022-12-08 14:44:36 +00:00
parent 9711f4eeb4
commit 2cf779ceff

View file

@ -22,6 +22,7 @@ import subprocess
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 @@ def main() -> int:
"""
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()