Skip to content

Commit

Permalink
Modernize clang-tidy config
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Aug 27, 2023
1 parent 75136f4 commit 0500e85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
Checks: '*,-abseil-*,-altera-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-hicpp-no-array-decay,-hicpp-vararg,-llvmlibc-*,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-magic-numbers'
Checks: '*,-abseil-*,-altera-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-fuchsia-*,-hicpp-no-array-decay,-hicpp-vararg,-llvmlibc-*,-modernize-use-trailing-return-type,-readability-identifier-length,-readability-implicit-bool-conversion,-readability-magic-numbers'
#
# For a list of check options, see:
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
Expand Down Expand Up @@ -41,6 +41,9 @@ Checks: '*,-abseil-*,-altera-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoregu
# modernize-use-trailing-return-type
# I am not quite that modern.
#
# readability-identifier-length
# Short identifiers are okay in some cases.
#
# readability-implicit-bool-conversion
# I don't think this makes the code more readable.
#
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ endif(CPPCHECK)
#
#-----------------------------------------------------------------------------
message(STATUS "Looking for clang-tidy")
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-14 clang-tidy-13 clang-tidy-12 clang-tidy-11)
find_program(CLANG_TIDY NAMES clang-tidy clang-tidy-17 clang-tidy-16 clang-tidy-15)

if(CLANG_TIDY)
message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
Expand Down
2 changes: 1 addition & 1 deletion src/osp-find-colocated-nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Bucket

auto const bytes = m_data.size() * sizeof(osmium::Location);
auto const length = ::write(m_fd, m_data.data(), bytes);
if (length != long(bytes)) { // NOLINT(google-runtime-int)
if (length != static_cast<long>(bytes)) { // NOLINT(google-runtime-int)
throw std::system_error{errno, std::system_category(),
std::string{"can't write to file '"} +
m_filename + "'"};
Expand Down

0 comments on commit 0500e85

Please sign in to comment.