Skip to content

Commit fc12d88

Browse files
committed
Added YAML linting
1 parent ea6598e commit fc12d88

File tree

15 files changed

+81
-1
lines changed

15 files changed

+81
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://prettier.io/docs/configuration
2+
overrides:
3+
# Symfony config
4+
- files:
5+
- "config/**/*.{yml,yaml}"
6+
options:
7+
tabWidth: 4
8+
singleQuote: true

docs/github-actions-templates.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- DO NOT EDIT THIS FILE!
22
3-
It was automatically created at 2025-05-20T13:49:11+02:00
3+
It was automatically created at 2025-06-12T14:50:42+02:00
44
by task/scripts/github-documentation-update
55
based on /app/task/scripts/../templates/github-actions-templates.md
66
-->
@@ -299,6 +299,26 @@ Validates Twig files
299299

300300
---
301301

302+
[github/workflows/yaml.yaml](github/workflows/yaml.yaml)
303+
304+
### YAML
305+
306+
Validates YAML files.
307+
308+
#### Assumptions
309+
310+
1. A docker compose service named `prettier` for running
311+
[Prettier](https://prettier.io/) exists.
312+
313+
#### Symfony YAML
314+
315+
Symfony's YAML config files use 4 spaces for indentation and single quotes.
316+
Therefore we use a [Prettier configuration
317+
file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make
318+
Prettier format YAML files in the `config/` folder like Symfony expects.
319+
320+
---
321+
302322
## Updating template documentation
303323

304324
To update this document, run

github/workflows/yaml.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Do not edit this file! Make a pull request on changing
2+
# github/workflows/yaml.yaml in
3+
# https://github.com/itk-dev/devops_itkdev-docker if need be.
4+
5+
### ### YAML
6+
###
7+
### Validates YAML files.
8+
###
9+
### #### Assumptions
10+
###
11+
### 1. A docker compose service named `prettier` for running
12+
### [Prettier](https://prettier.io/) exists.
13+
###
14+
### #### Symfony YAML
15+
###
16+
### Symfony's YAML config files use 4 spaces for indentation and single quotes.
17+
### Therefore we use a [Prettier configuration
18+
### file](https://prettier.io/docs/configuration), `.prettierrc.yaml`, to make
19+
### Prettier format YAML files in the `config/` folder like Symfony expects.
20+
21+
name: YAML
22+
23+
on:
24+
pull_request:
25+
push:
26+
branches:
27+
- main
28+
- develop
29+
30+
jobs:
31+
yaml-lint:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- run: |
37+
docker network create frontend
38+
39+
- run: |
40+
docker compose run --rm prettier '**/*.{yml,yaml}' --check
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/yaml.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/yaml.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/yaml.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/yaml.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/yaml.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/yaml.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../github/workflows/yaml.yaml

0 commit comments

Comments
 (0)