diff --git a/.clang-format b/.clang-format index b19e59f0..930c5eb3 100644 --- a/.clang-format +++ b/.clang-format @@ -11,7 +11,7 @@ AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: true -AllowShortFunctionsOnASingleLine: false +AllowShortFunctionsOnASingleLine: InlineOnly AllowShortIfStatementsOnASingleLine: true AllowShortLoopsOnASingleLine: false AlwaysBreakTemplateDeclarations: true diff --git a/ixwebsocket/LUrlParser.h b/ixwebsocket/LUrlParser.h index 0298ceb2..b49e7c21 100644 --- a/ixwebsocket/LUrlParser.h +++ b/ixwebsocket/LUrlParser.h @@ -62,10 +62,7 @@ namespace LUrlParser } /// return 'true' if the parsing was successful - bool IsValid() const - { - return m_ErrorCode == LUrlParserError_Ok; - } + bool IsValid() const { return m_ErrorCode == LUrlParserError_Ok; } /// helper to convert the port number to int, return 'true' if the port is valid (within the /// 0..65535 range) diff --git a/ws/ixcobra/IXCobraMetricsPublisher.h b/ws/ixcobra/IXCobraMetricsPublisher.h index e0ab7ff4..693490aa 100644 --- a/ws/ixcobra/IXCobraMetricsPublisher.h +++ b/ws/ixcobra/IXCobraMetricsPublisher.h @@ -89,16 +89,10 @@ namespace ix void setGenericAttributes(const std::string& attrName, const Json::Value& value); /// Set a unique id for the session. A uuid can be used. - void setSession(const std::string& session) - { - _session = session; - } + void setSession(const std::string& session) { _session = session; } /// Get the unique id used to identify the current session - const std::string& getSession() const - { - return _session; - } + const std::string& getSession() const { return _session; } /// Return the number of milliseconds since the epoch (~1970) uint64_t getMillisecondsSinceEpoch() const; diff --git a/ws/ixcore/utils/IXCoreLogger.h b/ws/ixcore/utils/IXCoreLogger.h index e140dfc3..2df0bda9 100644 --- a/ws/ixcore/utils/IXCoreLogger.h +++ b/ws/ixcore/utils/IXCoreLogger.h @@ -9,10 +9,7 @@ namespace ix using LogFunc = std::function; static void Log(const char* msg); - static void setLogFunction(LogFunc& func) - { - _currentLogger = func; - } + static void setLogFunction(LogFunc& func) { _currentLogger = func; } private: static LogFunc _currentLogger; diff --git a/ws/snake/IXSnakeConnectionState.h b/ws/snake/IXSnakeConnectionState.h index 713aad32..4ceb54d0 100644 --- a/ws/snake/IXSnakeConnectionState.h +++ b/ws/snake/IXSnakeConnectionState.h @@ -16,37 +16,16 @@ namespace snake class SnakeConnectionState : public ix::ConnectionState { public: - std::string getNonce() - { - return _nonce; - } - void setNonce(const std::string& nonce) - { - _nonce = nonce; - } + std::string getNonce() { return _nonce; } + void setNonce(const std::string& nonce) { _nonce = nonce; } - std::string appkey() - { - return _appkey; - } - void setAppkey(const std::string& appkey) - { - _appkey = appkey; - } + std::string appkey() { return _appkey; } + void setAppkey(const std::string& appkey) { _appkey = appkey; } - std::string role() - { - return _role; - } - void setRole(const std::string& role) - { - _role = role; - } + std::string role() { return _role; } + void setRole(const std::string& role) { _role = role; } - ix::RedisClient& redisClient() - { - return _redisClient; - } + ix::RedisClient& redisClient() { return _redisClient; } std::future fut;