Skip to content

Commit

Permalink
clang-tidy.
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-at-work committed Dec 31, 2020
1 parent a09cb0d commit 1263b5d
Show file tree
Hide file tree
Showing 138 changed files with 1,005 additions and 1,504 deletions.
6 changes: 2 additions & 4 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,-google-readability-todo,-google-runtime-references,-google-default-arguments,-clang-analyzer-core.uninitialized.UndefReturn,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-optin.cplusplus.VirtualCall'
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,-google-readability-todo,-google-runtime-references,-google-default-arguments'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
FormatStyle: file
FormatStyle: file
...

# Disable Checks
Expand All @@ -14,5 +14,3 @@ FormatStyle: file
# clang-analyzer-core.uninitialized.UndefReturn - Generates errors in ACE, how do we ignore?
# clang-analyzer-core.UndefinedBinaryOperatorResult - Generates errors in ACE, how do we ignore?

# TEMP
# clang-analyzer-optin.cplusplus.VirtualCall
19 changes: 8 additions & 11 deletions cppcache/benchmark/SerializationRegistryBM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ using apache::geode::client::internal::DSFid;

class TestPdxClass : public PdxSerializable {
public:
TestPdxClass() {}
void fromData(PdxReader&) {}
TestPdxClass() = default;

void toData(PdxWriter&) const {}
void fromData(PdxReader&) override {}

const std::string& getClassName() const { return className; }
void toData(PdxWriter&) const override {}

const std::string& getClassName() const override { return className; }

static std::shared_ptr<PdxSerializable> createDeserializable() {
return std::make_shared<TestPdxClass>();
Expand All @@ -53,19 +54,15 @@ class TestPdxClass : public PdxSerializable {

class TestDataSerializableClass : public DataSerializable {
public:
TestDataSerializableClass() {}
void fromData(DataInput&) {}
TestDataSerializableClass() = default;

void toData(DataOutput&) const {}
void fromData(DataInput&) override {}

const std::string& getClassName() const { return className; }
void toData(DataOutput&) const override {}

static std::shared_ptr<DataSerializable> createInstance() {
return std::make_shared<TestDataSerializableClass>();
}

private:
std::string className = "myserializableclass";
};

static void SerializationRegistryBM_findDataSerializablePrimitive(
Expand Down
11 changes: 1 addition & 10 deletions cppcache/include/geode/Cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
#include "GeodeCache.hpp"
#include "internal/geode_globals.hpp"

/**
* @file
*/

namespace apache {
namespace geode {
namespace client {
Expand Down Expand Up @@ -67,9 +63,6 @@ enum class RegionShortcut;
*
*/
class APACHE_GEODE_EXPORT Cache : public GeodeCache {
/**
* @brief public methods
*/
public:
/**
* Returns the {@link RegionFactory} to create the region.
Expand Down Expand Up @@ -268,9 +261,6 @@ class APACHE_GEODE_EXPORT Cache : public GeodeCache {
Cache& operator=(Cache&& other) noexcept;

private:
/**
* @brief constructors
*/
Cache(const std::shared_ptr<Properties>& dsProp, bool ignorePdxUnreadFields,
bool readPdxSerialized,
const std::shared_ptr<AuthInitialize>& authInitialize);
Expand All @@ -284,6 +274,7 @@ class APACHE_GEODE_EXPORT Cache : public GeodeCache {
friend class CacheXmlCreation;
friend class RegionXmlCreation;
};

} // namespace client
} // namespace geode
} // namespace apache
Expand Down
4 changes: 3 additions & 1 deletion cppcache/include/geode/CqServiceStatistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ namespace client {
*/
class APACHE_GEODE_EXPORT CqServiceStatistics {
public:
virtual ~CqServiceStatistics() noexcept = default;

/**
* Get the number of CQs currently active.
* Get the number of CQs currently active.c
* Active CQs are those which are executing (in running state).
* @return number of CQs
*/
Expand Down
2 changes: 1 addition & 1 deletion cppcache/include/geode/FunctionService.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class APACHE_GEODE_EXPORT FunctionService {
return onServersWithCache(regionService);
}

virtual ~FunctionService() {}
virtual ~FunctionService() noexcept = default;

private:
static Execution onServerWithPool(const std::shared_ptr<Pool>& pool);
Expand Down
2 changes: 1 addition & 1 deletion cppcache/include/geode/PdxInstance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class APACHE_GEODE_EXPORT PdxInstance : public PdxSerializable {
/**
* @brief destructor
*/
~PdxInstance() override = default;
~PdxInstance() noexcept override = default;

/**
* Deserializes and returns the domain object that this instance represents.
Expand Down
4 changes: 2 additions & 2 deletions cppcache/include/geode/PdxUnreadFields.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ namespace client {
**/
class APACHE_GEODE_EXPORT PdxUnreadFields {
public:
PdxUnreadFields() {}
virtual ~PdxUnreadFields() {}
PdxUnreadFields() = default;
virtual ~PdxUnreadFields() = default;
};
} // namespace client
} // namespace geode
Expand Down
2 changes: 1 addition & 1 deletion cppcache/include/geode/Properties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class APACHE_GEODE_EXPORT Properties
public:
virtual void visit(const std::shared_ptr<CacheableKey>& key,
const std::shared_ptr<Cacheable>& value) = 0;
virtual ~Visitor() {}
virtual ~Visitor() noexcept = default;
};

Properties() = default;
Expand Down
5 changes: 1 addition & 4 deletions cppcache/include/geode/WritablePdxInstance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ class CacheableObjectArray;
*/
class APACHE_GEODE_EXPORT WritablePdxInstance : public PdxInstance {
public:
/**
* @brief destructor
*/
virtual ~WritablePdxInstance() = default;
~WritablePdxInstance() noexcept override = default;

/**
* Set the existing named field to the given value.
Expand Down
4 changes: 2 additions & 2 deletions cppcache/include/geode/internal/geode_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@

/** Deletes array x only if it exists */
#define _GEODE_SAFE_DELETE_ARRAY(x) \
{ \
do { \
delete[] x; \
x = nullptr; \
}
} while (0)

#include <chrono>
#include <string>
Expand Down
20 changes: 4 additions & 16 deletions cppcache/integration-test/.clang-tidy
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
---
Checks: '-*,clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,-google-readability-todo,-google-runtime-references,-google-default-arguments,-clang-analyzer-core.uninitialized.UndefReturn,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-cplusplus.NewDeleteLeaks,-google-readability-function-size'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*'
FormatStyle: file
InheritParentConfig: true
Checks: '-google-readability-function-size'
...

# Disable Checks
# google-runtime-references - We have diverged from this rule due to both legacy and disagreement with the rule.
# google-readability-todo - Adds current user name when fix applied.
# clang-analyzer-cplusplus.NewDeleteLeaks - Fundamental design flaw in dunit::Task

# TODO - Fix these checks
# google-default-arguments
# clang-analyzer-core.uninitialized.UndefReturn - Generates errors in ACE, how do we ignore?
# clang-analyzer-core.UndefinedBinaryOperatorResult - Generates errors in ACE, how do we ignore?

# TEMP
# clang-analyzer-optin.cplusplus.VirtualCall
# google-readability-function-size
# Some tests have large bodies that cause this rule to fail.
1 change: 1 addition & 0 deletions cppcache/integration-test/BBNamingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ BBNamingContextServer::BBNamingContextServer() {
m_impl = new BBNamingContextServerImpl();
}
BBNamingContextServer::~BBNamingContextServer() {
// NOLINTNEXTLINE(clang-analyzer-unix.Malloc): ACE
if (m_impl != nullptr) {
delete m_impl;
m_impl = nullptr;
Expand Down
Loading

0 comments on commit 1263b5d

Please sign in to comment.