Update pre-commit dependencies (#15433)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
This commit is contained in:
renovate[bot] 2025-01-11 17:18:13 +00:00 committed by GitHub
parent 7d20277111
commit 22edee2353
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 15 additions and 13 deletions

View file

@ -73,7 +73,7 @@ repos:
pass_filenames: false # This makes it a lot faster pass_filenames: false # This makes it a lot faster
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6 rev: v0.9.1
hooks: hooks:
- id: ruff-format - id: ruff-format
- id: ruff - id: ruff
@ -91,12 +91,12 @@ repos:
# zizmor detects security vulnerabilities in GitHub Actions workflows. # zizmor detects security vulnerabilities in GitHub Actions workflows.
# Additional configuration for the tool is found in `.github/zizmor.yml` # Additional configuration for the tool is found in `.github/zizmor.yml`
- repo: https://github.com/woodruffw/zizmor-pre-commit - repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.0.0 rev: v1.0.1
hooks: hooks:
- id: zizmor - id: zizmor
- repo: https://github.com/python-jsonschema/check-jsonschema - repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0 rev: 0.31.0
hooks: hooks:
- id: check-github-workflows - id: check-github-workflows

View file

@ -159,7 +159,7 @@ def format_contents(src: str) -> tuple[str, Sequence[CodeBlockError]]:
case _: case _:
# We are only interested in checking the formatting of py or pyi code # We are only interested in checking the formatting of py or pyi code
# blocks so we can return early if the language is not one of these. # blocks so we can return early if the language is not one of these.
return f'{match["before"]}{match["code"]}{match["after"]}' return f"{match['before']}{match['code']}{match['after']}"
code = textwrap.dedent(match["code"]) code = textwrap.dedent(match["code"])
try: try:
@ -170,7 +170,7 @@ def format_contents(src: str) -> tuple[str, Sequence[CodeBlockError]]:
raise e raise e
code = textwrap.indent(code, match["indent"]) code = textwrap.indent(code, match["indent"])
return f'{match["before"]}{code}{match["after"]}' return f"{match['before']}{code}{match['after']}"
src = SNIPPED_RE.sub(_snipped_match, src) src = SNIPPED_RE.sub(_snipped_match, src)
return src, errors return src, errors

View file

@ -104,9 +104,9 @@ class Repository(NamedTuple):
stdout=PIPE, stdout=PIPE,
) )
git_sha_stdout, _ = await git_sha_process.communicate() git_sha_stdout, _ = await git_sha_process.communicate()
assert ( assert await git_sha_process.wait() == 0, (
await git_sha_process.wait() == 0 f"Failed to retrieve commit sha at {checkout_dir}"
), f"Failed to retrieve commit sha at {checkout_dir}" )
return git_sha_stdout.decode().strip() return git_sha_stdout.decode().strip()

View file

@ -258,7 +258,7 @@ def main() -> None:
{ {
"redirects": { "redirects": {
"redirect_maps": { "redirect_maps": {
f'rules/{rule["code"]}.md': f'rules/{rule["name"]}.md' f"rules/{rule['code']}.md": f"rules/{rule['name']}.md"
for rule in rules for rule in rules
}, },
}, },

View file

@ -26,9 +26,9 @@ class Benchmark(enum.Enum):
def which_tool(name: str) -> Path: def which_tool(name: str) -> Path:
tool = shutil.which(name) tool = shutil.which(name)
assert ( assert tool is not None, (
tool is not None f"Tool {name} not found. Run the script with `uv run <script>`."
), f"Tool {name} not found. Run the script with `uv run <script>`." )
return Path(tool) return Path(tool)
@ -63,7 +63,9 @@ class Knot(Tool):
(Path(__file__) / "../../../../../target/release/red_knot").resolve() (Path(__file__) / "../../../../../target/release/red_knot").resolve()
) )
assert self.path.is_file(), f"Red Knot not found at '{self.path}'. Run `cargo build --release --bin red_knot`." assert self.path.is_file(), (
f"Red Knot not found at '{self.path}'. Run `cargo build --release --bin red_knot`."
)
def cold_command(self, project: Project, venv: Venv) -> Command: def cold_command(self, project: Project, venv: Venv) -> Command:
command = [str(self.path), "-v"] command = [str(self.path), "-v"]