Skip to content

Commit 4e1fffb

Browse files
committed
ci(yamllint): add YAML linting checks (reanahub#175)
1 parent 455a0ff commit 4e1fffb

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,21 @@ jobs:
106106
run: |
107107
sudo apt-get install shellcheck
108108
./run-tests.sh --lint-shellcheck
109+
110+
lint-yamllint:
111+
runs-on: ubuntu-24.04
112+
steps:
113+
- name: Checkout
114+
uses: actions/checkout@v4
115+
with:
116+
fetch-depth: 0
117+
118+
- name: Setup Python
119+
uses: actions/setup-python@v5
120+
with:
121+
python-version: "3.12"
122+
123+
- name: Lint YAML files
124+
run: |
125+
pip install yamllint
126+
./run-tests.sh --lint-yamllint

.yamllint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: default
2+
rules:
3+
comments:
4+
min-spaces-from-content: 1
5+
document-start: disable
6+
line-length: disable
7+
truthy: disable

run-tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,18 @@ lint_shellcheck() {
9696
find . -name "*.sh" -exec shellcheck {} \+
9797
}
9898

99+
lint_yamllint() {
100+
yamllint .
101+
}
102+
99103
all() {
100104
docs_shell_completions
101105
format_go
102106
go_tests
103107
lint_commitlint
104108
lint_goaudit
105109
lint_shellcheck
110+
lint_yamllint
106111
}
107112

108113
help() {
@@ -116,6 +121,7 @@ help() {
116121
echo " --lint-commitlint Check linting of commit messages"
117122
echo " --lint-goaudit Check linting of Go code"
118123
echo " --lint-shellcheck Check linting of shell scripts"
124+
echo " --lint-yamllint Check linting of YAML files"
119125
}
120126

121127
if [ $# -eq 0 ]; then
@@ -133,5 +139,6 @@ case $arg in
133139
--lint-commitlint) lint_commitlint "$@" ;;
134140
--lint-goaudit) lint_goaudit ;;
135141
--lint-shellcheck) lint_shellcheck ;;
142+
--lint-yamllint) lint_yamllint ;;
136143
*) echo "[ERROR] Invalid argument '$arg'. Exiting." && help && exit 1 ;;
137144
esac

0 commit comments

Comments
 (0)