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

Get ready for clang-tidy 20 #2356

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading