Selaa lähdekoodia

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).
Jon Ross-Perkins 3 kuukautta sitten
vanhempi
sitoutus
a376a2b27d
4 muutettua tiedostoa jossa 19 lisäystä ja 18 poistoa
  1. 3 3
      .pre-commit-config.yaml
  2. 1 2
      common/check_internal.h
  3. 13 11
      common/map.h
  4. 2 2
      toolchain/base/int.h

+ 3 - 3
.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.

+ 1 - 2
common/check_internal.h

@@ -85,8 +85,7 @@ template <TemplateString Kind, TemplateString File, int Line,
 #ifdef NDEBUG
 [[noreturn]]
 #endif
-[[gnu::cold, clang::noinline]] auto
-CheckFail(Ts&&... values) -> 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

+ 13 - 11
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 <typename LookupKeyT>
-  auto operator[](LookupKeyT lookup_key) const
-      -> ValueT* requires(std::default_initializable<KeyContextT>);
+  auto operator[](LookupKeyT lookup_key) const -> ValueT*
+    requires(std::default_initializable<KeyContextT>);
 
   // Run the provided callback for every key and value in the map.
   template <typename CallbackT>
@@ -221,10 +221,11 @@ class MapBase : protected RawHashtable::BaseImpl<InputKeyT, InputValueT,
 
   // Convenience forwarder to the view type.
   template <typename LookupKeyT>
-  auto operator[](LookupKeyT lookup_key) const
-      -> ValueT* requires(std::default_initializable<KeyContextT>) {
-        return ViewT(*this)[lookup_key];
-      }
+  auto operator[](LookupKeyT lookup_key) const -> ValueT*
+    requires(std::default_initializable<KeyContextT>)
+  {
+    return ViewT(*this)[lookup_key];
+  }
 
   // Convenience forwarder to the view type.
   template <typename CallbackT>
@@ -415,11 +416,12 @@ auto MapView<InputKeyT, InputValueT, InputKeyContextT>::Lookup(
 template <typename InputKeyT, typename InputValueT, typename InputKeyContextT>
 template <typename LookupKeyT>
 auto MapView<InputKeyT, InputValueT, InputKeyContextT>::operator[](
-    LookupKeyT lookup_key) const
-    -> ValueT* requires(std::default_initializable<KeyContextT>) {
-      auto result = Lookup(lookup_key, KeyContextT());
-      return result ? &result.value() : nullptr;
-    }
+    LookupKeyT lookup_key) const -> ValueT*
+  requires(std::default_initializable<KeyContextT>)
+{
+  auto result = Lookup(lookup_key, KeyContextT());
+  return result ? &result.value() : nullptr;
+}
 
 template <typename InputKeyT, typename InputValueT, typename InputKeyContextT>
 template <typename CallbackT>

+ 2 - 2
toolchain/base/int.h

@@ -168,8 +168,8 @@ class IntId : public Printable<IntId> {
   // 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<int32_t>::min() >>
-                                         (TokenIdBitsShift + 1);
+  static constexpr int32_t ZeroIndexId =
+      std::numeric_limits<int32_t>::min() >> (TokenIdBitsShift + 1);
 
   // The minimum embedded value in an ID.
   static constexpr int32_t MinValue = ZeroIndexId + 1;