Skip to content

Commit 2a5d957

Browse files
committed
Add Zizmor linter
Apply fixes for new rules
1 parent d90e31b commit 2a5d957

5 files changed

Lines changed: 38 additions & 8 deletions

File tree

.github/dependabot.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ updates:
88
groups:
99
github-actions:
1010
patterns:
11-
- "*" # Group all Actions updates into a single larger pull request
11+
- "*" # Group all Actions updates into a single larger pull request
1212
schedule:
1313
interval: weekly
14+
cooldown:
15+
default-days: 7

.github/workflows/python-package.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,25 @@ defaults:
1616
run:
1717
shell: bash
1818

19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
1923
jobs:
2024
pre-commit:
2125
runs-on: ubuntu-latest
2226
steps:
2327
- uses: actions/checkout@v6
28+
with:
29+
persist-credentials: false
2430
- uses: pre-commit/action@v3.0.1
2531

2632
mypy:
2733
runs-on: ubuntu-latest
2834
steps:
2935
- uses: actions/checkout@v6
36+
with:
37+
persist-credentials: false
3038
- uses: actions/setup-python@v6
3139
- name: Install package
3240
run: pip install -e ".[test]"
@@ -43,6 +51,8 @@ jobs:
4351
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15-dev"]
4452
steps:
4553
- uses: actions/checkout@v6
54+
with:
55+
persist-credentials: false
4656
- uses: actions/setup-python@v6
4757
name: Setup Python ${{ matrix.python-version }}
4858
with:
@@ -60,6 +70,8 @@ jobs:
6070
runs-on: ubuntu-latest
6171
steps:
6272
- uses: actions/checkout@v6
73+
with:
74+
persist-credentials: false
6375
- name: Install build
6476
run: pip install build
6577
- name: Build package
@@ -80,7 +92,7 @@ jobs:
8092
name: pypi
8193
url: https://pypi.org/project/tcod-ecs/${{ github.ref_name }}/
8294
permissions:
83-
id-token: write
95+
id-token: write # Attestation
8496
steps:
8597
- uses: actions/download-artifact@v8
8698
with:
@@ -93,14 +105,15 @@ jobs:
93105
name: Create Release
94106
runs-on: ubuntu-latest
95107
permissions:
96-
contents: write
108+
contents: write # Publish GitHub Releases
97109
steps:
98110
- name: Checkout code
99111
uses: actions/checkout@v6
112+
with:
113+
persist-credentials: false
100114
- name: Generate body
101115
run: scripts/get_release_description.py | tee release_body.md
102116
- name: Create Release
103117
id: create_release
104-
uses: ncipollo/release-action@v1
105-
with:
106-
bodyFile: release_body.md
118+
# https://cli.github.com/manual/gh_release_create
119+
run: gh release create "${GITHUB_REF_NAME}" --verify-tag --notes-file release_body.md

.github/zizmor.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rules:
2+
anonymous-definition:
3+
disable: true
4+
cache-poisoning:
5+
disable: true
6+
excessive-permissions:
7+
disable: true
8+
unpinned-uses:
9+
disable: true

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ repos:
1717
- id: fix-byte-order-marker
1818
- id: detect-private-key
1919
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.15.9
20+
rev: v0.15.14
2121
hooks:
2222
- id: ruff-check
2323
args: [--fix, --exit-non-zero-on-fix]
2424
- id: ruff-format
25+
- repo: https://github.com/zizmorcore/zizmor-pre-commit
26+
rev: v1.25.2
27+
hooks:
28+
- id: zizmor

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"buildapi",
1313
"cattrs",
1414
"codecov",
15+
"cooldown",
1516
"docstrings",
1617
"doctest",
1718
"doctests",
@@ -60,7 +61,8 @@
6061
"unstructure",
6162
"WASD",
6263
"WAXD",
63-
"WINDOWLEAVE"
64+
"WINDOWLEAVE",
65+
"zizmor"
6466
],
6567
"editor.codeActionsOnSave": {
6668
"source.fixAll": "always"

0 commit comments

Comments
 (0)