Skip to content

Commit 4ecdbe2

Browse files
authored
Add basic pre-commit config (#39545)
From https://pre-commit.com/ ``` pip install pre-commit pre-commit --version pre-commit install pre-commit run --all-files ``` This only configures the basic `check-yaml` rule, and fixes an offending spot where a patch was named like a yaml. See, it's helping already! Next: - add any other configs that might be worthwhile - add a CI check that runs `pre-commit` post-commit --------- Signed-off-by: Jason Hall <jason@chainguard.dev>
1 parent 7d73443 commit 4ecdbe2

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.github/workflows/lint.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ jobs:
2121
with:
2222
egress-policy: audit
2323

24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4.2.2
25+
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
26+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
27+
2428
# Install yam
2529
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
2630
with:
2731
go-version: 1.23
2832
- run: go install github.com/chainguard-dev/yam@latest
2933

30-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/checkout@v4.2.2
3134
- run: ./lint.sh
3235
- run: git diff --exit-code

.pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-yaml
6+
- id: forbid-submodules

asciidoc.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: asciidoc
33
version: 10.2.1
4-
epoch: 1
4+
epoch: 2
55
description: "Text based documentation"
66
copyright:
77
- license: GPL-2.0-or-later
@@ -33,7 +33,7 @@ pipeline:
3333

3434
- uses: patch
3535
with:
36-
patches: allow-specify-python.yaml
36+
patches: allow-specify-python.patch
3737

3838
- runs: |
3939
autoreconf -fi
File renamed without changes.

0 commit comments

Comments
 (0)