Skip to content

Commit c2cc96c

Browse files
authored
Add zizmor security linter to pre-commit
1 parent f038c23 commit c2cc96c

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.7.1
3+
rev: v0.8.2
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
@@ -25,23 +25,28 @@ repos:
2525
- id: trailing-whitespace
2626

2727
- repo: https://github.com/python-jsonschema/check-jsonschema
28-
rev: 0.29.4
28+
rev: 0.30.0
2929
hooks:
3030
- id: check-dependabot
3131
- id: check-github-workflows
3232

3333
- repo: https://github.com/rhysd/actionlint
34-
rev: v1.7.3
34+
rev: v1.7.4
3535
hooks:
3636
- id: actionlint
3737

38+
- repo: https://github.com/woodruffw/zizmor-pre-commit
39+
rev: v0.8.0
40+
hooks:
41+
- id: zizmor
42+
3843
- repo: https://github.com/tox-dev/pyproject-fmt
39-
rev: v2.4.3
44+
rev: v2.5.0
4045
hooks:
4146
- id: pyproject-fmt
4247

4348
- repo: https://github.com/abravalheri/validate-pyproject
44-
rev: v0.22
49+
rev: v0.23
4550
hooks:
4651
- id: validate-pyproject
4752

add_to_pydotorg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
import re
3030
import subprocess
3131
import sys
32+
from collections.abc import Generator
3233
from os import path
33-
from typing import Any, Generator, NoReturn
34+
from typing import Any, NoReturn
3435

3536
import requests
3637

release.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
import subprocess
2020
import sys
2121
import tempfile
22+
from collections.abc import Generator
2223
from contextlib import contextmanager
2324
from dataclasses import dataclass
2425
from pathlib import Path
2526
from typing import (
2627
Any,
2728
Callable,
28-
Generator,
2929
Literal,
3030
Protocol,
3131
Self,
@@ -524,8 +524,8 @@ def tarball(source: str, clamp_mtime: str) -> None:
524524
checksum_xz = hashlib.md5()
525525
with open(xz, "rb") as data:
526526
checksum_xz.update(data.read())
527-
print(" %s %8s %s" % (checksum_tgz.hexdigest(), int(os.path.getsize(tgz)), tgz))
528-
print(" %s %8s %s" % (checksum_xz.hexdigest(), int(os.path.getsize(xz)), xz))
527+
print(f" {checksum_tgz.hexdigest()} {os.path.getsize(tgz):8} {tgz}")
528+
print(f" {checksum_xz.hexdigest()} {os.path.getsize(xz):8} {xz}")
529529

530530

531531
def export(tag: Tag, silent: bool = False, skip_docs: bool = False) -> None:

run_release.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
import tempfile
2222
import time
2323
import urllib.request
24+
from collections.abc import Iterator
2425
from pathlib import Path
25-
from typing import Any, Iterator, cast
26+
from typing import Any, cast
2627

2728
import aiohttp
2829
import gnupg # type: ignore[import-untyped]

0 commit comments

Comments
 (0)