mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-24 14:24:54 +00:00
linter: Add and apply new formatting rules
New rules: `InsertNewlineAtEOF: true` `RemoveSemicolon: true` `RequiresClausePosition: WithPreceding`
This commit is contained in:
parent
2c54ee94c1
commit
bf554edfe0
9 changed files with 20 additions and 18 deletions
|
@ -54,6 +54,7 @@ IncludeCategories:
|
||||||
IndentCaseLabels: false
|
IndentCaseLabels: false
|
||||||
IndentWidth: 2
|
IndentWidth: 2
|
||||||
IndentWrappedFunctionNames: false
|
IndentWrappedFunctionNames: false
|
||||||
|
InsertNewlineAtEOF: true
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
MacroBlockBegin: ''
|
MacroBlockBegin: ''
|
||||||
MacroBlockEnd: ''
|
MacroBlockEnd: ''
|
||||||
|
@ -67,6 +68,8 @@ PenaltyExcessCharacter: 1000000
|
||||||
PenaltyReturnTypeOnItsOwnLine: 60
|
PenaltyReturnTypeOnItsOwnLine: 60
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
ReflowComments: true
|
ReflowComments: true
|
||||||
|
RemoveSemicolon: true
|
||||||
|
RequiresClausePosition: WithPreceding
|
||||||
SortIncludes: true
|
SortIncludes: true
|
||||||
SpaceAfterCStyleCast: false
|
SpaceAfterCStyleCast: false
|
||||||
SpaceBeforeAssignmentOperators: true
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace Config
|
||||||
// Setting a key to an object of this type will delete the key.
|
// Setting a key to an object of this type will delete the key.
|
||||||
struct DefaultState
|
struct DefaultState
|
||||||
{
|
{
|
||||||
friend constexpr bool operator==(DefaultState, DefaultState) { return true; };
|
friend constexpr bool operator==(DefaultState, DefaultState) { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
|
|
|
@ -11,16 +11,15 @@ namespace Common
|
||||||
struct ContainsFn
|
struct ContainsFn
|
||||||
{
|
{
|
||||||
template <std::input_iterator I, std::sentinel_for<I> S, class T, class Proj = std::identity>
|
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>,
|
requires std::indirect_binary_predicate<std::ranges::equal_to, std::projected<I, Proj>, const T*>
|
||||||
const T*>
|
|
||||||
constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const
|
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;
|
return std::ranges::find(std::move(first), last, value, std::move(proj)) != last;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::ranges::input_range R, class T, class Proj = std::identity>
|
template <std::ranges::input_range R, class T, class Proj = std::identity>
|
||||||
requires std::indirect_binary_predicate<
|
requires std::indirect_binary_predicate<
|
||||||
std::ranges::equal_to, std::projected<std::ranges::iterator_t<R>, Proj>, const T*>
|
std::ranges::equal_to, std::projected<std::ranges::iterator_t<R>, Proj>, const T*>
|
||||||
constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const
|
constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const
|
||||||
{
|
{
|
||||||
return (*this)(std::ranges::begin(r), std::ranges::end(r), value, std::move(proj));
|
return (*this)(std::ranges::begin(r), std::ranges::end(r), value, std::move(proj));
|
||||||
|
@ -32,7 +31,7 @@ struct ContainsSubrangeFn
|
||||||
template <std::forward_iterator I1, std::sentinel_for<I1> S1, std::forward_iterator I2,
|
template <std::forward_iterator I1, std::sentinel_for<I1> S1, std::forward_iterator I2,
|
||||||
std::sentinel_for<I2> S2, class Pred = std::ranges::equal_to,
|
std::sentinel_for<I2> S2, class Pred = std::ranges::equal_to,
|
||||||
class Proj1 = std::identity, class Proj2 = std::identity>
|
class Proj1 = std::identity, class Proj2 = std::identity>
|
||||||
requires std::indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
|
requires std::indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
|
||||||
constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
|
constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
|
||||||
Proj1 proj1 = {}, Proj2 proj2 = {}) const
|
Proj1 proj1 = {}, Proj2 proj2 = {}) const
|
||||||
{
|
{
|
||||||
|
@ -45,8 +44,8 @@ struct ContainsSubrangeFn
|
||||||
template <std::ranges::forward_range R1, std::ranges::forward_range R2,
|
template <std::ranges::forward_range R1, std::ranges::forward_range R2,
|
||||||
class Pred = std::ranges::equal_to, class Proj1 = std::identity,
|
class Pred = std::ranges::equal_to, class Proj1 = std::identity,
|
||||||
class Proj2 = std::identity>
|
class Proj2 = std::identity>
|
||||||
requires std::indirectly_comparable<std::ranges::iterator_t<R1>, std::ranges::iterator_t<R2>,
|
requires std::indirectly_comparable<std::ranges::iterator_t<R1>, std::ranges::iterator_t<R2>,
|
||||||
Pred, Proj1, Proj2>
|
Pred, Proj1, Proj2>
|
||||||
constexpr bool operator()(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {},
|
constexpr bool operator()(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {},
|
||||||
Proj2 proj2 = {}) const
|
Proj2 proj2 = {}) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,7 +73,7 @@ void TruncateToCString(std::string* s);
|
||||||
bool TryParse(const std::string& str, bool* output);
|
bool TryParse(const std::string& str, bool* output);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
requires(std::is_integral_v<T> || (std::is_enum_v<T> && !detail::IsBooleanEnum<T>()))
|
requires(std::is_integral_v<T> || (std::is_enum_v<T> && !detail::IsBooleanEnum<T>()))
|
||||||
bool TryParse(const std::string& str, T* output, int base = 0)
|
bool TryParse(const std::string& str, T* output, int base = 0)
|
||||||
{
|
{
|
||||||
char* end_ptr = nullptr;
|
char* end_ptr = nullptr;
|
||||||
|
@ -112,7 +112,7 @@ bool TryParse(const std::string& str, T* output, int base = 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
requires(detail::IsBooleanEnum<T>())
|
requires(detail::IsBooleanEnum<T>())
|
||||||
bool TryParse(const std::string& str, T* output)
|
bool TryParse(const std::string& str, T* output)
|
||||||
{
|
{
|
||||||
bool value;
|
bool value;
|
||||||
|
|
|
@ -171,8 +171,8 @@ public:
|
||||||
void SetDevMenuUpdateCallback(std::function<void(void)> callback)
|
void SetDevMenuUpdateCallback(std::function<void(void)> callback)
|
||||||
{
|
{
|
||||||
m_dev_menu_callback = 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
|
#endif // RC_CLIENT_SUPPORTS_RAINTEGRATION
|
||||||
|
|
||||||
void DoState(PointerWrap& p);
|
void DoState(PointerWrap& p);
|
||||||
|
@ -339,13 +339,13 @@ public:
|
||||||
u16 revision)
|
u16 revision)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
|
|
||||||
constexpr bool CheckApprovedARCode(const ActionReplay::ARCode& code, const std::string& game_id,
|
constexpr bool CheckApprovedARCode(const ActionReplay::ARCode& code, const std::string& game_id,
|
||||||
u16 revision)
|
u16 revision)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
|
|
||||||
constexpr void LoadGame(const std::string&, const DiscIO::Volume*) {}
|
constexpr void LoadGame(const std::string&, const DiscIO::Volume*) {}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ protected:
|
||||||
bool ConnectInternal() override;
|
bool ConnectInternal() override;
|
||||||
void DisconnectInternal() override;
|
void DisconnectInternal() override;
|
||||||
bool IsConnected() const override;
|
bool IsConnected() const override;
|
||||||
void IOWakeup() override {};
|
void IOWakeup() override {}
|
||||||
int IORead(u8* buf) override;
|
int IORead(u8* buf) override;
|
||||||
int IOWrite(u8 const* buf, size_t len) override;
|
int IOWrite(u8 const* buf, size_t len) override;
|
||||||
|
|
||||||
|
|
|
@ -190,4 +190,4 @@ void ConfigComplexChoice::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
QComboBox::mousePressEvent(event);
|
QComboBox::mousePressEvent(event);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ protected:
|
||||||
return Config::Get(setting);
|
return Config::Get(setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnConfigChanged() {};
|
virtual void OnConfigChanged() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool IsConfigLocal() const
|
bool IsConfigLocal() const
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
explicit StateTracker();
|
explicit StateTracker();
|
||||||
~StateTracker();
|
~StateTracker();
|
||||||
|
|
||||||
Framebuffer* GetCurrentFramebuffer() { return m_current_framebuffer; };
|
Framebuffer* GetCurrentFramebuffer() { return m_current_framebuffer; }
|
||||||
void SetCurrentFramebuffer(Framebuffer* framebuffer);
|
void SetCurrentFramebuffer(Framebuffer* framebuffer);
|
||||||
void BeginClearRenderPass(MTLClearColor color, float depth);
|
void BeginClearRenderPass(MTLClearColor color, float depth);
|
||||||
void BeginRenderPass(MTLLoadAction load_action);
|
void BeginRenderPass(MTLLoadAction load_action);
|
||||||
|
|
Loading…
Add table
Reference in a new issue