Skip to content

Commit 0f71b95

Browse files
committed
GH Actions: add Yamllint to QA basics
... to loosely safeguard valid and consistent yaml files. Includes adding a configuration file which loosens up the `default` ruleset to a degree I'm comfortable with. Ref: https://yamllint.readthedocs.io/
1 parent 8e24edb commit 0f71b95

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
/.markdownlint-cli2.yaml export-ignore
1212
/.remarkignore export-ignore
1313
/.remarkrc export-ignore
14+
/.yamllint.yml export-ignore
1415
/phpcs.xml.dist export-ignore
1516
/phpstan.neon.dist export-ignore
1617
/phpunit.xml.dist export-ignore

.github/workflows/cs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,9 @@ jobs:
150150
remark:
151151
name: 'QA Markdown'
152152
uses: PHPCSStandards/.github/.github/workflows/reusable-remark.yml@main
153+
154+
yamllint:
155+
name: 'Lint Yaml'
156+
uses: PHPCSStandards/.github/.github/workflows/reusable-yamllint.yml@main
157+
with:
158+
strict: true

.yamllint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Details on the default config:
2+
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
3+
extends: default
4+
5+
yaml-files:
6+
- '*.yaml'
7+
- '*.yml'
8+
- '.yamllint'
9+
- 'phpstan.neon*'
10+
11+
# Rule documentation: https://yamllint.readthedocs.io/en/stable/rules.html
12+
rules:
13+
colons:
14+
max-spaces-after: -1 # Disabled to allow aligning of values.
15+
comments:
16+
min-spaces-from-content: 1
17+
comments-indentation: {}
18+
document-start:
19+
present: false
20+
line-length:
21+
max: 145
22+
truthy:
23+
allowed-values: ["true", "false", "on", "off"]

0 commit comments

Comments
 (0)