Skip to content

Commit d588903

Browse files
[pre-commit.ci] pre-commit autoupdate (#427)
1 parent 93293ca commit d588903

11 files changed

Lines changed: 25 additions & 25 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ repos:
1818
pass_filenames: false
1919
always_run: true
2020
- repo: https://github.com/tox-dev/pyproject-fmt
21-
rev: "v2.25.1"
21+
rev: "v2.26.0"
2222
hooks:
2323
- id: pyproject-fmt
2424
# pin until toml-fmt-common 1.3.4 (with the _build_cli alias) is released; 1.3.3
2525
# dropped that symbol and breaks the published pyproject-fmt (tox-dev/toml-fmt#355)
2626
additional_dependencies: ["toml-fmt-common<1.3.3"]
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: "v0.15.20"
28+
rev: "v0.16.1"
2929
hooks:
3030
- id: ruff-format
3131
args: ["--config", "pyproject.toml"]
@@ -51,7 +51,7 @@ repos:
5151
- id: check-github-workflows
5252
args: ["--verbose"]
5353
- repo: https://github.com/codespell-project/codespell
54-
rev: v2.4.2
54+
rev: v2.4.3
5555
hooks:
5656
- id: codespell
5757
additional_dependencies: ["tomli>=2.4"]
@@ -60,7 +60,7 @@ repos:
6060
hooks:
6161
- id: validate-pyproject
6262
- repo: https://github.com/zizmorcore/zizmor-pre-commit
63-
rev: v1.26.1
63+
rev: v1.29.0
6464
hooks:
6565
- id: zizmor
6666
- repo: meta

pyproject-fmt/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Configuration for documentation build.""" # noqa: INP001
1+
"""Configuration for documentation build.""" # ruff: ignore[implicit-namespace-package]
22

33
from __future__ import annotations
44

pyproject-fmt/src/pyproject_fmt/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def filename(self) -> str:
3737
"""Filename operating on."""
3838
return "pyproject.toml"
3939

40-
def add_format_flags(self, parser: ArgumentGroup) -> None: # noqa: PLR6301
40+
def add_format_flags(self, parser: ArgumentGroup) -> None: # ruff: ignore[no-self-use]
4141
"""
4242
Additional formatter config.
4343
@@ -55,7 +55,7 @@ def add_format_flags(self, parser: ArgumentGroup) -> None: # noqa: PLR6301
5555

5656
def _version_argument(got: str) -> tuple[int, int]:
5757
parts = got.split(".")
58-
if len(parts) != 2: # noqa: PLR2004
58+
if len(parts) != 2: # ruff: ignore[magic-value-comparison]
5959
err = f"invalid version: {got}, must be e.g. 3.14"
6060
raise ArgumentTypeError(err)
6161
try:
@@ -77,7 +77,7 @@ def override_cli_from_section(self) -> tuple[str, ...]:
7777
"""Path where config overrides live."""
7878
return "tool", "pyproject-fmt"
7979

80-
def format(self, text: str, opt: PyProjectFmtNamespace) -> str: # noqa: PLR6301
80+
def format(self, text: str, opt: PyProjectFmtNamespace) -> str: # ruff: ignore[no-self-use]
8181
"""
8282
Perform the formatting.
8383

pyproject-fmt/tests/test_pyproject_toml_fmt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
import subprocess # noqa: S404
3+
import subprocess # ruff: ignore[suspicious-subprocess-import]
44
import sys
55
from pathlib import Path
66

tasks/changelog.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import os
1414
import re
15-
import subprocess # noqa: S404
15+
import subprocess # ruff: ignore[suspicious-subprocess-import]
1616
from argparse import ArgumentParser, Namespace
1717
from datetime import UTC, datetime
1818
from pathlib import Path
@@ -79,7 +79,7 @@ def run() -> None:
7979
print(new)
8080
logs_text = "\n".join(logs)
8181
changelog_file.write_text(new + changelog, encoding="utf-8")
82-
subprocess.run(["prek", "run", "--files", str(changelog_file)], check=False) # noqa: S603, S607
82+
subprocess.run(["prek", "run", "--files", str(changelog_file)], check=False) # ruff: ignore[subprocess-without-shell-equals-true, start-process-with-partial-path]
8383
else:
8484
logs_text = ""
8585

@@ -144,11 +144,11 @@ def regenerate_changelog(
144144
else:
145145
content += "\n"
146146
changelog_file.write_text(content, encoding="utf-8")
147-
subprocess.run(["prek", "run", "--files", str(changelog_file)], check=False) # noqa: S603, S607
147+
subprocess.run(["prek", "run", "--files", str(changelog_file)], check=False) # ruff: ignore[subprocess-without-shell-equals-true, start-process-with-partial-path]
148148
print(f"Regenerated changelog for {project} with {len(sections)} releases")
149149

150150

151-
def entries_between( # noqa: PLR0913, PLR0917
151+
def entries_between( # ruff: ignore[too-many-arguments, too-many-positional-arguments]
152152
gh_repo: GitHubRepository, git_repo: Repo, start: str | None, end: str, at: str, project: str
153153
) -> Iterator[str]:
154154
pr_re = re.compile(r"(?P<title>.*)[(]#(?P<pr>\d+)[)]")

tasks/generate_readme.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _dedent(text: str) -> str:
7979

8080
def strip_main_title(content: str) -> str:
8181
lines = content.splitlines()
82-
if len(lines) >= 2 and lines[1] and all(c == "=" for c in lines[1]): # noqa: PLR2004
82+
if len(lines) >= 2 and lines[1] and all(c == "=" for c in lines[1]): # ruff: ignore[magic-value-comparison]
8383
return "\n".join(lines[2:]).lstrip()
8484
return content
8585

@@ -191,7 +191,7 @@ def convert_md_to_rst_inline(line: str) -> str:
191191

192192

193193
if __name__ == "__main__":
194-
if len(sys.argv) != 2: # noqa: PLR2004
194+
if len(sys.argv) != 2: # ruff: ignore[magic-value-comparison]
195195
print("Usage: generate_readme.py <package>")
196196
sys.exit(1)
197197
main(sys.argv[1])

toml-fmt-common/src/toml_fmt_common/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
ArgumentParser,
1212
ArgumentTypeError,
1313
Namespace,
14-
_ArgumentGroup, # noqa: PLC2701
14+
_ArgumentGroup, # ruff: ignore[import-private-name]
1515
)
1616
from collections import deque
1717
from copy import deepcopy
@@ -305,7 +305,7 @@ def build_cli(of: TOMLFormatter[T]) -> tuple[ArgumentParser, Mapping[str, Callab
305305
of.add_format_flags(format_group)
306306
type_conversion: Mapping[str, Callable[[Any], Any]] = {
307307
a.dest: cast("Callable[[Any], Any]", a.type)
308-
for a in format_group._actions # noqa: SLF001
308+
for a in format_group._actions # ruff: ignore[private-member-access]
309309
if a.type and a.dest
310310
}
311311
msg = "pyproject.toml file(s) to format, use '-' to read from stdin"
@@ -361,7 +361,7 @@ def _handle_one(info: TOMLFormatter[T], config: _Config[T]) -> bool:
361361
before = config.toml
362362
changed = before != formatted
363363
if config.toml_filename is None or config.stdout: # when reading from stdin or writing to stdout, print new format
364-
print(formatted, end="") # noqa: T201
364+
print(formatted, end="") # ruff: ignore[print]
365365
return changed
366366

367367
if before != formatted and not config.check:
@@ -378,9 +378,9 @@ def _handle_one(info: TOMLFormatter[T], config: _Config[T]) -> bool:
378378

379379
if diff:
380380
diff = _color_diff(diff)
381-
print("\n".join(diff)) # print diff on change # noqa: T201
381+
print("\n".join(diff)) # print diff on change # ruff: ignore[print]
382382
else:
383-
print(f"no change for {name}") # noqa: T201
383+
print(f"no change for {name}") # ruff: ignore[print]
384384
return changed
385385

386386

toml-fmt-common/tests/test_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def filename(self) -> str:
4747
def override_cli_from_section(self) -> tuple[str, ...]:
4848
return "start", "sub"
4949

50-
def add_format_flags(self, parser: ArgumentGroup) -> None: # noqa: PLR6301
50+
def add_format_flags(self, parser: ArgumentGroup) -> None: # ruff: ignore[no-self-use]
5151
parser.add_argument("extra", help="this is something extra")
5252
parser.add_argument("-t", "--tuple-magic", default=(), type=lambda t: tuple(t.split(".")))
5353

tox-toml-fmt/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Configuration for documentation build.""" # noqa: INP001
1+
"""Configuration for documentation build.""" # ruff: ignore[implicit-namespace-package]
22

33
from __future__ import annotations
44

tox-toml-fmt/src/tox_toml_fmt/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def filename(self) -> str:
3636
"""Filename operating on."""
3737
return "tox.toml"
3838

39-
def add_format_flags(self, parser: ArgumentGroup) -> None: # noqa: PLR6301
39+
def add_format_flags(self, parser: ArgumentGroup) -> None: # ruff: ignore[no-self-use]
4040
"""
4141
Additional formatter config.
4242
@@ -55,7 +55,7 @@ def override_cli_from_section(self) -> tuple[str, ...]:
5555
"""Path where config overrides live."""
5656
return ("tox-toml-fmt",)
5757

58-
def format(self, text: str, opt: PyProjectFmtNamespace) -> str: # noqa: PLR6301
58+
def format(self, text: str, opt: PyProjectFmtNamespace) -> str: # ruff: ignore[no-self-use]
5959
"""
6060
Perform the formatting.
6161

0 commit comments

Comments
 (0)