Skip to content

Commit 03ba3f9

Browse files
authored
Format yaml in pre-commit hook (#73)
This keeps the yaml files always nicely formatted.
1 parent c469291 commit 03ba3f9

5 files changed

Lines changed: 39 additions & 28 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
name: 'Validate DevContainer'
2-
description: 'This workflow is checking that updates do not break stuff. If on main branch, publish to "latest" tag.'
1+
---
2+
name: Validate DevContainer
3+
description: This workflow is checking that updates do not break stuff. If on main branch, publish to "latest" tag.
34
on:
45
pull_request:
56
push:
@@ -17,13 +18,13 @@ jobs:
1718
os: [arm64, amd64]
1819
include:
1920
- os: amd64
20-
name: 'DevContainer (amd64)'
21+
name: DevContainer (amd64)
2122
runner: ubuntu-24.04
2223
- os: arm64
23-
name: 'DevContainer (arm64)'
24+
name: DevContainer (arm64)
2425
runner: ubuntu-24.04-arm
2526

26-
name: '${{ matrix.name }}'
27+
name: ${{ matrix.name }}
2728
runs-on: ${{ matrix.runner }}
2829
permissions:
2930
contents: read
@@ -47,7 +48,7 @@ jobs:
4748
with:
4849
# The .devcontainer is never published as pre-built container.
4950
# We want to only use it for building and testing the actual container, which resides in src/s-core-devcontainer.
50-
push: "never"
51+
push: never
5152
runCmd: |
5253
set -eux pipefail
5354
@@ -73,8 +74,8 @@ jobs:
7374
fi
7475
7576
merge:
76-
name: 'Merge Labels (main only)'
77-
needs: ["build"]
77+
name: Merge Labels (main only)
78+
needs: [build]
7879
runs-on: ubuntu-24.04
7980
if: github.ref == 'refs/heads/main'
8081
permissions:
@@ -99,7 +100,7 @@ jobs:
99100
with:
100101
# The .devcontainer is never published as pre-built container.
101102
# We want to only use it for building and testing the actual container, which resides in src/s-core-devcontainer.
102-
push: "never"
103+
push: never
103104
runCmd: |
104105
set -eux pipefail
105106

.github/workflows/release.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
name: 'Validate & Publish DevContainer'
2-
description: 'This workflow is checking that for releases, updates do not break stuff and publishes the released container.'
1+
---
2+
name: Validate & Publish DevContainer
3+
description: This workflow is checking that for releases, updates do not break stuff and publishes the released container.
34
on:
45
push:
56
tags:
6-
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
- v[0-9]+.[0-9]+.[0-9]+
78
jobs:
89
build:
910
strategy:
1011
matrix:
1112
os: [arm64, amd64]
1213
include:
1314
- os: amd64
14-
name: 'DevContainer (amd64)'
15+
name: DevContainer (amd64)
1516
runner: ubuntu-24.04
1617
- os: arm64
17-
name: 'DevContainer (arm64)'
18+
name: DevContainer (arm64)
1819
runner: ubuntu-24.04-arm
1920

20-
name: '${{ matrix.name }}'
21+
name: ${{ matrix.name }}
2122
runs-on: ${{ matrix.runner }}
2223
permissions:
2324
contents: read
@@ -41,7 +42,7 @@ jobs:
4142
with:
4243
# The .devcontainer is never published as pre-built container.
4344
# We want to only use it for building and testing the actual container, which resides in src/s-core-devcontainer.
44-
push: "never"
45+
push: never
4546
runCmd: |
4647
set -eux pipefail
4748
@@ -65,8 +66,8 @@ jobs:
6566
./scripts/publish.sh --${{ matrix.os }} "${{ github.ref_name }}" "latest"
6667
6768
merge:
68-
name: 'Merge Labels'
69-
needs: ["build"]
69+
name: Merge Labels
70+
needs: [build]
7071
runs-on: ubuntu-24.04
7172
permissions:
7273
contents: read
@@ -90,7 +91,7 @@ jobs:
9091
with:
9192
# The .devcontainer is never published as pre-built container.
9293
# We want to only use it for building and testing the actual container, which resides in src/s-core-devcontainer.
93-
push: "never"
94+
push: never
9495
runCmd: |
9596
set -eux pipefail
9697

.pre-commit-config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
---
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
4+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
45
hooks:
56
- id: check-yaml
67
- id: end-of-file-fixer
7-
exclude: "devcontainer-lock.json"
8+
exclude: devcontainer-lock.json
89
- id: trailing-whitespace
910
- id: check-shebang-scripts-are-executable
1011
- id: check-executables-have-shebangs
12+
13+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
14+
rev: 8d1b9cadaf854cb25bb0b0f5870e1cc66a083d6b # 0.2.3
15+
hooks:
16+
- id: yamlfmt
17+
args: [--mapping, '2', --offset, '2', --sequence, '4']

src/s-core-devcontainer/.devcontainer/bazel-feature/versions.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
bazel:
23
# https://github.com/bazelbuild/bazel/releases -- latest version as of 2025-09-24
34
version: 8.4.1
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
graphviz:
23
version: 2.42.2
34

@@ -11,22 +12,22 @@ sshpass:
1112
version: 1.09
1213

1314
gdb:
14-
version: "15.0.50"
15+
version: 15.0.50
1516

1617
git:
17-
version: "2.43.0"
18+
version: 2.43.0
1819

1920
git_lfs:
20-
version: "3.4.1"
21+
version: 3.4.1
2122

2223
python:
23-
version: "3.12"
24+
version: '3.12'
2425

2526
gh:
26-
version: "2.45.0"
27+
version: 2.45.0
2728

2829
openjdk_21:
29-
version: "21.0.9"
30+
version: 21.0.9
3031

3132
valgrind:
32-
version: "3.22.0"
33+
version: 3.22.0

0 commit comments

Comments
 (0)