mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
feat(CI/Codestyle); Check for double semicolons (#20996)
This commit is contained in:
@@ -222,6 +222,9 @@ def misc_codestyle_check(file: io, file_path: str) -> None:
|
|||||||
|
|
||||||
# used to check for "if/else (...) {" "} else" ignores "if/else (...) {...}" "#define ... if/else (...) {"
|
# used to check for "if/else (...) {" "} else" ignores "if/else (...) {...}" "#define ... if/else (...) {"
|
||||||
ifelse_curlyregex = r"^[^#define].*\s+(if|else)(\s*\(.*\))?\s*{[^}]*$|}\s*else(\s*{[^}]*$)"
|
ifelse_curlyregex = r"^[^#define].*\s+(if|else)(\s*\(.*\))?\s*{[^}]*$|}\s*else(\s*{[^}]*$)"
|
||||||
|
# used to catch double semicolons ";;" ignores "(;;)"
|
||||||
|
double_semiregex = r"[^(];;[^)]"
|
||||||
|
|
||||||
# Parse all the file
|
# Parse all the file
|
||||||
for line_number, line in enumerate(file, start = 1):
|
for line_number, line in enumerate(file, start = 1):
|
||||||
if 'const auto&' in line:
|
if 'const auto&' in line:
|
||||||
@@ -240,6 +243,11 @@ def misc_codestyle_check(file: io, file_path: str) -> None:
|
|||||||
print(
|
print(
|
||||||
f"Curly brackets are not allowed to be leading or trailing if/else statements. Place it on a new line: {file_path} at line {line_number}")
|
f"Curly brackets are not allowed to be leading or trailing if/else statements. Place it on a new line: {file_path} at line {line_number}")
|
||||||
check_failed = True
|
check_failed = True
|
||||||
|
if re.match(double_semiregex, line):
|
||||||
|
print(
|
||||||
|
f"Double semicolon (;;) found in {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
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ struct Runes
|
|||||||
|
|
||||||
struct EnchantDuration
|
struct EnchantDuration
|
||||||
{
|
{
|
||||||
EnchantDuration() = default;;
|
EnchantDuration() = default;
|
||||||
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
||||||
leftduration(_leftduration) { ASSERT(item); };
|
leftduration(_leftduration) { ASSERT(item); };
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ void Player::_LoadCharacterSettings(PreparedQueryResult result)
|
|||||||
{
|
{
|
||||||
Field* fields = result->Fetch();
|
Field* fields = result->Fetch();
|
||||||
|
|
||||||
std::string source = fields[0].Get<std::string>();;
|
std::string source = fields[0].Get<std::string>();
|
||||||
std::string data = fields[1].Get<std::string>();
|
std::string data = fields[1].Get<std::string>();
|
||||||
|
|
||||||
std::vector<std::string_view> tokens = Acore::Tokenize(data, ' ', false);
|
std::vector<std::string_view> tokens = Acore::Tokenize(data, ' ', false);
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wstrToLower(wpacketPlayerName);
|
wstrToLower(wpacketPlayerName);
|
||||||
wstrToLower(wpacketGuildName);;
|
wstrToLower(wpacketGuildName);
|
||||||
|
|
||||||
// client send in case not set max level value 100 but Acore supports 255 max level,
|
// client send in case not set max level value 100 but Acore supports 255 max level,
|
||||||
// update it to show GMs with characters after 100 level
|
// update it to show GMs with characters after 100 level
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class InstanceSaveMgr
|
|||||||
friend class InstanceSave;
|
friend class InstanceSave;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
InstanceSaveMgr() = default;;
|
InstanceSaveMgr() = default;
|
||||||
~InstanceSaveMgr();
|
~InstanceSaveMgr();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user