From a376a2b27db380925afd016d11d14f8a943bbb5c Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 28 Jan 2026 14:47:18 -0800 Subject: [PATCH] Update pre-commit versions (#6666) Most versions are through `pre-commit autoupdate --freeze`, clang-format was manually updated to the latest at https://github.com/ssciwr/clang-format-wheel My read of the style changes here are that they seem fine, none of them look like regressions (which has caused me to delay/adjust updates in the past). --- .pre-commit-config.yaml | 6 +++--- common/check_internal.h | 3 +-- common/map.h | 24 +++++++++++++----------- toolchain/base/int.h | 4 ++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ab4212f20c3..2bb2f7d69fbe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0 + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -90,7 +90,7 @@ repos: types_or: [c++, def] language: python args: ['-i'] - additional_dependencies: ['clang-format==20.1.8'] + additional_dependencies: ['clang-format==21.1.8'] - repo: local hooks: @@ -134,7 +134,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: '850d8bf806620ef89a99381c5cf5ea2c1ea826dd' # frozen: v1.17.0 + rev: 'a66e98df7b4aeeb3724184b332785976d062b92e' # frozen: v1.19.1 hooks: - id: mypy # Use setup.cfg to match the command line. diff --git a/common/check_internal.h b/common/check_internal.h index 8ff1e932ab78..bcb04c9a8d2a 100644 --- a/common/check_internal.h +++ b/common/check_internal.h @@ -85,8 +85,7 @@ template void { +[[gnu::cold, clang::noinline]] auto CheckFail(Ts&&... values) -> void { if constexpr (llvm::StringRef(FormatStr).empty()) { // Skip the format string rendering if empty. Note that we don't skip it // even if there are no values as we want to have consistent handling of diff --git a/common/map.h b/common/map.h index 8fbdb6c02b3d..d4b59fb4efd5 100644 --- a/common/map.h +++ b/common/map.h @@ -108,8 +108,8 @@ class MapView // Lookup a key in the map and try to return a pointer to its value. Returns // null on a missing key. template - auto operator[](LookupKeyT lookup_key) const - -> ValueT* requires(std::default_initializable); + auto operator[](LookupKeyT lookup_key) const -> ValueT* + requires(std::default_initializable); // Run the provided callback for every key and value in the map. template @@ -221,10 +221,11 @@ class MapBase : protected RawHashtable::BaseImpl - auto operator[](LookupKeyT lookup_key) const - -> ValueT* requires(std::default_initializable) { - return ViewT(*this)[lookup_key]; - } + auto operator[](LookupKeyT lookup_key) const -> ValueT* + requires(std::default_initializable) + { + return ViewT(*this)[lookup_key]; + } // Convenience forwarder to the view type. template @@ -415,11 +416,12 @@ auto MapView::Lookup( template template auto MapView::operator[]( - LookupKeyT lookup_key) const - -> ValueT* requires(std::default_initializable) { - auto result = Lookup(lookup_key, KeyContextT()); - return result ? &result.value() : nullptr; - } + LookupKeyT lookup_key) const -> ValueT* + requires(std::default_initializable) +{ + auto result = Lookup(lookup_key, KeyContextT()); + return result ? &result.value() : nullptr; +} template template diff --git a/toolchain/base/int.h b/toolchain/base/int.h index c75d7bdd798a..7cc07bfd553e 100644 --- a/toolchain/base/int.h +++ b/toolchain/base/int.h @@ -168,8 +168,8 @@ class IntId : public Printable { // comparison, and so all of this ends up carefully constructed to enable very // small code size when testing for an embedded value and when that test fails // computing and using the index. - static constexpr int32_t ZeroIndexId = std::numeric_limits::min() >> - (TokenIdBitsShift + 1); + static constexpr int32_t ZeroIndexId = + std::numeric_limits::min() >> (TokenIdBitsShift + 1); // The minimum embedded value in an ID. static constexpr int32_t MinValue = ZeroIndexId + 1;