Skip to content

Commit 8a557a4

Browse files
committed
Add zizmor as pre-commit hook
1 parent d158445 commit 8a557a4

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
- cron: '0 0 * * 1,5'
55
env:
66
FORCE_COLOR: 1
7-
7+
permissions: {}
88
jobs:
99
lint:
1010
runs-on: ubuntu-latest

.github/workflows/update-lint-and-build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ on:
77
branches:
88
- '*'
99
workflow_dispatch:
10-
10+
permissions: {}
1111
jobs:
1212
update:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
fail-fast: false
1616
matrix:
1717
version: [3.15, 3.14, 3.13, 3.12, 3.11, '3.10']
18+
permissions:
19+
contents: write # commit and push
1820
steps:
1921
- uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1
2022
with:
@@ -32,6 +34,7 @@ jobs:
3234
with:
3335
ref: ${{ matrix.version }}
3436
fetch-depth: 0
37+
persist-credentials: false
3538
- name: Recreate Transifex config
3639
run: ./manage_translation.py recreate_tx_config
3740
env:
@@ -81,6 +84,7 @@ jobs:
8184
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8285
with:
8386
ref: ${{ matrix.version }}
87+
persist-credentials: false
8488
- uses: rffontenelle/sphinx-lint-problem-matcher@4270bf50b2c93640a7cbb231c09f8e694699af9f # v1.0.0
8589
- run: sphinx-lint
8690

@@ -100,12 +104,14 @@ jobs:
100104
with:
101105
repository: python/cpython
102106
ref: ${{ matrix.version }}
107+
persist-credentials: false
103108
- run: make venv
104109
working-directory: ./Doc
105110
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
106111
with:
107112
ref: ${{ matrix.version }}
108113
path: Doc/locales/pl/LC_MESSAGES
114+
persist-credentials: false
109115
- run: git pull
110116
working-directory: ./Doc/locales/pl/LC_MESSAGES
111117
- run: sudo apt-get update && sudo apt-get install -y librsvg2-bin

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
rev: 0c7b6c989466a93942def1f84baf36ddfcd60c83 # frozen: v0.15.14
44
hooks:
5-
- id: ruff
5+
- id: ruff-check
66
args: [--fix, --exit-non-zero-on-fix]
77
- id: ruff-format
88

@@ -34,5 +34,11 @@ repos:
3434
- id: check-hooks-apply
3535
- id: check-useless-excludes
3636

37+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
38+
rev: 9257c6050c0261b8c57e712f632dc4a8010109a9 # frozen: v1.25.2
39+
hooks:
40+
- id: zizmor
41+
args: [--fix]
42+
3743
ci:
3844
autoupdate_schedule: quarterly

0 commit comments

Comments
 (0)