Skip to content

Commit 6902d1c

Browse files
authored
Update pre-commit (#249)
1 parent 273cd3c commit 6902d1c

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ name: Lint
22

33
on: [push, pull_request, workflow_dispatch]
44

5+
permissions: {}
6+
57
env:
68
FORCE_COLOR: 1
79
PIP_DISABLE_PIP_VERSION_CHECK: 1
810

9-
permissions:
10-
contents: read
11-
1211
jobs:
1312
lint:
1413
runs-on: ubuntu-latest
1514

1615
steps:
1716
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
1819
- uses: actions/setup-python@v5
1920
with:
2021
python-version: "3.x"

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Test
22

33
on: [push, pull_request, workflow_dispatch]
44

5-
permissions:
6-
contents: read
5+
permissions: {}
76

87
env:
98
FORCE_COLOR: 1
@@ -19,6 +18,8 @@ jobs:
1918

2019
steps:
2120
- uses: actions/checkout@v4
21+
with:
22+
persist-credentials: false
2223

2324
- name: Set up Python ${{ matrix.python-version }}
2425
uses: actions/setup-python@v5

.pre-commit-config.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,42 @@ repos:
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.7.1
17+
rev: v0.9.6
1818
hooks:
1919
- id: ruff-format
2020

2121
- repo: https://github.com/python-jsonschema/check-jsonschema
22-
rev: 0.29.4
22+
rev: 0.31.1
2323
hooks:
2424
- id: check-github-workflows
2525

2626
- repo: https://github.com/rhysd/actionlint
27-
rev: v1.7.3
27+
rev: v1.7.7
2828
hooks:
2929
- id: actionlint
3030

31+
- repo: https://github.com/woodruffw/zizmor-pre-commit
32+
rev: v1.3.1
33+
hooks:
34+
- id: zizmor
35+
3136
- repo: https://github.com/tox-dev/pyproject-fmt
3237
rev: v2.5.0
3338
hooks:
3439
- id: pyproject-fmt
3540

3641
- repo: https://github.com/abravalheri/validate-pyproject
37-
rev: v0.22
42+
rev: v0.23
3843
hooks:
3944
- id: validate-pyproject
4045

4146
- repo: https://github.com/tox-dev/tox-ini-fmt
42-
rev: 1.4.1
47+
rev: 1.5.0
4348
hooks:
4449
- id: tox-ini-fmt
4550

4651
- repo: https://github.com/rbubley/mirrors-prettier
47-
rev: v3.3.3
52+
rev: v3.5.1
4853
hooks:
4954
- id: prettier
5055
files: templates/switchers.js

build_docs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(self, name, *, status, branch_or_tag=None):
8686
if status not in self.STATUSES:
8787
raise ValueError(
8888
"Version status expected to be one of: "
89-
f"{', '.join(self.STATUSES|set(self.SYNONYMS.keys()))}, got {status!r}."
89+
f"{', '.join(self.STATUSES | set(self.SYNONYMS.keys()))}, got {status!r}."
9090
)
9191
self.name = name
9292
self.branch_or_tag = branch_or_tag
@@ -732,8 +732,7 @@ def build(self):
732732
shell=True,
733733
)
734734
subprocess.check_output(
735-
"sed -i s/\N{REPLACEMENT CHARACTER}/?/g "
736-
f"{self.checkout}/Doc/**/*.rst",
735+
f"sed -i s/\N{REPLACEMENT CHARACTER}/?/g {self.checkout}/Doc/**/*.rst",
737736
shell=True,
738737
)
739738

check_times.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def calc_time(lines: list[str]) -> None:
5050
fmt_duration = format_seconds(state_data["last_build_duration"])
5151
reason = state_data["triggered_by"]
5252
print(
53-
f"{start:%Y-%m-%d %H:%M UTC} | {version: <7} | {language: <8} | {fmt_duration :<14} | {reason}"
53+
f"{start:%Y-%m-%d %H:%M UTC} | {version: <7} | {language: <8} | {fmt_duration:<14} | {reason}"
5454
)
5555

5656
if line.endswith("Build start."):
@@ -64,7 +64,7 @@ def calc_time(lines: list[str]) -> None:
6464
timestamp = f"{line[:16]} UTC"
6565
_, fmt_duration = line.removesuffix(").").split("(")
6666
print(
67-
f"{timestamp: <20} | --FULL- | -BUILD-- | {fmt_duration :<14} | -----------"
67+
f"{timestamp: <20} | --FULL- | -BUILD-- | {fmt_duration:<14} | -----------"
6868
)
6969

7070
if in_progress:

0 commit comments

Comments
 (0)