Skip to content

Commit cebb0f6

Browse files
authored
Add yamllint, fix inconsistencies in yml files (#1558)
* Add yamllint, enable, basic relaxed config adding a lint:yaml task to run yamllint, and a default config ignoring node_modules/, extending the `relaxed` preset, and allowing longer line length No-Issue * workflows - fix yaml indent inconsistencies ./.github/workflows/i18n.yml 8:13 warning too many spaces after colon (colons) 22:5 warning wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/pr-checks.yml 32:5 warning wrong indentation: expected 6 but found 4 (indentation) 65:5 warning wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/deploy-cloud.yml 62:1 warning too many blank lines (1 > 0) (empty-lines) ./.github/workflows/cypress.yml 12:13 warning too many spaces after colon (colons) 27:5 warning wrong indentation: expected 6 but found 4 (indentation) * yamllint - use stricter rules without changes yamllint default mode seems to require starting `---`, and +1 indent levels for arrays balks on on:, spaces in arrays, and comments after one space, overriding those ./.yamllint 1:1 warning missing document start "---" (document-start) ./.prettierrc.yaml 1:1 warning missing document start "---" (document-start) ./.ls-lint.yml 1:1 warning missing document start "---" (document-start) ./.github/dependabot.yml 1:1 warning missing document start "---" (document-start) ./.github/ISSUE_TEMPLATE/config.yml 2:1 warning missing document start "---" (document-start) 4:1 error wrong indentation: expected 2 but found 0 (indentation) ./.github/workflows/i18n.yml 1:1 warning missing document start "---" (document-start) 3:1 warning truthy value should be one of [false, true] (truthy) 8:3 error wrong indentation: expected 4 but found 2 (indentation) 17:9 error wrong indentation: expected 10 but found 8 (indentation) 22:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/pr-checks.yml 1:1 warning missing document start "---" (document-start) 3:1 warning truthy value should be one of [false, true] (truthy) 5:16 error too many spaces inside brackets (brackets) 5:37 error too many spaces inside brackets (brackets) 13:5 error wrong indentation: expected 6 but found 4 (indentation) 32:5 error wrong indentation: expected 6 but found 4 (indentation) 65:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/update-manifest.yml 1:1 warning missing document start "---" (document-start) 3:1 warning truthy value should be one of [false, true] (truthy) 4:22 warning too few spaces before comment (comments) 6:16 error too many spaces inside brackets (brackets) 6:40 error too many spaces inside brackets (brackets) 23:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/deploy-cloud.yml 1:1 warning missing document start "---" (document-start) 3:1 warning truthy value should be one of [false, true] (truthy) 4:22 warning too few spaces before comment (comments) 6:16 error too many spaces inside brackets (brackets) 6:70 error too many spaces inside brackets (brackets) 28:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/backported-labels.yml 1:1 warning missing document start "---" (document-start) 3:1 warning truthy value should be one of [false, true] (truthy) 7:16 error too many spaces inside brackets (brackets) 7:27 error too many spaces inside brackets (brackets) 13:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/dev-release.yml 3:1 warning missing document start "---" (document-start) 5:1 warning truthy value should be one of [false, true] (truthy) 6:22 warning too few spaces before comment (comments) 8:16 error too many spaces inside brackets (brackets) 8:25 error too many spaces inside brackets (brackets) 18:24 warning too few spaces before comment (comments) 23:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/stable-release.yml 1:1 warning missing document start "---" (document-start) 4:1 warning truthy value should be one of [false, true] (truthy) 7:5 error wrong indentation: expected 6 but found 4 (indentation) 23:5 error wrong indentation: expected 6 but found 4 (indentation) ./.github/workflows/cypress.yml 1:1 warning missing document start "---" (document-start) 3:1 warning truthy value should be one of [false, true] (truthy) 7:16 error too many spaces inside brackets (brackets) 7:37 error too many spaces inside brackets (brackets) 9:16 error too many spaces inside brackets (brackets) 9:37 error too many spaces inside brackets (brackets) 12:3 error wrong indentation: expected 4 but found 2 (indentation) 27:5 error wrong indentation: expected 6 but found 4 (indentation)
1 parent 99810ef commit cebb0f6

File tree

6 files changed

+39
-21
lines changed

6 files changed

+39
-21
lines changed

.github/workflows/cypress.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
branches: [ 'master', 'stable-*' ]
1010
# daily on master
1111
schedule:
12-
- cron: '30 5 * * *'
12+
- cron: '30 5 * * *'
1313

1414
concurrency:
1515
group: cypress-${{ github.ref }}

.github/workflows/deploy-cloud.yml

-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@ jobs:
5959
npm cache verify
6060
npm ci || npm install
6161
npm run deploy && curl -sSL https://raw.githubusercontent.com/RedHatInsights/insights-frontend-builder-common/master/src/bootstrap.sh | bash -s
62-

.github/workflows/i18n.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_dispatch:
66
# run weekly
77
schedule:
8-
- cron: '30 5 * * 0'
8+
- cron: '30 5 * * 0'
99

1010
jobs:
1111
i18n:
@@ -14,8 +14,8 @@ jobs:
1414
strategy:
1515
matrix:
1616
branch:
17-
- 'master'
18-
- 'stable-4.4'
17+
- 'master'
18+
- 'stable-4.4'
1919

2020
steps:
2121

.github/workflows/pr-checks.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ on:
77
jobs:
88

99
check_commit:
10-
1110
runs-on: ubuntu-latest
1211
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v2
15-
with:
16-
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
17-
fetch-depth: 0 # include all history
1812

19-
- name: Run script to validate commits for both pull request and a push
20-
env:
21-
GITHUB_PR_COMMITS_URL: ${{ github.event.pull_request.commits_url }}
22-
GITHUB_USER: ${{ github.event.pull_request.user.login }}
23-
START_COMMIT: ${{ github.event.before }}
24-
END_COMMIT: ${{ github.event.after }}
25-
run: |
26-
curl https://raw.githubusercontent.com/ansible/galaxy_ng/master/.ci/scripts/validate_commit_message_custom.py | python
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
with:
16+
ref: ${{ github.event.after }} # for PR avoids checking out merge commit
17+
fetch-depth: 0 # include all history
18+
19+
- name: Run script to validate commits for both pull request and a push
20+
env:
21+
GITHUB_PR_COMMITS_URL: ${{ github.event.pull_request.commits_url }}
22+
GITHUB_USER: ${{ github.event.pull_request.user.login }}
23+
START_COMMIT: ${{ github.event.before }}
24+
END_COMMIT: ${{ github.event.after }}
25+
run: |
26+
curl https://raw.githubusercontent.com/ansible/galaxy_ng/master/.ci/scripts/validate_commit_message_custom.py | python
2727
2828
pr-checks:
2929
runs-on: ubuntu-latest
@@ -51,7 +51,7 @@ jobs:
5151
popd
5252
5353
# dependencies
54-
pip install lint-po
54+
pip install lint-po yamllint
5555
5656
# run linters
5757
npm run lint

.yamllint

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ignore: |
2+
/node_modules/
3+
/test/node_modules/
4+
5+
extends: default
6+
7+
rules:
8+
line-length:
9+
max: 240
10+
indentation:
11+
indent-sequences: consistent
12+
brackets:
13+
max-spaces-inside: 1
14+
document-start: disable
15+
truthy:
16+
check-keys: false
17+
comments:
18+
min-spaces-from-content: 1

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@
8383
"lint:js": "npm run prettier:check && npm run eslint",
8484
"lint:js:fix": "npm run eslint:fix && npm run prettier",
8585
"lint:ls": "ls-lint",
86+
"lint:po": "lint-po locale/*.po",
8687
"lint:sass": "stylelint 'src/**/*.scss' --config .stylelintrc.json",
8788
"lint:ts": "tsc",
88-
"lint:po": "lint-po locale/*.po",
89+
"lint:yaml": "yamllint .",
8990
"prettier": "prettier --write 'src/**' 'config/**' 'test/**'",
9091
"prettier:check": "prettier -l 'src/**' 'config/**' 'test/**'",
9192
"prod": "NODE_ENV=production webpack serve --config custom.dev.config",

0 commit comments

Comments
 (0)