Skip to content

Commit c9dec13

Browse files
authored
Enhancement: Lint YAML files (#548)
* Enhancement: Lint YAML files * Fix: Consistently quote strings in YAML files * Fix: Remove extra empty lines * Fix: Ignore truthy rule for 'on' * Fix: Use explicit null
1 parent 65f2e71 commit c9dec13

File tree

9 files changed

+242
-160
lines changed

9 files changed

+242
-160
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/.gitattributes export-ignore
66
/.gitignore export-ignore
77
/.php-cs-fixer.dist.php export-ignore
8+
/.yamllint.yaml export-ignore
89
/codecov.yml export-ignore
910
/Makefile export-ignore
1011
/phpstan-baseline.neon export-ignore

.github/stale.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
daysUntilStale: 14
22
daysUntilClose: 7
33
exemptLabels:
4-
- pinned
5-
- security
4+
- "pinned"
5+
- "security"
66
# Label to use when marking an issue as stale
7-
staleLabel: lifecycle/stale
7+
staleLabel: "lifecycle/stale"
88
# Comment to post when marking an issue as stale. Set to `false` to disable
99
markComment: >
1010
This issue has been automatically marked as stale because it has not had

.github/workflows/bc-check.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
2-
on:
3-
pull_request:
1+
on: # yamllint disable-line rule:truthy
2+
pull_request: ~
43
push:
54
branches:
65
- "main"
76
- "[0-9].*"
87

9-
name: BC Check
8+
name: "BC Check"
109

1110
jobs:
1211
roave-bc-check:
13-
name: Roave BC Check
14-
runs-on: ubuntu-latest
12+
name: "Roave BC Check"
13+
runs-on: "ubuntu-latest"
1514

1615
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v3
16+
- name: "Checkout code"
17+
uses: "actions/checkout@v3"
1918

20-
- name: Roave BC Check
21-
uses: docker://nyholm/roave-bc-check-ga
19+
- name: "Roave BC Check"
20+
uses: "docker://nyholm/roave-bc-check-ga"

.github/workflows/branch-alias.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
name: Update branch alias
1+
name: "Update branch alias"
22

3-
on:
3+
on: # yamllint disable-line rule:truthy
44
push:
5-
tags: ['*']
5+
tags: ["*"]
66

77
jobs:
88
branch-alias:
9-
name: Update branch alias
10-
runs-on: ubuntu-latest
9+
name: "Update branch alias"
10+
runs-on: "ubuntu-latest"
1111

1212
steps:
13-
- name: Set up PHP
14-
uses: shivammathur/setup-php@v2
13+
- name: "Set up PHP"
14+
uses: "shivammathur/setup-php@v2"
1515
with:
16-
php-version: 7.4
17-
coverage: none
16+
php-version: "7.4"
17+
coverage: "none"
1818

19-
- name: Checkout code
20-
uses: actions/checkout@v3
19+
- name: "Checkout code"
20+
uses: "actions/checkout@v3"
2121
with:
22-
ref: main
22+
ref: "main"
2323

24-
- name: Find branch alias
25-
id: find_alias
24+
- name: "Find branch alias"
25+
id: "find_alias"
2626
run: |
2727
TAG=$(echo $GITHUB_REF | cut -d'/' -f 3)
2828
echo "Last tag was $TAG"
2929
ARR=(${TAG//./ })
3030
ARR[1]=$((${ARR[1]}+1))
3131
echo "name=alias::${ARR[0]}.${ARR[1]}" >> $GITHUB_OUTPUT
3232
33-
- name: Update branch alias
33+
- name: "Update branch alias"
3434
run: |
3535
CURRENT_ALIAS=$(composer config extra.branch-alias.dev-main | cut -d'-' -f 1)
3636
@@ -53,15 +53,15 @@ jobs:
5353
5454
composer config extra.branch-alias.dev-main ${{ steps.find_alias.outputs.alias }}-dev
5555
56-
- name: Create Pull Request
57-
uses: peter-evans/create-pull-request@v4
56+
- name: "Create Pull Request"
57+
uses: "peter-evans/create-pull-request@v4"
5858
with:
59-
base: main
60-
branch: branch-alias-update
61-
author: GitHub <[email protected]>
62-
committer: GitHub <[email protected]>
63-
commit-message: Updating branch alias to ${{ steps.find_alias.outputs.alias }}
64-
title: Update branch alias
65-
labels: pinned, do not merge
59+
base: "main"
60+
branch: "branch-alias-update"
61+
author: "GitHub <[email protected]>"
62+
committer: "GitHub <[email protected]>"
63+
commit-message: "Updating branch alias to ${{ steps.find_alias.outputs.alias }}"
64+
title: "Update branch alias"
65+
labels: "pinned, do not merge"
6666
body: |
6767
Since we just tagged a new version, we need to update composer.json branch alias. This should not be merged until there are new features, as it would prevent patch releases.
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,57 @@
1-
on:
2-
pull_request:
1+
on: # yamllint disable-line rule:truthy
2+
pull_request: ~
33
push:
44
branches:
55
- "main"
66
- "[0-9].*"
77

8-
name: Code Coverage
8+
name: "Code Coverage"
99

1010
jobs:
1111
code-coverage:
12-
name: Code Coverage
12+
name: "Code Coverage"
1313

1414
strategy:
1515
matrix:
1616
php-version:
17-
- '8.0'
17+
- "8.0"
1818

19-
runs-on: ubuntu-latest
19+
runs-on: "ubuntu-latest"
2020

2121
steps:
22-
- name: Checkout code
23-
uses: actions/checkout@v3
22+
- name: "Checkout code"
23+
uses: "actions/checkout@v3"
2424

25-
- name: Install PHP with extensions
26-
uses: shivammathur/setup-php@v2
25+
- name: "Install PHP with extensions"
26+
uses: "shivammathur/setup-php@v2"
2727
with:
28-
coverage: pcov
29-
extensions: intl
30-
php-version: ${{ matrix.php-version }}
28+
coverage: "pcov"
29+
extensions: "intl"
30+
php-version: "${{ matrix.php-version }}"
3131

32-
- name: Determine composer cache directory
33-
id: composer-cache
34-
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
32+
- name: "Determine composer cache directory"
33+
id: "composer-cache"
34+
run: "echo \"directory=$(composer config cache-dir)\" >> $GITHUB_OUTPUT"
3535

36-
- name: Cache dependencies installed with composer
37-
uses: actions/cache@v3
36+
- name: "Cache dependencies installed with composer"
37+
uses: "actions/cache@v3"
3838
with:
39-
path: ${{ steps.composer-cache.outputs.directory }}
40-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
39+
path: "${{ steps.composer-cache.outputs.directory }}"
40+
key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}"
4141
restore-keys: |
4242
composer-${{ runner.os }}-${{ matrix.php-version }}-
4343
composer-${{ runner.os }}-
4444
composer-
4545
46-
- name: Download dependencies
46+
- name: "Download dependencies"
4747
run: |
4848
composer update --no-interaction --no-progress --optimize-autoloader
4949
vendor/bin/simple-phpunit install
5050
51-
- name: Collect code coverage with PHPUnit
51+
- name: "Collect code coverage with PHPUnit"
5252
run: |
5353
vendor/bin/simple-phpunit --coverage-clover=.build/logs/clover.xml
5454
55-
- name: Send code coverage report to codecov.io
55+
- name: "Send code coverage report to codecov.io"
5656
run: |
5757
bash <(curl -s https://codecov.io/bash)
Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,79 @@
1-
on:
1+
on: # yamllint disable-line rule:truthy
22
pull_request: ~
33
push:
44
branches:
55
- "main"
66
- "[0-9].*"
77

8-
name: Coding Standards
8+
name: "Coding Standards"
99

1010
jobs:
1111
php-cs-fixer:
12-
name: php-cs-fixer
12+
name: "php-cs-fixer"
1313

14-
runs-on: ubuntu-latest
14+
runs-on: "ubuntu-latest"
1515

1616
strategy:
1717
matrix:
1818
php-version:
19-
- 7.1
19+
- "7.1"
2020

2121
steps:
22-
- name: Checkout code
23-
uses: actions/checkout@v3
22+
- name: "Checkout code"
23+
uses: "actions/checkout@v3"
2424

25-
- name: Set up PHP
26-
uses: shivammathur/setup-php@v2
25+
- name: "Set up PHP"
26+
uses: "shivammathur/setup-php@v2"
2727
with:
28-
coverage: none
29-
extensions: intl
30-
php-version: ${{ matrix.php-version }}
28+
coverage: "none"
29+
extensions: "intl"
30+
php-version: "${{ matrix.php-version }}"
3131

32-
- name: Determine composer cache directory
33-
id: composer-cache
34-
run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT
32+
- name: "Determine composer cache directory"
33+
id: "composer-cache"
34+
run: "echo \"directory=$(composer config cache-dir)\" >> $GITHUB_OUTPUT"
3535

36-
- name: Cache dependencies installed with composer
37-
uses: actions/cache@v3
36+
- name: "Cache dependencies installed with composer"
37+
uses: "actions/cache@v3"
3838
with:
39-
path: ${{ steps.composer-cache.outputs.directory }}
40-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
39+
path: "${{ steps.composer-cache.outputs.directory }}"
40+
key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}"
4141
restore-keys: |
4242
composer-${{ runner.os }}-${{ matrix.php-version }}-
4343
composer-${{ runner.os }}-
4444
composer-
4545
46-
- name: Download dependencies
46+
- name: "Download dependencies"
4747
run: |
4848
composer update --no-interaction --no-progress --optimize-autoloader
4949
composer bin php-cs-fixer install --no-interaction --no-progress --optimize-autoloader
5050
51-
- name: Cache cache file for php-cs-fixer
52-
uses: actions/cache@v3
51+
- name: "Cache cache file for php-cs-fixer"
52+
uses: "actions/cache@v3"
5353
with:
54-
path: .php_cs.cache
55-
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
54+
path: ".php_cs.cache"
55+
key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}"
5656
restore-keys: |
5757
composer-${{ runner.os }}-${{ matrix.php-version }}-
5858
composer-${{ runner.os }}-
5959
composer-
6060
61-
- name: Run php-cs-fixer
61+
- name: "Run php-cs-fixer"
6262
run: |
6363
vendor/bin/php-cs-fixer fix --diff --dry-run --verbose
64+
65+
yamllint:
66+
name: "yamllint"
67+
68+
runs-on: "ubuntu-latest"
69+
70+
steps:
71+
- name: "Checkout code"
72+
uses: "actions/checkout@v3"
73+
74+
- name: "Lint YAML files"
75+
uses: "ibiqlik/[email protected]"
76+
with:
77+
config_file: ".yamllint.yaml"
78+
file_or_dir: "."
79+
strict: true

0 commit comments

Comments
 (0)