From b524c28d53cfd3accc2120fab30947d8fc2eb844 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 11 Oct 2015 18:31:39 +0200 Subject: [PATCH] Improved output text - Capitalized SQF everywhere - Break checked files and errors into multiple lines - Add a break by line between reported errors and result - Fix incorrect report message for semi-columns - Change excessive usage of # prints on start --- tools/sqf_validator.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index 6cfa3e4db3..d76434f81d 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -113,7 +113,7 @@ def check_sqf_syntax(filepath): if (c not in [' ', '\t', '\n', '/']): # keep reading until no white space or comments checkForSemiColumn = False if (c not in [']', ')', '}', ';', ',', '&', '!', '|', '='] and not validKeyWordAfterCode(content, indexOfCharacter)): # , 'f', 'd', 'c', 'e', 'a', 'n', 'i']): - print("ERROR: Possible missing semi-column ':' detected at {0} Line number: {1}".format(filepath,lineNumber)) + print("ERROR: Possible missing semi-column ';' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 else: # Look for the end of our comment block @@ -139,9 +139,7 @@ def check_sqf_syntax(filepath): def main(): - print("#########################") - print("# Validate SQF #") - print("#########################") + print("Validating SQF") sqf_list = [] bad_count = 0 @@ -162,11 +160,12 @@ def main(): for filename in sqf_list: bad_count = bad_count + check_sqf_syntax(filename) - print("Checked {0} files. Errors detected {1}.".format(len(sqf_list), bad_count)) + + print("------\nChecked {0} files\nErrors detected: {1}".format(len(sqf_list), bad_count)) if (bad_count == 0): - print("Sqf validation passed") + print("SQF validation PASSED") else: - print("Sqf validation failed") + print("SQF validation FAILED") return bad_count