Skip to content

Commit

Permalink
Get ready for clang-tidy 20
Browse files Browse the repository at this point in the history
... but for now, just use clang-tidy 19 in shell.nix.
TODO: Update to clang-tidy 19 in CI
  • Loading branch information
hzeller committed Feb 17, 2025
1 parent 6779bea commit 2b5d10b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ verible_used_stdenv.mkDerivation {
lcov # coverage html generation.
bazel-buildtools # buildifier

clang-tools_18 # for clang-tidy
clang-tools_17 # for clang-format
llvmPackages_19.clang-tools # for clang-tidy
llvmPackages_17.clang-tools # for clang-format
];
shellHook = ''
# clang tidy: use latest.
export CLANG_TIDY=${pkgs.clang-tools_18}/bin/clang-tidy
export CLANG_TIDY=${pkgs.llvmPackages_19.clang-tools}/bin/clang-tidy
# There is too much volatility between even micro-versions of
# clang-format 18. Let's use 17 for now.
export CLANG_FORMAT=${pkgs.clang-tools_17}/bin/clang-format
# later clang-format. Let's use stable 17 for now.
export CLANG_FORMAT=${pkgs.llvmPackages_17.clang-tools}/bin/clang-format
'';
}
4 changes: 3 additions & 1 deletion verible/common/util/container-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ template <class M>
const typename M::mapped_type &FindWithDefault(
M &map, const typename M::key_type &key, const typename M::mapped_type &d) {
auto found = map.find(key);
return (found == map.end()) ? d : found->second;
return (found == map.end())
? d // NOLINT(bugprone-return-const-ref-from-parameter)
: found->second;
}

template <class M>
Expand Down
1 change: 1 addition & 0 deletions verible/verilog/parser/verilog-lexical-context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include "verible/common/text/token-info.h"
#include "verible/common/util/logging.h"
#include "verible/common/util/with-reason.h"
#include "verible/verilog/parser/verilog-token-enum.h"

namespace verilog {
Expand Down
1 change: 1 addition & 0 deletions verible/verilog/tools/ls/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ cc_library(
"//verible/common/text:text-structure",
"//verible/common/text:token-info",
"//verible/common/text:tree-utils",
"//verible/common/util:interval",
"//verible/common/util:logging",
"//verible/verilog/CST:declaration",
"//verible/verilog/CST:dimensions",
Expand Down
1 change: 1 addition & 0 deletions verible/verilog/tools/ls/autoexpand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "verible/common/text/text-structure.h"
#include "verible/common/text/token-info.h"
#include "verible/common/text/tree-utils.h"
#include "verible/common/util/interval.h"
#include "verible/common/util/logging.h"
#include "verible/verilog/CST/declaration.h"
#include "verible/verilog/CST/dimensions.h"
Expand Down

0 comments on commit 2b5d10b

Please sign in to comment.