]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Use .clang-format regexes instead of comments to group system includes
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 29 Jun 2021 05:42:21 +0000 (07:42 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 29 Jun 2021 05:42:21 +0000 (07:42 +0200)
32 files changed:
.clang-format
src/Args.hpp
src/CacheFile.hpp
src/Config.cpp
src/Config.hpp
src/Context.hpp
src/Depfile.hpp
src/Digest.hpp
src/Lockfile.cpp
src/Logging.hpp
src/Manifest.hpp
src/Result.hpp
src/Statistics.hpp
src/TemporaryFile.hpp
src/Util.hpp
src/ccache.cpp
src/ccache.hpp
src/compress.cpp
src/core/types.hpp
src/exceptions.hpp
src/hashutil.hpp
src/storage/SecondaryStorage.hpp
src/storage/Storage.cpp
src/storage/Storage.hpp
src/storage/types.hpp
src/util/file_utils.hpp
src/util/string_utils.cpp
src/util/string_utils.hpp
unittest/test_Config.cpp
unittest/test_Util.cpp
unittest/test_argprocessing.cpp
unittest/test_bsdmkstemp.cpp

index e101fa468b2d55055ac6294e121083d8c2e96c1b..29f13ad43ce1ee95c82b16fd1b518c89e3938035 100644 (file)
@@ -28,6 +28,10 @@ IncludeCategories:
     Priority: 1
   - Regex: '^["<]third_party/'
     Priority: 4
+  - Regex: '^<(sddl\.h)>$'
+    Priority: 5
+  - Regex: '^<(algorithm|any|array|atomic|bitset|cassert|ccomplex|cctype|cerrno|cfenv|cfloat|chrono|cinttypes|ciso646|climits|clocale|cmath|codecvt|complex|condition_variable|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype|deque|exception|execution|filesystem|forward_list|fstream|functional|future|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|limits|list|locale|map|memory|memory_resource|mutex|new|numeric|optional|ostream|queue|random|ratio|regex|scoped_allocator|set|shared_mutex|sstream|stack|stdexcept|streambuf|string|string_view|strstream|system_error|thread|tuple|type_traits|typeindex|typeinfo|unordered_map|unordered_set|utility|valarray|variant|vector)>$'
+    Priority: 6
   - Regex: '^"'
     Priority: 2
   - Regex: '.*'
index e58aeb669d3c745478ab1bac59e2e594a5b277ef..48fb77df5cdd3e2a2857d2a2c9b5164c9749bda6 100644 (file)
 #include "third_party/nonstd/optional.hpp"
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <deque>
 #include <string>
-// End of system headers
 
 class Args
 {
index 482db96c76a0efc655ed45798b6d9c9f3b699bf7..1cea40880bea2cee8fb12c61f2aa88adf420bc2c 100644 (file)
@@ -24,9 +24,7 @@
 
 #include "third_party/nonstd/optional.hpp"
 
-// System headers
 #include <string>
-// End of system headers
 
 class CacheFile
 {
index 995d21f698f08cb91ba8de2a15ec56899ac5a6d0..2163c68b3355d1fcd2605d2e83dbb1b70ffc76c3 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "third_party/fmt/core.h"
 
-// System headers
 #include <algorithm>
 #include <cassert>
 #include <fstream>
@@ -39,7 +38,6 @@
 #include <string>
 #include <unordered_map>
 #include <vector>
-// End of system headers
 
 using nonstd::nullopt;
 using nonstd::optional;
index e02a4ef8d15126f3ef20ccead9ae2fa03591f2c9..06069bd18dab98710110648825833d4372e76387 100644 (file)
 
 #include "third_party/nonstd/optional.hpp"
 
-// System headers
 #include <functional>
 #include <limits>
 #include <string>
 #include <unordered_map>
-// End of system headers
 
 enum class CompilerType { auto_guess, clang, gcc, nvcc, other, pump };
 
index b727cbb5b55fa2c49c4d175ff8c8ec5db6f6d3ef..856428b4e55699a39d88ed48a8ccd90c9eef9c6e 100644 (file)
 #include "third_party/nonstd/optional.hpp"
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <string>
 #include <unordered_map>
 #include <vector>
-// End of system headers
 
 class SignalHandler;
 
index 157b61250e6e835f254134df0f526b029578f506..0507006832fa7baae31d41c568c762fbbd10aa4b 100644 (file)
@@ -26,10 +26,8 @@ class Hash;
 #include "third_party/nonstd/optional.hpp"
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <string>
 #include <vector>
-// End of system headers
 
 namespace Depfile {
 
index ffe27def48872f29ebc8034f4f5504302c3fa963..d219d51742735bddc06882a152e6d129865f88b5 100644 (file)
@@ -24,9 +24,7 @@
 
 #include "third_party/fmt/core.h"
 
-// System headers
 #include <string>
-// End of system headers
 
 // Digest represents the binary form of the final digest (AKA hash or checksum)
 // produced by the hash algorithm.
index 1afcce437dd90222b816784cd854fff4b88fe0e1..209b0aac144b4ead1a0ded4a38a89addb29c957a 100644 (file)
 
 #include "third_party/fmt/core.h"
 
-// System headers
 #include <algorithm>
 #include <sstream>
 #include <thread>
-// End of system headers
 
 namespace {
 
index a1624339210ca32917ca5272d676f3da081c2215..5c780ec15cd27121cd01327412d743e88185a87e 100644 (file)
 #include "third_party/nonstd/optional.hpp"
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <string>
 #include <utility>
-// End of system headers
 
 // Log a raw message (plus a newline character).
 #define LOG_RAW(message_)                                                      \
index 0d18c9bf7346009ca255a47282fc6c6d40d00cb4..addf17ec4f83a285c8823bb2e031bc0abd9066eb 100644 (file)
 
 #include "third_party/nonstd/optional.hpp"
 
-// System headers
 #include <string>
 #include <unordered_map>
-// End of system headers
 
 class Config;
 class Context;
index 1265dcd66310445bef49d551d164a83857ebc3be..7fcfc95b6cd712a6374fcd222a9b2b40c039bae3 100644 (file)
 #include "third_party/nonstd/expected.hpp"
 #include "third_party/nonstd/optional.hpp"
 
-// System headers
 #include <map>
 #include <string>
 #include <vector>
-// End of system headers
 
 class CacheEntryReader;
 class CacheEntryWriter;
index 72a7767948aa6e3f8bca46899449f0067bb3eab4..6e5917b43e00c5ea8f0d9495734de1df1f05475b 100644 (file)
 
 #include "third_party/nonstd/optional.hpp"
 
-// System headers
 #include <functional>
 #include <sstream>
 #include <string>
-// End of system headers
 
 class Config;
 
index 78092d2391c4ecc9c8ecc68acdf1b86adba4aed1..624d5937dcc32adbd0d929d2a77e5f8b8d6a130e 100644 (file)
@@ -22,9 +22,7 @@
 
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <string>
-// End of system headers
 
 // This class represents a unique temporary file created by mkstemp. The file is
 // not deleted by the destructor.
index 4af271b86056f675e316d387cca7fde963c3f381..e7ca46009e1632b0fc4dbd7cdadb76403e1442bd 100644 (file)
@@ -25,7 +25,6 @@
 #include "third_party/nonstd/optional.hpp"
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <algorithm>
 #include <functional>
 #include <ios>
@@ -33,7 +32,6 @@
 #include <string>
 #include <utility>
 #include <vector>
-// End of system headers
 
 class Context;
 
index 0b3d23f76542927afbb849af04c6573d7efd30b5..f41a323fcb801882ad336719f25e32e785608b14 100644 (file)
@@ -74,12 +74,10 @@ extern "C" {
 #  include "Win32Util.hpp"
 #endif
 
-// System headers
 #include <algorithm>
 #include <cmath>
 #include <limits>
 #include <memory>
-// End of system headers
 
 #ifndef MYNAME
 #  define MYNAME "ccache"
index a054697598967e65c3109f78212aa319710ed5a5..da1f342e723f485a2e9b4fd4d4adf31b10741189 100644 (file)
 
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <functional>
 #include <string>
-// End of system headers
 
 class Context;
 
index 2050abaf42f72a5637ad06b67e0a79a6ab7d7cd0..157df6a0fcbf81d4dc6f06ec86b56bd037e651d4 100644 (file)
 
 #include "third_party/fmt/core.h"
 
-// System headers
 #include <memory>
 #include <string>
 #include <thread>
-// End of system headers
 
 using nonstd::optional;
 
index 42179c1c090b6c100b2414d358982e4add47df42..7cd53da0a4f7721798eb75d34becfd1153c21a94 100644 (file)
@@ -18,9 +18,7 @@
 
 #pragma once
 
-// System headers
 #include <string>
-// End of system headers
 
 namespace core {
 
index 134f7212db3b2229ec8fbc216155cfa093956ca0..6f7ccb32f33cfbbbe0b630026320b308bddff638 100644 (file)
 #include "third_party/fmt/core.h"
 #include "third_party/nonstd/optional.hpp"
 
-// System headers
 #include <stdexcept>
 #include <string>
 #include <utility>
-// End of system headers
 
 // Don't throw or catch ErrorBase directly, use a subclass.
 class ErrorBase : public std::runtime_error
index 40db1460565ac60c0cac905729025ce9f46f3b8e..51ac36af70a2e4904961afcec80498bff8089b14 100644 (file)
@@ -22,9 +22,7 @@
 
 #include "third_party/nonstd/string_view.hpp"
 
-// System headers
 #include <string>
-// End of system headers
 
 class Config;
 class Context;
index ce8c373fed612ef7713cc080e306b3efaa37cec7..611f78783e4d17fa0aabae7e6e750f8c817d42e7 100644 (file)
@@ -21,9 +21,7 @@
 #include <third_party/nonstd/expected.hpp>
 #include <third_party/nonstd/optional.hpp>
 
-// System headers
 #include <string>
-// End of system headers
 
 class Digest;
 
index 32229d06f5522e0e105388ce775b87e244ea9119..d4d5d953e84db2105ac5d17043c3111f77ad8fb0 100644 (file)
@@ -28,9 +28,7 @@
 #include <util/Tokenizer.hpp>
 #include <util/string_utils.hpp>
 
-// System headers
 #include <memory>
-// End of system headers
 
 namespace storage {
 
index f4f695b7394d55efaa75bd0be37bc042a16732eb..f15166aad05850b9b955dce3a8f5b8b20f1a2986 100644 (file)
 
 #include <third_party/nonstd/optional.hpp>
 
-// System headers
 #include <functional>
 #include <string>
 #include <vector>
-// End of system headers
 
 class Digest;
 
index 1a77f5f999b1e4f10fcc4493717de60c4039b517..0984971a4beb365d5f24e78fcf7e26c2aa0258f5 100644 (file)
 
 #pragma once
 
-// System headers
 #include <functional>
 #include <string>
 #include <unordered_map>
-// End of system headers
 
 namespace storage {
 
index cf5bd2871ee5838df779a52ce068f51792c15a21..b5fddda307c61357eaeb80c2083de3de6454c405 100644 (file)
@@ -18,9 +18,7 @@
 
 #pragma once
 
-// System headers
 #include <string>
-// End of system headers
 
 namespace util {
 
index cd15ddcc0dc40e3c99e6ecef64b5a026a4e65d53..18c36f2a1df40106dd98a68e3c86eb94fb1949e9 100644 (file)
@@ -22,9 +22,7 @@
 #include <Util.hpp>
 #include <fmtmacros.hpp>
 
-// System headers
 #include <cctype>
-// End of system headers
 
 namespace util {
 
index 41685798e53f76efc3f151bdb9d5642c7cc54bd1..5533e683f9b634ce7a789dfcdc5cfc99706ce74c 100644 (file)
 #include <third_party/nonstd/optional.hpp>
 #include <third_party/nonstd/string_view.hpp>
 
-// System headers
 #include <string>
 #include <utility>
-// End of system headers
 
 namespace util {
 
index 84b809b99f5ee7199e61df9783f46c8f683f16ab..7bce9029405a5811ce3bb9952ee67850d21ac67f 100644 (file)
 #include "third_party/doctest.h"
 #include "third_party/fmt/core.h"
 
-// System headers
 #include <limits>
 #include <string>
 #include <vector>
-// End of system headers
 
 using doctest::Approx;
 using TestUtil::TestContext;
index 04fcd3aa66c4d23aba0265889b0fd9b1ccee6e32..92343b96622f425c9e075b008e4ceddb4cf80db5 100644 (file)
@@ -25,9 +25,7 @@
 #include "third_party/doctest.h"
 #include "third_party/nonstd/optional.hpp"
 
-// System headers
 #include <algorithm>
-// End of system headers
 
 using doctest::Approx;
 using nonstd::nullopt;
index 2c0295512d7688d0bbd0fd16ad10c05da74720b9..aa4c0550a049d53395be57430af06ce69de0cfc6 100644 (file)
@@ -27,9 +27,7 @@
 
 #include "third_party/doctest.h"
 
-// System headers
 #include <algorithm>
-// End of system headers
 
 using TestUtil::TestContext;
 
index def2f67c97d331856ae1942d9502873e1b28cb8f..6ded67403c86550d84cc1b42ee5663889924ece4 100644 (file)
 #include "third_party/doctest.h"
 #include "third_party/win32/mktemp.h"
 
-// System headers
+#include <sddl.h>
+
 #include <algorithm>
 #include <memory>
 #include <ostream>
-#include <sddl.h>
 #include <utility>
-// End of system headers
 
 using TestUtil::TestContext;