mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
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:
@@ -31,7 +31,8 @@ def parsing_file(directory: str) -> None:
|
|||||||
multiple_blank_lines_check(file, file_path)
|
multiple_blank_lines_check(file, file_path)
|
||||||
trailing_whitespace_check(file, file_path)
|
trailing_whitespace_check(file, file_path)
|
||||||
get_counter_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':
|
if file_name != 'Object.h':
|
||||||
get_typeid_check(file, file_path)
|
get_typeid_check(file, file_path)
|
||||||
if file_name != 'Unit.h':
|
if file_name != 'Unit.h':
|
||||||
@@ -223,6 +224,10 @@ def misc_codestyle_check(file: io, file_path: str) -> None:
|
|||||||
print(
|
print(
|
||||||
f"Please use the syntax 'Class/ObjectType const*' instead of 'const Class/ObjectType*': {file_path} at line {line_number}")
|
f"Please use the syntax 'Class/ObjectType const*' instead of 'const Class/ObjectType*': {file_path} at line {line_number}")
|
||||||
check_failed = True
|
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
|
# Handle the script error and update the result output
|
||||||
if check_failed:
|
if check_failed:
|
||||||
error_handler = True
|
error_handler = True
|
||||||
|
|||||||
Reference in New Issue
Block a user