This commit is contained in:
Nikita Mikhaylov 2021-05-27 23:43:00 +03:00
parent 5e65aff3fd
commit c127c433c2
7 changed files with 15 additions and 11 deletions

View File

@ -154,6 +154,10 @@ def parse_env_variables(build_type, compiler, sanitizer, package_type, image_typ
if clang_tidy:
cmake_flags.append('-DENABLE_CLANG_TIDY=1')
cmake_flags.append('-DENABLE_UTILS=1')
cmake_flags.append('-DUSE_GTEST=1')
cmake_flags.append('-DENABLE_TESTS=1')
cmake_flags.append('-DENABLE_EXAMPLES=1')
# Don't stop on first error to find more clang-tidy errors in one run.
result.append('NINJA_FLAGS=-k0')

View File

@ -19,7 +19,7 @@ public:
using list_type = std::list<std::pair<key_type, value_type>>;
using map_type = std::unordered_map<key_type, typename list_type::iterator>;
LRUHashMapBasic(size_t max_size_, bool preallocated = false)
explicit LRUHashMapBasic(size_t max_size_, bool preallocated = false)
: hash_map(preallocated ? max_size_ : 32)
, max_size(max_size_)
{

View File

@ -94,7 +94,7 @@ struct AggregateIndependentWithSequentialKeysOptimization
if (it != begin && *it == prev_key)
{
assert(place != nullptr);
updater(place->getMapped());
updater(place->getMapped()); // NOLINT
continue;
}
prev_key = *it;

View File

@ -26,6 +26,7 @@ namespace ErrorCodes
namespace
{
/// NOLINTNEXTLINE(cert-dcl50-cpp)
__attribute__((__noinline__)) int64_t our_syscall(...)
{
__asm__ __volatile__ (R"(

View File

@ -55,7 +55,7 @@ ColumnPtr FunctionReplicate::executeImpl(const ColumnsWithTypeAndName & argument
offsets = array_column->getOffsetsPtr();
}
const auto & offsets_data = assert_cast<const ColumnArray::ColumnOffsets &>(*offsets).getData();
const auto & offsets_data = assert_cast<const ColumnArray::ColumnOffsets &>(*offsets).getData(); /// NOLINT
return ColumnArray::create(first_column->replicate(offsets_data)->convertToFullColumnIfConst(), offsets);
}

View File

@ -81,8 +81,8 @@ int main(int argc, char ** argv)
<< "Written " << n << " numbers (" << wb.count() / 1000000.0 << " MB) in " << watch.elapsedSeconds() << " sec., "
<< n / watch.elapsedSeconds() << " num/s., "
<< wb.count() / watch.elapsedSeconds() / 1000000 << " MB/s., "
<< watch.elapsed() / n << " ns/num., "
<< tsc / n << " ticks/num., "
<< watch.elapsed() / n << " ns/num., " // NOLINT
<< tsc / n << " ticks/num., " // NOLINT
<< watch.elapsed() / wb.count() << " ns/byte., "
<< tsc / wb.count() << " ticks/byte."
<< std::endl;

View File

@ -73,8 +73,7 @@ void testCreateList(zkutil::ZooKeeper & zk)
void testCreateSetVersionRequest(zkutil::ZooKeeper & zk)
{
zk.create("/data/check_data", "d", zkutil::CreateMode::Persistent);
Coordination::Stat stat;
std::string result = zk.get("/data/check_data", &stat);
Coordination::Stat stat{};
try
{
zk.set("/data/check_data", "e", stat.version + 2);
@ -224,7 +223,7 @@ std::string random_string(size_t length)
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
const size_t max_index = (sizeof(charset) - 1);
return charset[rand() % max_index];
return charset[rand() % max_index]; /// NOLINT
};
std::string str(length, 0);
std::generate_n(str.begin(), length, randchar);
@ -259,8 +258,8 @@ void createOnPrefix(const std::string & zkhost, const String & path_prefix, size
holder_futures.push_back(zk.asyncCreate(path, random_string(datasize), zkutil::CreateMode::Persistent));
}
for (size_t i = 0; i < holder_futures.size(); ++i)
holder_futures[i].get();
for (auto & future : holder_futures)
future.get();
}
catch (...)
{