mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Preparation for libcxx(abi), llvm, clang-tidy 16
This commit is contained in:
parent
ed50378060
commit
0e01e912fe
@ -41,6 +41,8 @@ Checks: '*,
|
||||
-clang-analyzer-security.insecureAPI.strcpy,
|
||||
|
||||
-cppcoreguidelines-avoid-c-arrays,
|
||||
-cppcoreguidelines-avoid-const-or-ref-data-members,
|
||||
-cppcoreguidelines-avoid-do-while,
|
||||
-cppcoreguidelines-avoid-goto,
|
||||
-cppcoreguidelines-avoid-magic-numbers,
|
||||
-cppcoreguidelines-avoid-non-const-global-variables,
|
||||
@ -128,6 +130,7 @@ Checks: '*,
|
||||
-portability-simd-intrinsics,
|
||||
|
||||
-readability-braces-around-statements,
|
||||
-readability-convert-member-functions-to-static,
|
||||
-readability-else-after-return,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-function-size,
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <bit>
|
||||
#include <cstring>
|
||||
#include "types.h"
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/NumberParser.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
@ -5,14 +5,14 @@ if (ENABLE_CLANG_TIDY)
|
||||
|
||||
find_program (CLANG_TIDY_CACHE_PATH NAMES "clang-tidy-cache")
|
||||
if (CLANG_TIDY_CACHE_PATH)
|
||||
find_program (_CLANG_TIDY_PATH NAMES "clang-tidy-15" "clang-tidy-14" "clang-tidy-13" "clang-tidy-12" "clang-tidy")
|
||||
find_program (_CLANG_TIDY_PATH NAMES "clang-tidy-16" "clang-tidy-15" "clang-tidy-14" "clang-tidy")
|
||||
|
||||
# Why do we use ';' here?
|
||||
# It's a cmake black magic: https://cmake.org/cmake/help/latest/prop_tgt/LANG_CLANG_TIDY.html#prop_tgt:%3CLANG%3E_CLANG_TIDY
|
||||
# The CLANG_TIDY_PATH is passed to CMAKE_CXX_CLANG_TIDY, which follows CXX_CLANG_TIDY syntax.
|
||||
set (CLANG_TIDY_PATH "${CLANG_TIDY_CACHE_PATH};${_CLANG_TIDY_PATH}" CACHE STRING "A combined command to run clang-tidy with caching wrapper")
|
||||
else ()
|
||||
find_program (CLANG_TIDY_PATH NAMES "clang-tidy-15" "clang-tidy-14" "clang-tidy-13" "clang-tidy-12" "clang-tidy")
|
||||
find_program (CLANG_TIDY_PATH NAMES "clang-tidy-16" "clang-tidy-15" "clang-tidy-14" "clang-tidy")
|
||||
endif ()
|
||||
|
||||
if (CLANG_TIDY_PATH)
|
||||
|
@ -400,7 +400,7 @@ struct fmt::formatter<DB::Identifier>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("invalid format");
|
||||
throw fmt::format_error("invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -408,7 +408,7 @@ struct fmt::formatter<DB::Identifier>
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::Identifier & identifier, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}", identifier.getFullName());
|
||||
return fmt::format_to(ctx.out(), "{}", identifier.getFullName());
|
||||
}
|
||||
};
|
||||
|
||||
@ -422,7 +422,7 @@ struct fmt::formatter<DB::IdentifierView>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("invalid format");
|
||||
throw fmt::format_error("invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -430,6 +430,6 @@ struct fmt::formatter<DB::IdentifierView>
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::IdentifierView & identifier_view, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}", identifier_view.getFullName());
|
||||
return fmt::format_to(ctx.out(), "{}", identifier_view.getFullName());
|
||||
}
|
||||
};
|
||||
|
@ -106,7 +106,7 @@ struct fmt::formatter<DB::TestHint::ErrorVector>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("Invalid format");
|
||||
throw fmt::format_error("Invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -115,10 +115,10 @@ struct fmt::formatter<DB::TestHint::ErrorVector>
|
||||
auto format(const DB::TestHint::ErrorVector & ErrorVector, FormatContext & ctx)
|
||||
{
|
||||
if (ErrorVector.empty())
|
||||
return format_to(ctx.out(), "{}", 0);
|
||||
return fmt::format_to(ctx.out(), "{}", 0);
|
||||
else if (ErrorVector.size() == 1)
|
||||
return format_to(ctx.out(), "{}", ErrorVector[0]);
|
||||
return fmt::format_to(ctx.out(), "{}", ErrorVector[0]);
|
||||
else
|
||||
return format_to(ctx.out(), "[{}]", fmt::join(ErrorVector, ", "));
|
||||
return fmt::format_to(ctx.out(), "[{}]", fmt::join(ErrorVector, ", "));
|
||||
}
|
||||
};
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <sys/epoll.h>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <Poco/Logger.h>
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <cstddef>
|
||||
|
@ -563,7 +563,7 @@ std::string ZooKeeperMultiRequest::toStringImpl() const
|
||||
for (const auto & request : requests)
|
||||
{
|
||||
const auto & zk_request = dynamic_cast<const ZooKeeperRequest &>(*request);
|
||||
format_to(std::back_inserter(out), "SubRequest\n{}\n", zk_request.toString());
|
||||
fmt::format_to(std::back_inserter(out), "SubRequest\n{}\n", zk_request.toString());
|
||||
}
|
||||
return {out.data(), out.size()};
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ struct fmt::formatter<ReadableSize>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("invalid format");
|
||||
throw fmt::format_error("invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -51,6 +51,6 @@ struct fmt::formatter<ReadableSize>
|
||||
template <typename FormatContext>
|
||||
auto format(const ReadableSize & size, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}", formatReadableSizeWithBinarySuffix(size.value));
|
||||
return fmt::format_to(ctx.out(), "{}", formatReadableSizeWithBinarySuffix(size.value));
|
||||
}
|
||||
};
|
||||
|
@ -1019,7 +1019,7 @@ struct fmt::formatter<DB::Field>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("Invalid format");
|
||||
throw fmt::format_error("Invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -1027,6 +1027,6 @@ struct fmt::formatter<DB::Field>
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::Field & x, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}", toString(x));
|
||||
return fmt::format_to(ctx.out(), "{}", toString(x));
|
||||
}
|
||||
};
|
||||
|
@ -626,7 +626,7 @@ struct fmt::formatter<DB::DataTypePtr>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("invalid format");
|
||||
throw fmt::format_error("invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -634,6 +634,6 @@ struct fmt::formatter<DB::DataTypePtr>
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::DataTypePtr & type, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}", type->getName());
|
||||
return fmt::format_to(ctx.out(), "{}", type->getName());
|
||||
}
|
||||
};
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <Disks/IDiskTransaction.h>
|
||||
#include <IO/WriteBufferFromFileBase.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <Disks/ObjectStorages/IObjectStorage_fwd.h>
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <base/types.h>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <base/types.h>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
|
||||
|
@ -138,7 +138,7 @@ namespace fmt
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::StorageID & storage_id, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}", storage_id.getNameForLogs());
|
||||
return fmt::format_to(ctx.out(), "{}", storage_id.getNameForLogs());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -45,6 +45,15 @@ void TemporaryDataOnDiskScope::deltaAllocAndCheck(ssize_t compressed_delta, ssiz
|
||||
stat.uncompressed_size += uncompressed_delta;
|
||||
}
|
||||
|
||||
TemporaryDataOnDisk::TemporaryDataOnDisk(TemporaryDataOnDiskScopePtr parent_)
|
||||
: TemporaryDataOnDiskScope(std::move(parent_), /* limit_ = */ 0)
|
||||
{}
|
||||
|
||||
TemporaryDataOnDisk::TemporaryDataOnDisk(TemporaryDataOnDiskScopePtr parent_, CurrentMetrics::Value metric_scope)
|
||||
: TemporaryDataOnDiskScope(std::move(parent_), /* limit_ = */ 0)
|
||||
, current_metric_scope(metric_scope)
|
||||
{}
|
||||
|
||||
TemporaryFileStream & TemporaryDataOnDisk::createStream(const Block & header, size_t max_file_size)
|
||||
{
|
||||
if (file_cache)
|
||||
|
@ -83,14 +83,9 @@ class TemporaryDataOnDisk : private TemporaryDataOnDiskScope
|
||||
public:
|
||||
using TemporaryDataOnDiskScope::StatAtomic;
|
||||
|
||||
explicit TemporaryDataOnDisk(TemporaryDataOnDiskScopePtr parent_)
|
||||
: TemporaryDataOnDiskScope(std::move(parent_), /* limit_ = */ 0)
|
||||
{}
|
||||
explicit TemporaryDataOnDisk(TemporaryDataOnDiskScopePtr parent_);
|
||||
|
||||
explicit TemporaryDataOnDisk(TemporaryDataOnDiskScopePtr parent_, CurrentMetrics::Value metric_scope)
|
||||
: TemporaryDataOnDiskScope(std::move(parent_), /* limit_ = */ 0)
|
||||
, current_metric_scope(metric_scope)
|
||||
{}
|
||||
explicit TemporaryDataOnDisk(TemporaryDataOnDiskScopePtr parent_, CurrentMetrics::Value metric_scope);
|
||||
|
||||
/// If max_file_size > 0, then check that there's enough space on the disk and throw an exception in case of lack of free space
|
||||
TemporaryFileStream & createStream(const Block & header, size_t max_file_size = 0);
|
||||
|
@ -373,7 +373,7 @@ struct fmt::formatter<DB::RowNumber>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("invalid format");
|
||||
throw fmt::format_error("invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -381,6 +381,6 @@ struct fmt::formatter<DB::RowNumber>
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::RowNumber & x, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}:{}", x.block, x.row);
|
||||
return fmt::format_to(ctx.out(), "{}:{}", x.block, x.row);
|
||||
}
|
||||
};
|
||||
|
@ -63,7 +63,7 @@ struct fmt::formatter<DB::MarkRange>
|
||||
|
||||
/// Only support {}.
|
||||
if (it != end && *it != '}')
|
||||
throw format_error("invalid format");
|
||||
throw fmt::format_error("invalid format");
|
||||
|
||||
return it;
|
||||
}
|
||||
@ -71,6 +71,6 @@ struct fmt::formatter<DB::MarkRange>
|
||||
template <typename FormatContext>
|
||||
auto format(const DB::MarkRange & range, FormatContext & ctx)
|
||||
{
|
||||
return format_to(ctx.out(), "{}", fmt::format("({}, {})", range.begin, range.end));
|
||||
return fmt::format_to(ctx.out(), "{}", fmt::format("({}, {})", range.begin, range.end));
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user