linter: Add and apply new formatting rules

New rules:
`InsertNewlineAtEOF: true`
`RemoveSemicolon: true`
`RequiresClausePosition: WithPreceding`
This commit is contained in:
Joshua Vandaële 2025-04-23 11:19:14 +02:00
parent 2c54ee94c1
commit bf554edfe0
No known key found for this signature in database
GPG key ID: 5E8F4E7EDBD390EA
9 changed files with 20 additions and 18 deletions

View file

@ -54,6 +54,7 @@ IncludeCategories:
IndentCaseLabels: false
IndentWidth: 2
IndentWrappedFunctionNames: false
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
@ -67,6 +68,8 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
RemoveSemicolon: true
RequiresClausePosition: WithPreceding
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true

View file

@ -18,7 +18,7 @@ namespace Config
// Setting a key to an object of this type will delete the key.
struct DefaultState
{
friend constexpr bool operator==(DefaultState, DefaultState) { return true; };
friend constexpr bool operator==(DefaultState, DefaultState) { return true; }
};
namespace detail

View file

@ -11,8 +11,7 @@ namespace Common
struct ContainsFn
{
template <std::input_iterator I, std::sentinel_for<I> S, class T, class Proj = std::identity>
requires std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>,
const T*>
requires std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T*>
constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const
{
return std::ranges::find(std::move(first), last, value, std::move(proj)) != last;

View file

@ -171,8 +171,8 @@ public:
void SetDevMenuUpdateCallback(std::function<void(void)> callback)
{
m_dev_menu_callback = callback;
};
bool CheckForModifications() { return rc_client_raintegration_has_modifications(m_client); };
}
bool CheckForModifications() { return rc_client_raintegration_has_modifications(m_client); }
#endif // RC_CLIENT_SUPPORTS_RAINTEGRATION
void DoState(PointerWrap& p);
@ -339,13 +339,13 @@ public:
u16 revision)
{
return true;
};
}
constexpr bool CheckApprovedARCode(const ActionReplay::ARCode& code, const std::string& game_id,
u16 revision)
{
return true;
};
}
constexpr void LoadGame(const std::string&, const DiscIO::Volume*) {}

View file

@ -23,7 +23,7 @@ protected:
bool ConnectInternal() override;
void DisconnectInternal() override;
bool IsConnected() const override;
void IOWakeup() override {};
void IOWakeup() override {}
int IORead(u8* buf) override;
int IOWrite(u8 const* buf, size_t len) override;

View file

@ -190,4 +190,4 @@ void ConfigComplexChoice::mousePressEvent(QMouseEvent* event)
{
QComboBox::mousePressEvent(event);
}
};
}

View file

@ -90,7 +90,7 @@ protected:
return Config::Get(setting);
}
virtual void OnConfigChanged() {};
virtual void OnConfigChanged() {}
private:
bool IsConfigLocal() const

View file

@ -57,7 +57,7 @@ public:
explicit StateTracker();
~StateTracker();
Framebuffer* GetCurrentFramebuffer() { return m_current_framebuffer; };
Framebuffer* GetCurrentFramebuffer() { return m_current_framebuffer; }
void SetCurrentFramebuffer(Framebuffer* framebuffer);
void BeginClearRenderPass(MTLClearColor color, float depth);
void BeginRenderPass(MTLLoadAction load_action);