maint: Update pre-commit hooks (#3746)

This commit is contained in:
Ayaz Salikhov 2025-01-15 17:38:36 +00:00 committed by GitHub
parent 8591bbe4fd
commit 95eb248ee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 22 additions and 23 deletions

View File

@ -20,12 +20,12 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.9.1
hooks:
- id: ruff
args: [--fix]
@ -36,7 +36,7 @@ repos:
- id: blacken-docs
additional_dependencies: [black==24.10.0]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.3
rev: v19.1.7
hooks:
- id: clang-format
args: [--style=file]
@ -46,7 +46,7 @@ repos:
hooks:
- id: cmake-format
- repo: https://github.com/Quantco/pre-commit-mirrors-typos
rev: 1.28.2
rev: 1.29.4
hooks:
- id: typos-conda
exclude: (CHANGELOG.md)

View File

@ -84,7 +84,7 @@ class Mermaid(Directive):
if self.content:
return [
document.reporter.warning(
"Mermaid directive cannot have both content and " "a filename argument",
"Mermaid directive cannot have both content and a filename argument",
line=self.lineno,
)
]
@ -98,7 +98,7 @@ class Mermaid(Directive):
except OSError: # noqa
return [
document.reporter.warning(
"External Mermaid file %r not found or reading " "it failed" % filename,
"External Mermaid file %r not found or reading it failed" % filename,
line=self.lineno,
)
]
@ -183,13 +183,12 @@ def render_mm(self, code, options, fmt, prefix="mermaid"):
logger.info(stdout)
if p.returncode != 0:
raise MermaidError(
"Mermaid exited with error:\n[stderr]\n%s\n" "[stdout]\n%s" % (stderr, stdout)
)
raise MermaidError(f"Mermaid exited with error:\n[stderr]\n{stderr}\n[stdout]\n{stdout}")
if not os.path.isfile(outfn):
raise MermaidError(
"Mermaid did not produce an output file:\n[stderr]\n%s\n"
"[stdout]\n%s" % (stderr, stdout)
"Mermaid did not produce an output file:\n[stderr]\n{}\n[stdout]\n{}".format(
stderr, stdout
)
)
return relfn, outfn
@ -219,7 +218,7 @@ def render_mm_html(self, node, code, options, prefix="mermaid", imgcls=None, alt
try:
if fmt not in ("png", "svg"):
raise MermaidError(
"mermaid_output_format must be one of 'raw', 'png', " "'svg', but is %r" % fmt
"mermaid_output_format must be one of 'raw', 'png', 'svg', but is %r" % fmt
)
fname, outfn = render_mm(self, code, options, fmt, prefix)
@ -284,7 +283,7 @@ def render_mm_latex(self, node, code, options, prefix="mermaid"):
if p.returncode != 0:
raise MermaidError(
"PdfCrop exited with error:\n[stderr]\n%s\n" "[stdout]\n%s" % (stderr, stdout)
f"PdfCrop exited with error:\n[stderr]\n{stderr}\n[stdout]\n{stdout}"
)
if not os.path.isfile(outfn):
raise MermaidError(

View File

@ -136,7 +136,7 @@ namespace mamba
const PrefixData& prefix
) -> solver::libsolv::RepoInfo
{
// TODO(C++20): We could do a PrefixData range that returns packages without storing thems.
// TODO(C++20): We could do a PrefixData range that returns packages without storing them.
auto pkgs = prefix.sorted_records();
// TODO(C++20): We only need a range that concatenate both
for (auto&& pkg : get_virtual_packages(ctx.platform))

View File

@ -1,4 +1,4 @@
{"_cache_control":"{{}}\",,,\"","_etag":"\n\n\"\"randome ecx,,ssd\n,,\"","_mod":"Fri, 11 Feb 2022 13:52:44 GMT","_url":"file:///Users/wolfvollprecht/Programs/mamba/mamba/tests/channel_a/linux-64/repodata.json",
{"_cache_control":"{{}}\",,,\"","_etag":"\n\n\"\"random ecx,,ssd\n,,\"","_mod":"Fri, 11 Feb 2022 13:52:44 GMT","_url":"file:///Users/wolfvollprecht/Programs/mamba/mamba/tests/channel_a/linux-64/repodata.json",
"info": {
"subdir": "linux-64"
}

View File

@ -377,7 +377,7 @@ namespace mamba
j = SubdirMetadata::read(cache_folder / "test_4.json").value();
REQUIRE(j.cache_control() == "{{}}\",,,\"");
REQUIRE(j.etag() == "\n\n\"\"randome ecx,,ssd\n,,\"");
REQUIRE(j.etag() == "\n\n\"\"random ecx,,ssd\n,,\"");
REQUIRE(j.last_modified() == "Fri, 11 Feb 2022 13:52:44 GMT");
REQUIRE(
j.url()

View File

@ -18,7 +18,7 @@ def test_base(tmp_home, tmp_root_prefix, prefix_selection):
assert "environment : base (active)" in infos
assert f"env location : {tmp_root_prefix}" in infos
assert f"user config files : {tmp_home / '.mambarc' }" in infos
assert f"user config files : {tmp_home / '.mambarc'}" in infos
assert f"base environment : {tmp_root_prefix}" in infos
@ -31,10 +31,10 @@ def test_env(tmp_home, tmp_root_prefix, tmp_env_name, tmp_prefix, prefix_selecti
else:
infos = helpers.info()
assert f"envs directories : {tmp_root_prefix / 'envs' }" in infos
assert f"envs directories : {tmp_root_prefix / 'envs'}" in infos
assert f"environment : {tmp_env_name} (active)" in infos
assert f"env location : {tmp_prefix}" in infos
assert f"user config files : {tmp_home / '.mambarc' }" in infos
assert f"user config files : {tmp_home / '.mambarc'}" in infos
assert f"base environment : {tmp_root_prefix}" in infos
@ -73,8 +73,8 @@ def test_not_env(tmp_home, tmp_root_prefix, prefix_selection, existing_prefix):
location = prefix
print(infos)
assert f"envs directories : {tmp_root_prefix / 'envs' }" in infos
assert f"envs directories : {tmp_root_prefix / 'envs'}" in infos
assert f"environment : {expected_name}" in infos
assert f"env location : {location}" in infos
assert f"user config files : {tmp_home / '.mambarc' }" in infos
assert f"user config files : {tmp_home / '.mambarc'}" in infos
assert f"base environment : {tmp_root_prefix}" in infos

View File

@ -64,11 +64,11 @@ def commands(release_version, changes):
files_to_commit = ""
for c in changes:
files_to_commit += f" {c}/CHANGELOG.md \\\n"
files_to_commit += f" {templates[c][:-len('.tmpl')]} \\\n"
files_to_commit += f" {templates[c][: -len('.tmpl')]} \\\n"
files_to_commit = files_to_commit[:-3]
for c in changes:
files_to_commit += f" {templates[c][:-len('.tmpl')]} \\\n"
files_to_commit += f" {templates[c][: -len('.tmpl')]} \\\n"
print("\n\n--- REVERT ---\n\n")
print(f"git checkout origin/main -- \\\n{files_to_commit[:-3]}\n\n")