chore(Apps/Codestyle): add a new check for if statements (#20073)
* chore(Apps/CodeStyle): add a new check for if statements * update * Update spell_priest.cpp * Update codestyle.py
This commit is contained in:
parent
7690c35208
commit
729cf72f0d
1 changed files with 6 additions and 1 deletions
|
|
@ -31,7 +31,8 @@ def parsing_file(directory: str) -> None:
|
|||
multiple_blank_lines_check(file, file_path)
|
||||
trailing_whitespace_check(file, file_path)
|
||||
get_counter_check(file, file_path)
|
||||
misc_codestyle_check(file, file_path)
|
||||
if not file_name.endswith('.cmake') and file_name != 'CMakeLists.txt':
|
||||
misc_codestyle_check(file, file_path)
|
||||
if file_name != 'Object.h':
|
||||
get_typeid_check(file, file_path)
|
||||
if file_name != 'Unit.h':
|
||||
|
|
@ -223,6 +224,10 @@ def misc_codestyle_check(file: io, file_path: str) -> None:
|
|||
print(
|
||||
f"Please use the syntax 'Class/ObjectType const*' instead of 'const Class/ObjectType*': {file_path} at line {line_number}")
|
||||
check_failed = True
|
||||
if [match for match in [' if(', ' if ( '] if match in line]:
|
||||
print(
|
||||
f"AC have as standard: if (XXXX). Please check spaces in your condition': {file_path} at line {line_number}")
|
||||
check_failed = True
|
||||
# Handle the script error and update the result output
|
||||
if check_failed:
|
||||
error_handler = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue