refactor(Core/Misc): enforce east-const style and add codestyle check (#26492)

Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
This commit is contained in:
Kitzunu
2026-07-21 06:13:51 +02:00
committed by GitHub
parent 9a9924ed43
commit 8eb009fdfc
361 changed files with 1016 additions and 980 deletions
+1 -1
View File
@@ -25,7 +25,7 @@
#include <string>
#if WIN32
void inline setenv(const char* name, const char* value, int overwrite)
void inline setenv(char const* name, char const* value, int overwrite)
{
_putenv_s(name, value);
}
+2 -2
View File
@@ -49,9 +49,9 @@ public:
MOCK_METHOD(void, LoadConfigSettings, (bool reload), ());
MOCK_METHOD(bool, IsShuttingDown, (), (const));
MOCK_METHOD(uint32, GetShutDownTimeLeft, (), (const));
MOCK_METHOD(void, ShutdownServ, (uint32 time, uint32 options, uint8 exitcode, const std::string& reason), ());
MOCK_METHOD(void, ShutdownServ, (uint32 time, uint32 options, uint8 exitcode, std::string const& reason), ());
MOCK_METHOD(void, ShutdownCancel, ());
MOCK_METHOD(void, ShutdownMsg, (bool show, Player* player, const std::string& reason), ());
MOCK_METHOD(void, ShutdownMsg, (bool show, Player* player, std::string const& reason), ());
MOCK_METHOD(void, Update, (uint32 diff), ());
MOCK_METHOD(void, setRate, (ServerConfigs index, float value), ());
MOCK_METHOD(float, getRate, (ServerConfigs index), (const));
@@ -21,7 +21,7 @@
class HolidayDateCalculatorTest : public ::testing::Test
{
protected:
void ExpectDate(const std::tm& date, int year, int month, int day)
void ExpectDate(std::tm const& date, int year, int month, int day)
{
EXPECT_EQ(date.tm_year + 1900, year);
EXPECT_EQ(date.tm_mon + 1, month);
@@ -409,7 +409,7 @@ TEST_F(HolidayDateCalculatorTest, FixedDateHolidays_ConsistentAcrossYears_1900_2
{
// Fixed date holidays should have same month/day every year
// Note: Brewfest, Harvest Festival, and Winter Veil are now dynamic (not fixed date)
struct FixedHolidayTestCase { uint32_t holidayId; int month; int day; const char* name; };
struct FixedHolidayTestCase { uint32_t holidayId; int month; int day; char const* name; };
std::vector<FixedHolidayTestCase> testCases = {
{ 341, 6, 21, "Midsummer Fire Festival" },
{ 62, 7, 4, "Fireworks Spectacular" },
@@ -687,7 +687,7 @@ TEST_F(HolidayDateCalculatorTest, WeekdayOnOrAfter_MonthBoundary_RollsIntoNextMo
TEST_F(HolidayDateCalculatorTest, StressTest_AllCalculations_1900_2200)
{
// Run all holiday calculations for entire range to ensure no crashes
const std::vector<HolidayRule>& rules = HolidayDateCalculator::GetHolidayRules();
std::vector<HolidayRule> const& rules = HolidayDateCalculator::GetHolidayRules();
int totalCalculations = 0;
@@ -134,7 +134,7 @@ TEST_F(CascadeProcSuppressionTest, SpellInfo_WithMixedBits_HasAttributeReturnsTr
struct RealSpellTestCase
{
const char* name;
char const* name;
uint32 spellId;
bool hasAttr; // Whether the spell has SPELL_ATTR3_INSTANT_TARGET_PROCS
};
@@ -91,7 +91,7 @@ INSTANTIATE_TEST_SUITE_P(
AllSpellProcEntries,
SpellProcDBCValidationParamTest,
::testing::ValuesIn(GetAllSpellProcTestEntries()),
[](const testing::TestParamInfo<SpellProcTestEntry>& info) {
[](testing::TestParamInfo<SpellProcTestEntry> const& info) {
// Create unique test name from SpellId (handle negative IDs)
int32_t id = info.param.SpellId;
if (id < 0)
@@ -42,7 +42,7 @@ using namespace testing;
struct ProcFlagScenario
{
uint32 procFlag;
const char* name;
char const* name;
uint32 defaultHitMask;
uint32 defaultSpellTypeMask;
uint32 defaultSpellPhaseMask;
@@ -77,7 +77,7 @@ static const std::vector<ProcFlagScenario> PROC_FLAG_SCENARIOS = {
{ PROC_FLAG_DONE_TRAP_ACTIVATION, "TrapActivation", PROC_HIT_NORMAL, 0, PROC_SPELL_PHASE_HIT, true },
};
static const std::vector<std::pair<uint32, const char*>> HIT_MASK_SCENARIOS = {
static const std::vector<std::pair<uint32, char const*>> HIT_MASK_SCENARIOS = {
{ PROC_HIT_NORMAL, "Normal" },
{ PROC_HIT_CRITICAL, "Critical" },
{ PROC_HIT_MISS, "Miss" },
@@ -353,7 +353,7 @@ INSTANTIATE_TEST_SUITE_P(
AllSpellProcEntries,
SpellProcFullCoverageTest,
::testing::ValuesIn(GetAllSpellProcTestEntries()),
[](const ::testing::TestParamInfo<SpellProcTestEntry>& info) {
[](::testing::TestParamInfo<SpellProcTestEntry> const& info) {
// Generate unique test name from spell ID
int32_t id = info.param.SpellId;
if (id < 0)
@@ -352,7 +352,7 @@ TEST_F(SpellProcPPMTest, ShapeshiftBug_ItemSpellPath_AlreadyCorrect)
struct FormScenario
{
const char* name;
char const* name;
uint32 formSpeed;
};