Selaa lähdekoodia

pre-commit autoupdate (#6845)

Assisted-by: Google Antigravity with Gemini
Jon Ross-Perkins 1 kuukausi sitten
vanhempi
sitoutus
4b076291c9

+ 2 - 2
.pre-commit-config.yaml

@@ -45,7 +45,7 @@ repos:
 
   # Formatters should be run late so that they can re-format any prior changes.
   - repo: https://github.com/psf/black
-    rev: 8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # frozen: 25.1.0
+    rev: 35ea67920b7f6ac8e09be1c47278752b1e827f76 # frozen: 26.3.0
     hooks:
       - id: black
   - repo: local
@@ -159,7 +159,7 @@ repos:
               .*_test\.py
           )$
   - repo: https://github.com/codespell-project/codespell
-    rev: 63c8f8312b7559622c0d82815639671ae42132ac # frozen: v2.4.1
+    rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2
     hooks:
       - id: codespell
         args: ['-I', '.codespell_ignore', '--uri-ignore-words-list', '*']

+ 1 - 1
bazel/version/gen_tmpl.py

@@ -88,7 +88,7 @@ def main() -> None:
             # Remove line endings.
             line = line.rstrip("\r\n")
             # Exactly matches our pattern
-            (key, value) = line.split(" ", 1)
+            key, value = line.split(" ", 1)
             key = key.removeprefix("STABLE_")
             if key in substitutions:
                 if args.verbose:

+ 1 - 1
examples/bazel/update_module_to_nightly.py

@@ -158,7 +158,7 @@ def main() -> None:
     version = get_latest_version()
     new_block = generate_override(version)
 
-    (new_content, count) = OVERRIDE_PATTERN.subn(new_block, content)
+    new_content, count = OVERRIDE_PATTERN.subn(new_block, content)
     if count > 0:
         log("Existing override found, replacing with a fresh one")
     else:

+ 0 - 1
github_tools/github_helpers_test.py

@@ -11,7 +11,6 @@ from unittest import mock
 
 import github_helpers
 
-
 _TEST_QUERY = """
 query {
   top(login: "foo") {

+ 0 - 1
github_tools/pr_comments.py

@@ -16,7 +16,6 @@ import importlib.util
 import textwrap
 from typing import Any, Callable, Optional
 
-
 # Do some extra work to support direct runs.
 try:
     from github_tools import github_helpers

+ 1 - 1
scripts/bench_runner.py

@@ -454,7 +454,7 @@ def render_fixed_width_float(x: float) -> str:
     if math.isinf(x):
         return f"{x:>4f}{'':<3}"
 
-    (frac, whole) = math.modf(x)
+    frac, whole = math.modf(x)
     frac_str = f"{math.fabs(frac):<4.3f}"[1:]
     return f"{int(whole):> 3}{frac_str}"
 

+ 1 - 1
scripts/fix_cc_deps.py

@@ -227,7 +227,7 @@ def get_missing_deps(
             file_content,
             re.MULTILINE,
         ):
-            (full_include, include_open, header) = header_groups
+            full_include, include_open, header = header_groups
             is_system_include = include_open == "<"
 
             if header in rule_files:

+ 2 - 4
scripts/lldbinit.py

@@ -39,8 +39,7 @@ dump_re = re.compile(r'\(std::string\) "([\s\S]+)"', re.MULTILINE)
 # A helper to ease calling the Dump() free functions.
 def cmd_dump(debugger: Any, command: Any, result: Any, dict: Any) -> None:
     def print_usage() -> None:
-        print(
-            """
+        print("""
 Dumps the value of an associated ID, using the C++ Dump() functions.
 
 Usage:
@@ -66,8 +65,7 @@ Example usage:
   # Dumps the instruction with id 42, with a `context()` method for accessing
   # the `Check::Context&`.
   dump context() inst42
-"""
-        )
+""")
 
     args = command.split(" ")
     if len(args) < 2:

+ 6 - 11
scripts/source_stats.py

@@ -11,11 +11,11 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 """
 
 import argparse
-from alive_progress import alive_bar  # type:ignore
+from alive_progress import alive_bar  # type: ignore
 import math
 from multiprocessing import Pool
 import re
-import termplotlib as tpl  # type:ignore
+import termplotlib as tpl  # type: ignore
 from pathlib import Path
 from typing import Optional
 from dataclasses import dataclass, field, asdict
@@ -200,8 +200,7 @@ def main() -> None:
                 stats.accumulate(file_stats)
                 bar()
 
-    print(
-        """
+    print("""
 ## Stats ##
 Lines: %(lines)d
 Blank lines: %(blank_lines)d
@@ -215,9 +214,7 @@ Int literals: %(int_literals)d
 Float literals: %(float_literals)d
 Symbols: %(symbols)d
 Keywords: %(keywords)d
-IDs: %(identifiers)d"""
-        % asdict(stats)
-    )
+IDs: %(identifiers)d""" % asdict(stats))
 
     tokens = (
         stats.string_literals
@@ -227,8 +224,7 @@ IDs: %(identifiers)d"""
         + stats.keywords
         + stats.identifiers
     )
-    print(
-        f"""
+    print(f"""
 Fraction of blank lines: {stats.blank_lines / stats.lines}
 Fraction of comment lines: {stats.comment_lines / stats.lines}
 
@@ -239,8 +235,7 @@ Fraction float literals: {stats.float_literals / tokens}
 Fraction symbols: {stats.symbols / tokens}
 Fraction keywords: {stats.keywords / tokens}
 Fraction IDs: {stats.identifiers / tokens}
-    """
-    )
+    """)
 
     def print_histogram(
         title: str, data: dict[int, int], column_format: str

+ 0 - 1
toolchain/diagnostics/check_diagnostics.py

@@ -21,7 +21,6 @@ import re
 import sys
 from typing import Dict, List, NamedTuple, Set
 
-
 # Example or test diagnostics, ignored because they're expected to not pass.
 IGNORED = set(
     [

+ 1 - 1
toolchain/lex/lex.cpp

@@ -543,7 +543,7 @@ CARBON_DISPATCH_LEX_TOKEN(LexHash)
 CARBON_DISPATCH_LEX_TOKEN(LexNumericLiteral)
 CARBON_DISPATCH_LEX_TOKEN(LexStringLiteral)
 
-// A set of custom dispatch functions that pre-select the symbol token to lex.
+// A set of custom dispatch functions that preselect the symbol token to lex.
 #define CARBON_DISPATCH_LEX_SYMBOL_TOKEN(LexMethod)                          \
   static auto Dispatch##LexMethod##SymbolToken(                              \
       Lexer& lexer, llvm::StringRef source_text, ssize_t position) -> void { \