]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
build: Enable Clang-Tidy modernize-concat-nested-namespaces check
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 18 May 2022 18:54:49 +0000 (20:54 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 23 May 2022 17:16:30 +0000 (19:16 +0200)
15 files changed:
src/.clang-tidy
src/storage/primary/PrimaryStorage.cpp
src/storage/primary/PrimaryStorage_cleanup.cpp
src/storage/primary/PrimaryStorage_compress.cpp
src/storage/primary/PrimaryStorage_statistics.cpp
src/storage/primary/StatsFile.cpp
src/storage/primary/StatsFile.hpp
src/storage/primary/util.cpp
src/storage/secondary/FileStorage.cpp
src/storage/secondary/HttpStorage.cpp
src/storage/secondary/HttpStorage.hpp
src/storage/secondary/RedisStorage.cpp
src/storage/secondary/RedisStorage.hpp
src/storage/secondary/SecondaryStorage.cpp
src/storage/secondary/SecondaryStorage.hpp

index c14120d1ab7ba3e213329b241b883c99a738c359..35c8668be1fc651a8d3e5acbe3a5a584bc1a4a1a 100644 (file)
@@ -20,7 +20,6 @@ Checks:          '-*,
                   -performance-unnecessary-value-param,
                   modernize-*,
                   -modernize-avoid-c-arrays,
-                  -modernize-concat-nested-namespaces,
                   -modernize-pass-by-value,
                   -modernize-return-braced-init-list,
                   -modernize-use-auto,
index 0a6a2997dbb4104585319a9139168fe9082c3d75..c89ebb723d5e66f6e50be13d34f6572504f51a14 100644 (file)
@@ -35,8 +35,7 @@
 
 using core::Statistic;
 
-namespace storage {
-namespace primary {
+namespace storage::primary {
 
 // How often (in seconds) to scan $CCACHE_DIR/tmp for left-over temporary
 // files.
@@ -404,5 +403,4 @@ PrimaryStorage::get_path_in_cache(const uint8_t level,
   return path;
 }
 
-} // namespace primary
-} // namespace storage
+} // namespace storage::primary
index e07e44aee812ad8d880d59e0a1d89590cea5d562..18671ac6fdd5b2daea79b2492ba8918b0063e6a7 100644 (file)
@@ -40,8 +40,7 @@
 
 using core::Statistic;
 
-namespace storage {
-namespace primary {
+namespace storage::primary {
 
 static void
 delete_file(const std::string& path,
@@ -278,5 +277,4 @@ PrimaryStorage::wipe_all(const ProgressReceiver& progress_receiver)
   for_each_level_1_subdir(m_config.cache_dir(), wipe_dir, progress_receiver);
 }
 
-} // namespace primary
-} // namespace storage
+} // namespace storage::primary
index d4a78319b2fa852936887f4b5b0080c54bdda811..0d0adf0160b4d3aebf8a72397e2aac8f6890d9d6 100644 (file)
@@ -47,8 +47,7 @@
 #include <string>
 #include <thread>
 
-namespace storage {
-namespace primary {
+namespace storage::primary {
 
 namespace {
 
@@ -334,5 +333,4 @@ PrimaryStorage::recompress(const std::optional<int8_t> level,
   PRINT(stdout, "Size change:          {:>9s}\n", size_difference_str);
 }
 
-} // namespace primary
-} // namespace storage
+} // namespace storage::primary
index 99cc4fc46ae032db7a549750eb212182bf443765..dc9ff146c40caf95540a1c2850f04f8d6247deb2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2022 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -25,8 +25,7 @@
 
 #include <algorithm>
 
-namespace storage {
-namespace primary {
+namespace storage::primary {
 
 static void
 for_each_level_1_and_2_stats_file(
@@ -82,5 +81,4 @@ PrimaryStorage::get_all_statistics() const
   return std::make_pair(counters, last_updated);
 }
 
-} // namespace primary
-} // namespace storage
+} // namespace storage::primary
index b2a248e80dff69e418a2df653656664446b6648c..418e02f105d004d8e0f342f845f795d56b5eac91 100644 (file)
@@ -25,8 +25,7 @@
 #include <core/exceptions.hpp>
 #include <fmtmacros.hpp>
 
-namespace storage {
-namespace primary {
+namespace storage::primary {
 
 StatsFile::StatsFile(const std::string& path) : m_path(path)
 {
@@ -90,5 +89,4 @@ StatsFile::update(
   return counters;
 }
 
-} // namespace primary
-} // namespace storage
+} // namespace storage::primary
index 0a8eaaa6218f04b459fff0544d9d57a16c3ea8d8..0971667248065c353a9dfba5592c98fbaaf6106f 100644 (file)
@@ -24,8 +24,7 @@
 #include <optional>
 #include <string>
 
-namespace storage {
-namespace primary {
+namespace storage::primary {
 
 class StatsFile
 {
@@ -46,5 +45,4 @@ private:
   const std::string m_path;
 };
 
-} // namespace primary
-} // namespace storage
+} // namespace storage::primary
index 7d89cb92defe751da7e3ca9dc78adb0f54ff5645..32679ebf88bf98c2fe7ebd8d550072fcc07fdb0e 100644 (file)
@@ -22,8 +22,7 @@
 #include <fmtmacros.hpp>
 #include <util/string.hpp>
 
-namespace storage {
-namespace primary {
+namespace storage::primary {
 
 void
 for_each_level_1_subdir(const std::string& cache_dir,
@@ -73,5 +72,4 @@ get_level_1_files(const std::string& dir,
   return files;
 }
 
-} // namespace primary
-} // namespace storage
+} // namespace storage::primary
index 9ae10c61f34194fb7d8ddb254dc94720f887b0e2..6b3f55ee6f0e3eecee509ec38644aa93b867de1a 100644 (file)
@@ -34,8 +34,7 @@
 
 #include <string_view>
 
-namespace storage {
-namespace secondary {
+namespace storage::secondary {
 
 namespace {
 
@@ -189,5 +188,4 @@ FileStorage::create_backend(const Backend::Params& params) const
   return std::make_unique<FileStorageBackend>(params);
 }
 
-} // namespace secondary
-} // namespace storage
+} // namespace storage::secondary
index a59948b9e43958cee2f3a3875f0b359be92fb85f..671a8013905170bc16ebc52c2b9a482afcc1c5af 100644 (file)
@@ -31,8 +31,7 @@
 
 #include <string_view>
 
-namespace storage {
-namespace secondary {
+namespace storage::secondary {
 
 namespace {
 
@@ -294,5 +293,4 @@ HttpStorage::redact_secrets(Backend::Params& params) const
   }
 }
 
-} // namespace secondary
-} // namespace storage
+} // namespace storage::secondary
index 60c1354e1c6e620893282b64b1134dca7185aac3..32f6345a3b4b03a2a68dcf8c20cf208379d55377 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2022 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -20,8 +20,7 @@
 
 #include <storage/secondary/SecondaryStorage.hpp>
 
-namespace storage {
-namespace secondary {
+namespace storage::secondary {
 
 class HttpStorage : public SecondaryStorage
 {
@@ -32,5 +31,4 @@ public:
   void redact_secrets(Backend::Params& params) const override;
 };
 
-} // namespace secondary
-} // namespace storage
+} // namespace storage::secondary
index b76622d46b282d30937fbd9e61619eaf2a4c66cf..dcc98b5796ff72f79c9a06dffdb373d865e7ed8b 100644 (file)
@@ -45,8 +45,7 @@
 #include <cstdarg>
 #include <memory>
 
-namespace storage {
-namespace secondary {
+namespace storage::secondary {
 
 namespace {
 
@@ -338,5 +337,4 @@ RedisStorage::redact_secrets(Backend::Params& params) const
   }
 }
 
-} // namespace secondary
-} // namespace storage
+} // namespace storage::secondary
index 98794fa2d3434158b74ba247e495f46c3671dd9f..01759df7855c0f4b6d86bf00445b963113faebbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2022 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -20,8 +20,7 @@
 
 #include <storage/secondary/SecondaryStorage.hpp>
 
-namespace storage {
-namespace secondary {
+namespace storage::secondary {
 
 class RedisStorage : public SecondaryStorage
 {
@@ -32,5 +31,4 @@ public:
   void redact_secrets(Backend::Params& params) const override;
 };
 
-} // namespace secondary
-} // namespace storage
+} // namespace storage::secondary
index c73f19db4301de98ba651a718f4514dc7840884b..e800422179f5426ac9163baa0e8cb2507571feb0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2022 Joel Rosdahl and other contributors
 //
 // See doc/AUTHORS.adoc for a complete list of contributors.
 //
@@ -21,8 +21,7 @@
 #include <util/expected.hpp>
 #include <util/string.hpp>
 
-namespace storage {
-namespace secondary {
+namespace storage::secondary {
 
 bool
 SecondaryStorage::Backend::is_framework_attribute(const std::string& name)
@@ -37,5 +36,4 @@ SecondaryStorage::Backend::parse_timeout_attribute(const std::string& value)
     util::parse_unsigned(value, 1, 60 * 1000, "timeout")));
 }
 
-} // namespace secondary
-} // namespace storage
+} // namespace storage::secondary
index 7adea47779ece5011c4c802326718f68c9d809bb..64eaf7aed7c60631953f6842bb557382d08ee202 100644 (file)
@@ -31,8 +31,7 @@
 
 class Digest;
 
-namespace storage {
-namespace secondary {
+namespace storage::secondary {
 
 constexpr auto k_redacted_password = "********";
 const auto k_default_connect_timeout = std::chrono::milliseconds{100};
@@ -143,5 +142,4 @@ SecondaryStorage::Backend::Failed::failure() const
   return m_failure;
 }
 
-} // namespace secondary
-} // namespace storage
+} // namespace storage::secondary