srctree

Robin Linden parent 83798040 6f14ace7
ci: Update to clang-tidy 18

.clang-tidy added: 28, removed: 13, total 15
@@ -27,6 +27,12 @@
#
# -modernize-use-trailing-return-type: Stylistic change, and something we
# haven't been doing so far.
#
# TODO(robinlinden): Look into and enable:
# * bugprone-optional-value-conversion
# * clang-analyzer-optin.core.EnumCastOutOfRange
# * misc-header-include-cycle
# * performance-enum-size
Checks: >
bugprone-*,
cert-*,
@@ -60,15 +66,19 @@ Checks: >
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-narrowing-conversions,
-bugprone-optional-value-conversion,
-bugprone-unchecked-optional-access,
-cert-dcl21-cpp,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-google-build-using-namespace,
-misc-const-correctness,
-misc-header-include-cycle,
-misc-no-recursion,
-modernize-make-unique,
-modernize-use-emplace,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-performance-enum-size
 
WarningsAsErrors: "*"
 
 
.github/workflows/ci.yaml added: 28, removed: 13, total 15
@@ -303,12 +303,12 @@ jobs:
- name: Set up the llvm repository
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
- run: sudo apt-get update && sudo apt-get install --no-install-recommends clang-tidy-17 libc++abi-17-dev libc++-17-dev
- run: echo "CC=clang-17" >>$GITHUB_ENV && echo "CXX=clang++-17" >>$GITHUB_ENV
sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
- run: sudo apt-get update && sudo apt-get install --no-install-recommends clang-tidy-18 libc++abi-18-dev libc++-18-dev
- run: echo "CC=clang-18" >>$GITHUB_ENV && echo "CXX=clang++-18" >>$GITHUB_ENV
- run: |
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-17 100
sudo update-alternatives --set clang-tidy /usr/bin/clang-tidy-17
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 100
sudo update-alternatives --set clang-tidy /usr/bin/clang-tidy-18
update-alternatives --query clang-tidy
clang-tidy --version
- run: bazel build ... --config libc++ --config clang-tidy --keep_going
 
css/parser.h added: 28, removed: 13, total 15
@@ -10,6 +10,7 @@
#include "css/rule.h"
#include "css/style_sheet.h"
 
#include <concepts>
#include <cstddef>
#include <map>
#include <optional>
 
etest/etest2.h added: 28, removed: 13, total 15
@@ -7,6 +7,7 @@
 
#include "etest/cxx_compat.h"
 
#include <concepts>
#include <functional>
#include <iosfwd>
#include <optional>
 
net/socket.cpp added: 28, removed: 13, total 15
@@ -16,7 +16,8 @@
#include <asio/ssl/context.hpp>
#include <asio/ssl/stream.hpp>
#include <asio/ssl/stream_base.hpp>
#include <openssl/ssl.h>
// Provides us with SSL_set_tlsext_host_name, even if iwyu can't tell.
#include <openssl/ssl.h> // IWYU pragma: keep
 
#include <cstddef>
#include <memory>
 
util/string.h added: 28, removed: 13, total 15
@@ -11,6 +11,7 @@
#include <array>
#include <cassert>
#include <charconv>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <iomanip>
 
wasm/leb128.h added: 28, removed: 13, total 15
@@ -9,6 +9,7 @@
 
#include <cassert>
#include <cmath>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <istream>