Skip to content

Commit 3fb39da

Browse files
authored
Merge pull request #533 from openmultiplayer/amir/fix-formatting
Fix formatting so CI passes now
2 parents 3f78a69 + 890a69c commit 3fb39da

File tree

13 files changed

+72
-26
lines changed

13 files changed

+72
-26
lines changed

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AlignConsecutiveAssignments: false
88
AlignConsecutiveBitFields: false
99
AlignConsecutiveDeclarations: false
1010
AlignEscapedNewlines: Right
11-
AlignOperands: DontAlign
11+
AlignOperands: DontAlign
1212
AlignTrailingComments: false
1313
AllowAllArgumentsOnNextLine: true
1414
AllowAllConstructorInitializersOnNextLine: true
@@ -17,7 +17,7 @@ AllowShortEnumsOnASingleLine: true
1717
AllowShortBlocksOnASingleLine: Empty
1818
AllowShortCaseLabelsOnASingleLine: false
1919
AllowShortFunctionsOnASingleLine: All
20-
AllowShortLambdasOnASingleLine: All
20+
AllowShortLambdasOnASingleLine: None
2121
AllowShortIfStatementsOnASingleLine: Never
2222
AllowShortLoopsOnASingleLine: false
2323
AlwaysBreakAfterDefinitionReturnType: None

SDK/include/Impl/events_impl.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ struct DefaultEventDispatcher final : public IEventDispatcher<EventHandlerType>,
152152
// `anyTrue` should still CALL them call, don't short-circuit.
153153
bool ret = false;
154154
std::for_each(handlers.begin(), handlers.end(), typename Storage::template Func<bool, Fn>([&fn, &ret]()
155-
{ ret = fn() || ret; }));
155+
{
156+
ret = fn() || ret;
157+
}));
156158
return ret;
157159
}
158160

@@ -167,7 +169,9 @@ struct DefaultEventDispatcher final : public IEventDispatcher<EventHandlerType>,
167169
{
168170
bool ret = true;
169171
std::for_each(handlers.begin(), handlers.end(), typename Storage::template Func<bool, Fn>([&fn, &ret]()
170-
{ ret = fn() && ret; }));
172+
{
173+
ret = fn() && ret;
174+
}));
171175
return ret;
172176
}
173177

SDK/include/anim.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,15 +2005,19 @@ inline bool animationNameValid(StringView lib, StringView name)
20052005
Impl::String fullName(lib);
20062006
fullName += ':' + Impl::String(name);
20072007
std::transform(fullName.begin(), fullName.end(), fullName.begin(), [](unsigned char c)
2008-
{ return std::toupper(c); });
2008+
{
2009+
return std::toupper(c);
2010+
});
20092011
return AnimationNamesLookup.valid.find(fullName) != AnimationNamesLookup.valid.end();
20102012
}
20112013

20122014
inline bool animationLibraryValid(StringView lib, bool v1_0 = true)
20132015
{
20142016
Impl::String fullName(lib);
20152017
std::transform(fullName.begin(), fullName.end(), fullName.begin(), [](unsigned char c)
2016-
{ return std::toupper(c); });
2018+
{
2019+
return std::toupper(c);
2020+
});
20172021
if (AnimationLibraryLookup.valid.find(fullName) != AnimationLibraryLookup.valid.end())
20182022
{
20192023
return true;

Server/Components/Console/commands.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,9 @@ ADD_CONSOLE_CMD(rcon_password, [](const String& params, const ConsoleCommandSend
336336
});
337337

338338
ADD_CONSOLE_CMD(echo, [](const String& params, const ConsoleCommandSenderData& sender, ConsoleComponent& console, ICore* core)
339-
{ console.sendMessage(sender, params); });
339+
{
340+
console.sendMessage(sender, params);
341+
});
340342

341343
ADD_CONSOLE_CMD(messageslimit, [](const String& params, const ConsoleCommandSenderData& sender, ConsoleComponent& console, ICore* core)
342344
{

Server/Components/CustomModels/models.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ class CustomModelsComponent final : public ICustomModelsComponent, public Player
684684
bool getCustomModelPath(int32_t modelId, StringView& dffPath, StringView& txdPath) const override
685685
{
686686
auto model = std::find_if(storage.begin(), storage.end(), [&](const auto& model)
687-
{ return model->getId() == modelId; });
687+
{
688+
return model->getId() == modelId;
689+
});
688690

689691
if (model != storage.end())
690692
{

Server/Components/LegacyConfig/config_main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ class LegacyConfigComponent final : public ILegacyConfigComponent, public Consol
216216
// Try all variants from most specific to least specific.
217217
Impl::String lower(right);
218218
std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c)
219-
{ return std::tolower(c); });
219+
{
220+
return std::tolower(c);
221+
});
220222
if (lower == "true")
221223
{
222224
config.setBool(name, true);
@@ -334,7 +336,9 @@ class LegacyConfigComponent final : public ILegacyConfigComponent, public Consol
334336
{
335337
Impl::String lower(right);
336338
std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c)
337-
{ return std::tolower(c); });
339+
{
340+
return std::tolower(c);
341+
});
338342
if (lower == "true" || lower == "1")
339343
{
340344
config.setBool(dictIt->second, true);

Server/Components/Pawn/Manager/Manager.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ class PawnManager : public Singleton<PawnManager>
102102
DynamicArray<Pair<String, std::unique_ptr<PawnScript>>>::const_iterator const findScript(String const& name) const
103103
{
104104
return std::find_if(scripts_.begin(), scripts_.end(), [name](Pair<String, std::unique_ptr<PawnScript>> const& it)
105-
{ return it.first == name; });
105+
{
106+
return it.first == name;
107+
});
106108
}
107109

108110
public:

Server/Components/Pawn/Scripting/Types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ class ParamCast<DynamicArray<T> const&>
853853
ParamCast(ParamCast<DynamicArray<T> const&> const&) = delete;
854854
ParamCast(ParamCast<DynamicArray<T> const&>&&) = delete;
855855

856-
operator DynamicArray<T> const &()
856+
operator DynamicArray<T> const&()
857857
{
858858
return value_;
859859
}

Server/Components/Pawn/Scripting/Vehicle/Natives.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,9 @@ SCRIPT_API(GetVehicleModelsUsed, int())
416416
auto& vehicle_models = PawnManager::Get()->vehicles->models();
417417

418418
return std::count_if(vehicle_models.begin(), vehicle_models.end(), [](uint8_t model_instances)
419-
{ return model_instances > 0; });
419+
{
420+
return model_instances > 0;
421+
});
420422
}
421423

422424
SCRIPT_API(GetVehiclePaintjob, int(IVehicle& vehicle))

Server/Components/Vehicles/vehicle.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ bool Vehicle::updateFromDriverSync(const VehicleDriverSyncPacket& vehicleSync, I
190190
sirenState = vehicleSync.Siren;
191191
params.siren = sirenState != 0;
192192
static_cast<DefaultEventDispatcher<VehicleEventHandler>&>(pool->getEventDispatcher()).stopAtFalse([&player, this](VehicleEventHandler* handler)
193-
{ return handler->onVehicleSirenStateChange(player, *this, sirenState); });
193+
{
194+
return handler->onVehicleSirenStateChange(player, *this, sirenState);
195+
});
194196
}
195197

196198
if (driver != &player)
@@ -254,7 +256,9 @@ bool Vehicle::updateFromUnoccupied(const VehicleUnoccupiedSyncPacket& unoccupied
254256

255257
UnoccupiedVehicleUpdate data = UnoccupiedVehicleUpdate { unoccupiedSync.SeatID, unoccupiedSync.Position, unoccupiedSync.Velocity };
256258
bool allowed = static_cast<DefaultEventDispatcher<VehicleEventHandler>&>(pool->getEventDispatcher()).stopAtFalse([&player, this, &data](VehicleEventHandler* handler)
257-
{ return handler->onUnoccupiedVehicleUpdate(*this, player, data); });
259+
{
260+
return handler->onUnoccupiedVehicleUpdate(*this, player, data);
261+
});
258262

259263
if (cab && !towing)
260264
{
@@ -325,7 +329,9 @@ bool Vehicle::updateFromTrailerSync(const VehicleTrailerSyncPacket& trailerSync,
325329
*/
326330

327331
bool allowed = static_cast<DefaultEventDispatcher<VehicleEventHandler>&>(pool->getEventDispatcher()).stopAtFalse([&player, this](VehicleEventHandler* handler)
328-
{ return handler->onTrailerUpdate(player, *this); });
332+
{
333+
return handler->onTrailerUpdate(player, *this);
334+
});
329335
return allowed;
330336
}
331337

0 commit comments

Comments
 (0)