diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-07-30 10:38:24 (GMT) |
---|---|---|
committer | Regina Pfeifer <regina@mailbox.org> | 2019-07-30 10:38:30 (GMT) |
commit | 4af094c8dfa8dd5bfb943a84e5f4c00f7bf2ee8f (patch) | |
tree | 6c34e88cf1b2a6fde07c07508883fc1d8feff83e | |
parent | 473f288e9703ad49e6be8f3fc8639e0bbb79cc9b (diff) | |
download | CMake-4af094c8dfa8dd5bfb943a84e5f4c00f7bf2ee8f.zip CMake-4af094c8dfa8dd5bfb943a84e5f4c00f7bf2ee8f.tar.gz CMake-4af094c8dfa8dd5bfb943a84e5f4c00f7bf2ee8f.tar.bz2 |
clang-tidy: Blacklist violations for version 8
Check the codebase with clang-tidy version 8, fix the low hanging
fruits, blacklist the rest.
-rw-r--r-- | .clang-tidy | 8 | ||||
-rw-r--r-- | Source/CTest/cmParseBlanketJSCoverage.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmParseBlanketJSCoverage.h | 2 | ||||
-rw-r--r-- | Source/cmFileAPI.cxx | 3 | ||||
-rw-r--r-- | Source/cmFileAPICodemodel.cxx | 4 | ||||
-rw-r--r-- | Source/cmNewLineStyle.cxx | 2 | ||||
-rw-r--r-- | Source/cmNewLineStyle.h | 2 | ||||
-rw-r--r-- | Source/cmServerProtocol.cxx | 3 | ||||
-rw-r--r-- | Source/cmServerProtocol.h | 4 | ||||
-rw-r--r-- | Source/cmTargetDepend.h | 2 | ||||
-rw-r--r-- | Source/cmake.cxx | 2 |
11 files changed, 20 insertions, 15 deletions
diff --git a/.clang-tidy b/.clang-tidy index bfcb67c..57e571a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,16 +3,21 @@ Checks: "-*,\ bugprone-*,\ -bugprone-macro-parentheses,\ -bugprone-misplaced-widening-cast,\ +-bugprone-narrowing-conversions,\ +-bugprone-too-small-loop-variable,\ google-readability-casting,\ misc-*,\ -misc-incorrect-roundings,\ -misc-macro-parentheses,\ -misc-misplaced-widening-cast,\ +-misc-non-private-member-variables-in-classes,\ -misc-static-assert,\ modernize-*,\ +-modernize-avoid-c-arrays,\ -modernize-deprecated-headers,\ -modernize-return-braced-init-list,\ -modernize-use-auto,\ +-modernize-use-nodiscard,\ -modernize-use-noexcept,\ -modernize-use-transparent-functors,\ -modernize-use-using,\ @@ -24,8 +29,11 @@ readability-*,\ -readability-implicit-bool-cast,\ -readability-implicit-bool-conversion,\ -readability-inconsistent-declaration-parameter-name,\ +-readability-isolate-declaration,\ +-readability-magic-numbers,\ -readability-named-parameter,\ -readability-redundant-declaration,\ +-readability-uppercase-literal-suffix,\ " HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$' CheckOptions: diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx index 63d6a15..b74decb 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.cxx +++ b/Source/CTest/cmParseBlanketJSCoverage.cxx @@ -110,7 +110,8 @@ cmParseBlanketJSCoverage::cmParseBlanketJSCoverage( { } -bool cmParseBlanketJSCoverage::LoadCoverageData(std::vector<std::string> files) +bool cmParseBlanketJSCoverage::LoadCoverageData( + std::vector<std::string> const& files) { cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found " << files.size() << " Files" << std::endl, diff --git a/Source/CTest/cmParseBlanketJSCoverage.h b/Source/CTest/cmParseBlanketJSCoverage.h index 696121f..cd1b225 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.h +++ b/Source/CTest/cmParseBlanketJSCoverage.h @@ -29,7 +29,7 @@ class cmParseBlanketJSCoverage public: cmParseBlanketJSCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest); - bool LoadCoverageData(std::vector<std::string> files); + bool LoadCoverageData(std::vector<std::string> const& files); // Read the JSON output bool ReadJSONFile(std::string const& file); diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index ba42669..fa318bc 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -684,7 +684,6 @@ void cmFileAPI::BuildClientRequestCodeModel( Json::Value cmFileAPI::BuildCodeModel(Object const& object) { - using namespace std::placeholders; Json::Value codemodel = cmFileAPICodemodelDump(*this, object.Version); codemodel["kind"] = this->ObjectKindName(object.Kind); @@ -719,7 +718,6 @@ void cmFileAPI::BuildClientRequestCache( Json::Value cmFileAPI::BuildCache(Object const& object) { - using namespace std::placeholders; Json::Value cache = cmFileAPICacheDump(*this, object.Version); cache["kind"] = this->ObjectKindName(object.Kind); @@ -754,7 +752,6 @@ void cmFileAPI::BuildClientRequestCMakeFiles( Json::Value cmFileAPI::BuildCMakeFiles(Object const& object) { - using namespace std::placeholders; Json::Value cmakeFiles = cmFileAPICMakeFilesDump(*this, object.Version); cmakeFiles["kind"] = this->ObjectKindName(object.Kind); diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 7b916cd..0c4f5c4 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -287,7 +287,7 @@ class Target Json::ArrayIndex si); void AddBacktrace(Json::Value& object, cmListFileBacktrace const& bt); Json::Value DumpPaths(); - Json::Value DumpCompileData(CompileData cd); + Json::Value DumpCompileData(CompileData const& cd); Json::Value DumpInclude(CompileData::IncludeEntry const& inc); Json::Value DumpDefine(BT<std::string> const& def); Json::Value DumpSources(); @@ -915,7 +915,7 @@ Json::Value Target::DumpSource(cmGeneratorTarget::SourceAndKind const& sk, return source; } -Json::Value Target::DumpCompileData(CompileData cd) +Json::Value Target::DumpCompileData(CompileData const& cd) { Json::Value result = Json::objectValue; diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx index 3f6523e..1ff741e 100644 --- a/Source/cmNewLineStyle.cxx +++ b/Source/cmNewLineStyle.cxx @@ -41,7 +41,7 @@ bool cmNewLineStyle::ReadFromArguments(const std::vector<std::string>& args, return true; } -const std::string cmNewLineStyle::GetCharacters() const +std::string cmNewLineStyle::GetCharacters() const { switch (NewLineStyle) { case Invalid: diff --git a/Source/cmNewLineStyle.h b/Source/cmNewLineStyle.h index f1a7bc6..ab9002e 100644 --- a/Source/cmNewLineStyle.h +++ b/Source/cmNewLineStyle.h @@ -30,7 +30,7 @@ public: bool ReadFromArguments(const std::vector<std::string>& args, std::string& errorString); - const std::string GetCharacters() const; + std::string GetCharacters() const; private: Style NewLineStyle = Invalid; diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index c5de742..8fcb710 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -378,8 +378,7 @@ void cmServerProtocol1::HandleCMakeFileChanges(const std::string& path, SendSignal(kFILE_CHANGE_SIGNAL, obj); } -const cmServerResponse cmServerProtocol1::Process( - const cmServerRequest& request) +cmServerResponse cmServerProtocol1::Process(const cmServerRequest& request) { assert(this->m_State >= STATE_ACTIVE); diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h index 2f55a20..5da4344 100644 --- a/Source/cmServerProtocol.h +++ b/Source/cmServerProtocol.h @@ -80,7 +80,7 @@ public: virtual std::pair<int, int> ProtocolVersion() const = 0; virtual bool IsExperimental() const = 0; - virtual const cmServerResponse Process(const cmServerRequest& request) = 0; + virtual cmServerResponse Process(const cmServerRequest& request) = 0; bool Activate(cmServer* server, const cmServerRequest& request, std::string* errorMessage); @@ -106,7 +106,7 @@ class cmServerProtocol1 : public cmServerProtocol public: std::pair<int, int> ProtocolVersion() const override; bool IsExperimental() const override; - const cmServerResponse Process(const cmServerRequest& request) override; + cmServerResponse Process(const cmServerRequest& request) override; private: bool DoActivate(const cmServerRequest& request, diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index 5ea0085..4ca78fa 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -31,7 +31,7 @@ public: operator cmGeneratorTarget const*() const { return this->Target; } cmGeneratorTarget const* operator->() const { return this->Target; } cmGeneratorTarget const& operator*() const { return *this->Target; } - friend bool operator<(cmTargetDepend l, cmTargetDepend r) + friend bool operator<(cmTargetDepend const& l, cmTargetDepend const& r) { return l.Target < r.Target; } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7250e51..eb57947 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -619,7 +619,7 @@ void cmake::LoadEnvironmentPresets() this->EnvironmentGenerator = envGenVar; } - auto readGeneratorVar = [&](std::string name, std::string& key) { + auto readGeneratorVar = [&](std::string const& name, std::string& key) { std::string varValue; if (cmSystemTools::GetEnv(name, varValue)) { if (hasEnvironmentGenerator) { |