Skip to content

Commit 32ef3e3

Browse files
Add zizmor as pre-commit hook (#139)
* Apply suggestion from @StanFromIreland Co-authored-by: Stan Ulbrych <stanulbrych@gmail.com>
1 parent bae2487 commit 32ef3e3

3 files changed

Lines changed: 16 additions & 2 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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ on:
88
- '*'
99
workflow_dispatch:
1010

11+
permissions: {}
12+
1113
jobs:
1214
update:
1315
runs-on: ubuntu-latest
1416
strategy:
1517
fail-fast: false
1618
matrix:
1719
version: [3.15, 3.14, 3.13, 3.12, 3.11, '3.10']
20+
permissions:
21+
contents: write # commit and push
1822
steps:
1923
- uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1
2024
with:
@@ -32,6 +36,7 @@ jobs:
3236
with:
3337
ref: ${{ matrix.version }}
3438
fetch-depth: 0
39+
persist-credentials: false
3540
- name: Recreate Transifex config
3641
run: ./manage_translation.py recreate_tx_config
3742
env:
@@ -81,6 +86,7 @@ jobs:
8186
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8287
with:
8388
ref: ${{ matrix.version }}
89+
persist-credentials: false
8490
- uses: rffontenelle/sphinx-lint-problem-matcher@4270bf50b2c93640a7cbb231c09f8e694699af9f # v1.0.0
8591
- run: sphinx-lint
8692

@@ -100,12 +106,14 @@ jobs:
100106
with:
101107
repository: python/cpython
102108
ref: ${{ matrix.version }}
109+
persist-credentials: false
103110
- run: make venv
104111
working-directory: ./Doc
105112
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
106113
with:
107114
ref: ${{ matrix.version }}
108115
path: Doc/locales/pl/LC_MESSAGES
116+
persist-credentials: false
109117
- run: git pull
110118
working-directory: ./Doc/locales/pl/LC_MESSAGES
111119
- 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)