Skip to content

Commit

Permalink
Merge pull request #1066 from dlyr/pre-commit-update
Browse files Browse the repository at this point in the history
Pre commit update
  • Loading branch information
dlyr authored Oct 12, 2023
2 parents 629a228 + e937b79 commit e89ba19
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
BasedOnStyle: LLVM
Language: Cpp
Standard: Cpp11
Standard: c++17
AllowShortFunctionsOnASingleLine: Inline
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
AlwaysBreakTemplateDeclarations: true
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: ^tests/.*/data/.*$
Expand All @@ -26,12 +26,12 @@ repos:
# - id: cppcheck
# args: [--enable=all]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
rev: v0.37.0
hooks:
- id: markdownlint
args: [-f]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.6
rev: v17.0.2
hooks:
- id: clang-format
types_or: [c++, c, cuda]
2 changes: 1 addition & 1 deletion src/Core/Containers/VariableSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ auto VariableSet::addVariableType() -> Utils::optional<VariableContainer<T>*> {
// used to visit the variableSet with a dynamic visitor
m_vtable->m_visitFunctions.emplace_back(
[]( const VariableSet& c, const DynamicVisitorBase& v )
-> std::pair<bool, std::function<void( DynamicVisitorBase&, std::any && )>> {
-> std::pair<bool, std::function<void( DynamicVisitorBase&, std::any&& )>> {
auto id = getVariableVisitTypeIndex<T>();
if ( v.accept( id ) ) {
auto& visitedStorage = c.getVariableStorage<T>();
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Utils/Attribs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ void AttribBase::setName( const std::string& name ) {
m_name = name;
}

bool inline AttribBase::operator==( const AttribBase& rhs ) {
bool inline AttribBase::operator==( const AttribBase & rhs ) {
return m_name == rhs.getName();
}

Expand Down
12 changes: 9 additions & 3 deletions src/Core/Utils/Singleton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
TYPE( const TYPE& ) = delete; \
void operator=( const TYPE& ) = delete; \
struct Deleter { \
void operator()( TYPE* p ) const { delete p; } \
void operator()( TYPE* p ) const { \
delete p; \
} \
}; \
static std::unique_ptr<TYPE, Deleter> s_instance; \
\
Expand All @@ -33,8 +35,12 @@
s_instance = std::unique_ptr<TYPE, Deleter>( new TYPE( args... ), Deleter() ); \
return getInstance(); \
} \
inline static TYPE* getInstance() { return s_instance.get(); } \
inline static void destroyInstance() { s_instance.reset( nullptr ); }
inline static TYPE* getInstance() { \
return s_instance.get(); \
} \
inline static void destroyInstance() { \
s_instance.reset( nullptr ); \
}

/// Add this macro in the singleton cpp, followed by a semicolon.
// Limitations : TYPE cannot be a nested type
Expand Down

0 comments on commit e89ba19

Please sign in to comment.