mirror of
https://github.com/astral-sh/ruff
synced 2026-01-11 00:24:13 -05:00
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:
@@ -159,7 +159,7 @@ def format_contents(src: str) -> tuple[str, Sequence[CodeBlockError]]:
|
||||
case _:
|
||||
# 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.
|
||||
return f'{match["before"]}{match["code"]}{match["after"]}'
|
||||
return f"{match['before']}{match['code']}{match['after']}"
|
||||
|
||||
code = textwrap.dedent(match["code"])
|
||||
try:
|
||||
@@ -170,7 +170,7 @@ def format_contents(src: str) -> tuple[str, Sequence[CodeBlockError]]:
|
||||
raise e
|
||||
|
||||
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)
|
||||
return src, errors
|
||||
|
||||
@@ -104,9 +104,9 @@ class Repository(NamedTuple):
|
||||
stdout=PIPE,
|
||||
)
|
||||
git_sha_stdout, _ = await git_sha_process.communicate()
|
||||
assert (
|
||||
await git_sha_process.wait() == 0
|
||||
), f"Failed to retrieve commit sha at {checkout_dir}"
|
||||
assert await git_sha_process.wait() == 0, (
|
||||
f"Failed to retrieve commit sha at {checkout_dir}"
|
||||
)
|
||||
return git_sha_stdout.decode().strip()
|
||||
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ def main() -> None:
|
||||
{
|
||||
"redirects": {
|
||||
"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
|
||||
},
|
||||
},
|
||||
|
||||
@@ -26,9 +26,9 @@ class Benchmark(enum.Enum):
|
||||
def which_tool(name: str) -> Path:
|
||||
tool = shutil.which(name)
|
||||
|
||||
assert (
|
||||
tool is not None
|
||||
), f"Tool {name} not found. Run the script with `uv run <script>`."
|
||||
assert tool is not None, (
|
||||
f"Tool {name} not found. Run the script with `uv run <script>`."
|
||||
)
|
||||
|
||||
return Path(tool)
|
||||
|
||||
@@ -63,7 +63,9 @@ class Knot(Tool):
|
||||
(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:
|
||||
command = [str(self.path), "-v"]
|
||||
|
||||
Reference in New Issue
Block a user