summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy3
-rw-r--r--Source/QtDialog/AddCacheEntry.cxx4
-rw-r--r--Source/cmELF.cxx2
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmFileCommand.cxx2
-rw-r--r--Source/cmForEachCommand.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx3
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx6
-rw-r--r--Source/cmIfCommand.cxx2
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Source/cmWhileCommand.cxx2
-rw-r--r--Source/cmake.cxx2
12 files changed, 17 insertions, 15 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 8d79b0c5d4..cec7d03a5b 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -21,15 +21,18 @@ modernize-*,\
-modernize-use-using,\
performance-*,\
-performance-inefficient-string-concatenation,\
+-performance-inefficient-vector-operation,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-cast,\
+-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
-readability-redundant-declaration,\
-readability-redundant-member-init,\
-readability-simplify-boolean-expr,\
+-readability-static-accessed-through-instance,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
...
diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index 6284ac946c..70610d7c9e 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -21,8 +21,8 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames,
, VarTypes(varTypes)
{
this->setupUi(this);
- for (int i = 0; i < NumTypes; i++) {
- this->Type->addItem(TypeStrings[i]);
+ for (auto const& elem : TypeStrings) {
+ this->Type->addItem(elem);
}
QWidget* cb = new QCheckBox();
QWidget* path = new QCMakePathEditor();
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 0ccd68a970..27f91317fe 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -684,7 +684,7 @@ cmELF::cmELF(const char* fname)
std::unique_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
// Quit now if the file could not be opened.
- if (!fin.get() || !*fin) {
+ if (!fin || !*fin) {
this->ErrorMessage = "Error opening input file.";
return;
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index bddc3c4aac..df27c62949 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -79,7 +79,7 @@ bool cmExportFileGenerator::GenerateImportFile()
ap->SetCopyIfDifferent(true);
foutPtr = std::move(ap);
}
- if (!foutPtr.get() || !*foutPtr) {
+ if (!foutPtr || !*foutPtr) {
std::string se = cmSystemTools::GetLastSystemError();
std::ostringstream e;
e << "cannot write to file \"" << this->MainImportFile << "\": " << se;
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index f86e5e2a26..3012b0ad2f 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2824,7 +2824,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
std::string algo = i->substr(0, pos);
expectedHash = cmSystemTools::LowerCase(i->substr(pos + 1));
hash = std::unique_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
- if (!hash.get()) {
+ if (!hash) {
std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
err += algo;
this->SetError(err);
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 9ff967c504..739c9c0a99 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -38,7 +38,7 @@ bool cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0b28d1e8f3..80d81d5e48 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -4379,8 +4379,7 @@ const char* impliedValue<const char*>(const char* /*unused*/)
return "";
}
template <>
-std::string impliedValue<std::string>(
- std::string /*unused*/) // NOLINT(clang-tidy)
+std::string impliedValue<std::string>(std::string /*unused*/) // NOLINT(*)
{
return std::string();
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index fbc756c08f..0271b6f371 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -112,7 +112,7 @@ std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit)
std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path)
{
- std::string result = path; // NOLINT(clang-tidy)
+ std::string result = path;
#ifdef _WIN32
if (this->IsGCCOnWindows())
std::replace(result.begin(), result.end(), '\\', '/');
@@ -254,7 +254,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps,
const cmNinjaDeps& orderOnly)
{
- std::string cmd = command; // NOLINT(clang-tidy)
+ std::string cmd = command; // NOLINT(*)
#ifdef _WIN32
if (cmd.empty())
// TODO Shouldn't an empty command be handled by ninja?
@@ -1940,7 +1940,7 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
cm.SetHomeOutputDirectory(dir_top_bld);
std::unique_ptr<cmGlobalNinjaGenerator> ggd(
static_cast<cmGlobalNinjaGenerator*>(cm.CreateGlobalGenerator("Ninja")));
- if (!ggd.get() ||
+ if (!ggd ||
!ggd->WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld,
arg_dd, arg_ddis, module_dir,
linked_target_dirs)) {
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index ae4041d8e3..5d952daac0 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -39,7 +39,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 790f6e0826..5ad8ef6e40 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2342,7 +2342,7 @@ cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const
{ "watchsimulator", AppleSDK::WatchSimulator },
};
- for (auto entry : sdkDatabase) {
+ for (auto const& entry : sdkDatabase) {
if (sdkRoot.find(entry.name) == 0 ||
sdkRoot.find(std::string("/") + entry.name) != std::string::npos) {
return entry.sdk;
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index d5bcfc2309..9d43d1906a 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -37,7 +37,7 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 35730b8e67..2ac7f4d584 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2596,7 +2596,7 @@ bool cmake::Open(const std::string& dir, bool dryRun)
std::unique_ptr<cmGlobalGenerator> gen(
this->CreateGlobalGenerator(fullName));
- if (!gen.get()) {
+ if (!gen) {
std::cerr << "Error: could create CMAKE_GENERATOR \"" << fullName
<< "\"\n";
return false;