Skip to content

Commit b0d171b

Browse files
authored
Merge pull request #74 from PHPCSStandards/feature/ghactions-add-yamllint
GH Actions: add Yamllint to `validate` workflow
2 parents a4eab7e + e2f862e commit b0d171b

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ scripts/ export-ignore
1010
.cspell.json export-ignore
1111
.gitattributes export-ignore
1212
.gitignore export-ignore
13+
.yamllint.yml export-ignore
1314
phpcs.xml.dist export-ignore
1415
phpstan.neon.dist export-ignore
1516
phpunit.xml.dist export-ignore

.github/workflows/validate.yml

+15
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,18 @@ jobs:
6363
diff -B ./src/Standards/PSR12/ruleset.xml <(xmllint --format "./src/Standards/PSR12/ruleset.xml")
6464
diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml")
6565
diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml")
66+
67+
yamllint:
68+
name: 'Lint Yaml'
69+
runs-on: ubuntu-latest
70+
71+
steps:
72+
- name: Checkout code
73+
uses: actions/checkout@v4
74+
75+
- name: Run Yamllint on all yaml files in repo
76+
run: yamllint . --format colored --strict
77+
78+
- name: Pipe Yamllint results on to GH for inline display
79+
if: ${{ failure() }}
80+
run: yamllint . --format github --strict

.yamllint.yml

+23
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: 150
22+
truthy:
23+
allowed-values: ["true", "false", "on", "off"]

0 commit comments

Comments
 (0)