Skip to content

Commit

Permalink
chore(Apps/Codestyle): add a new check for if statements (azerothcore…
Browse files Browse the repository at this point in the history
…#20073)

* chore(Apps/CodeStyle): add a new check for if statements

* update

* Update spell_priest.cpp

* Update codestyle.py
  • Loading branch information
Grimdhex authored Sep 28, 2024
1 parent 7690c35 commit 729cf72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/codestyle/codestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 729cf72

Please sign in to comment.