Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup mess in .clang-tidy #48396

Merged
merged 3 commits into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 1 addition & 13 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Checks: '*,
-misc-const-correctness,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-confusable-identifiers, # useful but slooow

-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
Expand Down Expand Up @@ -148,19 +149,6 @@ Checks: '*,
-readability-use-anyofallof,

-zirkon-*,

-misc-*, # temporarily disabled due to being too slow
# also disable checks in other categories which are aliases of checks in misc-*:
# https://releases.llvm.org/15.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/list.html
-cert-dcl54-cpp, # alias of misc-new-delete-overloads
-hicpp-new-delete-operators, # alias of misc-new-delete-overloads
-cert-fio38-c, # alias of misc-non-copyable-objects
-cert-dcl03-c, # alias of misc-static-assert
-hicpp-static-assert, # alias of misc-static-assert
-cert-err09-cpp, # alias of misc-throw-by-value-catch-by-reference
-cert-err61-cpp, # alias of misc-throw-by-value-catch-by-reference
-cppcoreguidelines-c-copy-assignment-signature, # alias of misc-unconventional-assign-operator
-cppcoreguidelines-non-private-member-variables-in-classes, # alias of misc-non-private-member-variables-in-classes
'

WarningsAsErrors: '*'
Expand Down
2 changes: 1 addition & 1 deletion base/base/find_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace detail
{
template <char ...chars> constexpr bool is_in(char x) { return ((x == chars) || ...); }
template <char ...chars> constexpr bool is_in(char x) { return ((x == chars) || ...); } // NOLINT(misc-redundant-expression)

#if defined(__SSE2__)
template <char s0>
Expand Down
2 changes: 1 addition & 1 deletion src/Processors/Transforms/WindowTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,7 @@ struct WindowFunctionNtile final : public WindowFunction
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Function {} takes exactly one parameter", name_);
}
auto type_id = argument_types[0]->getTypeId();
if (type_id != TypeIndex::UInt8 && type_id != TypeIndex::UInt16 && type_id != TypeIndex::UInt32 && type_id != TypeIndex::UInt32 && type_id != TypeIndex::UInt64)
if (type_id != TypeIndex::UInt8 && type_id != TypeIndex::UInt16 && type_id != TypeIndex::UInt32 && type_id != TypeIndex::UInt64)
{
throw Exception(ErrorCodes::BAD_ARGUMENTS, "ntile's argument type must be an unsigned integer (not larger then 64-bit), but got {}", argument_types[0]->getName());
}
Expand Down
17 changes: 5 additions & 12 deletions src/Storages/Distributed/DistributedAsyncInsertBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
#include <IO/Operators.h>
#include <IO/WriteBufferFromFile.h>

namespace
{

namespace fs = std::filesystem;

}

namespace CurrentMetrics
{
extern const Metric DistributedSend;
Expand Down Expand Up @@ -140,7 +133,7 @@ void DistributedAsyncInsertBatch::send()
total_bytes = 0;
recovered = false;

fs::resize_file(parent.current_batch_file_path, 0);
std::filesystem::resize_file(parent.current_batch_file_path, 0);
}

void DistributedAsyncInsertBatch::serialize()
Expand All @@ -149,7 +142,7 @@ void DistributedAsyncInsertBatch::serialize()
String tmp_file{parent.current_batch_file_path + ".tmp"};

auto dir_sync_guard = parent.getDirectorySyncGuard(parent.relative_path);
if (fs::exists(tmp_file))
if (std::filesystem::exists(tmp_file))
LOG_ERROR(parent.log, "Temporary file {} exists. Unclean shutdown?", backQuote(tmp_file));

{
Expand All @@ -161,7 +154,7 @@ void DistributedAsyncInsertBatch::serialize()
out.sync();
}

fs::rename(tmp_file, parent.current_batch_file_path);
std::filesystem::rename(tmp_file, parent.current_batch_file_path);
}

void DistributedAsyncInsertBatch::deserialize()
Expand All @@ -174,7 +167,7 @@ void DistributedAsyncInsertBatch::writeText(WriteBuffer & out)
{
for (const auto & file : files)
{
UInt64 file_index = parse<UInt64>(fs::path(file).stem());
UInt64 file_index = parse<UInt64>(std::filesystem::path(file).stem());
out << file_index << '\n';
}
}
Expand All @@ -185,7 +178,7 @@ void DistributedAsyncInsertBatch::readText(ReadBuffer & in)
{
UInt64 idx;
in >> idx >> "\n";
files.push_back(fs::absolute(fmt::format("{}/{}.bin", parent.path, idx)).string());
files.push_back(std::filesystem::absolute(fmt::format("{}/{}.bin", parent.path, idx)).string());
}

recovered = true;
Expand Down