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
This commit is contained in:
Glowbal 2015-10-11 18:31:39 +02:00
parent d6ab43d77e
commit b524c28d53

View File

@ -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