Skip to content

Commit c36c461

Browse files
author
Michael Buchar
committed
ci(yamllint): add YAML linting (#733)
1 parent 40b5356 commit c36c461

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
@@ -148,6 +148,24 @@ jobs:
148148
- name: Run Sphinx documentation with doctests
149149
run: ./run-tests.sh --check-sphinx
150150

151+
lint-yamllint:
152+
runs-on: ubuntu-24.04
153+
steps:
154+
- name: Checkout
155+
uses: actions/checkout@v4
156+
with:
157+
fetch-depth: 0
158+
159+
- name: Setup Python
160+
uses: actions/setup-python@v5
161+
with:
162+
python-version: "3.12"
163+
164+
- name: Lint YAML files
165+
run: |
166+
pip install yamllint
167+
./run-tests.sh --check-yamllint
168+
151169
python-tests:
152170
runs-on: ubuntu-24.04
153171
steps:

.yamllint.yaml

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

run-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ check_jsonlint() {
117117
find . -name "*.json" -exec jsonlint -q {} \+
118118
}
119119

120+
check_yamllint() {
121+
yamllint .
122+
}
123+
120124
check_pytest () {
121125
clean_old_db_container
122126
start_db_container
@@ -146,6 +150,7 @@ check_all () {
146150
check_dockerfile
147151
check_docker_build
148152
check_jsonlint
153+
check_yamllint
149154
}
150155

151156
if [ $# -eq 0 ]; then
@@ -168,5 +173,6 @@ case $arg in
168173
--check-dockerfile) check_dockerfile;;
169174
--check-docker-build) check_docker_build;;
170175
--check-jsonlint) check_jsonlint ;;
176+
--check-yamllint) check_yamllint ;;
171177
*) echo "[ERROR] Invalid argument '$arg'. Exiting." && exit 1;;
172178
esac

0 commit comments

Comments
 (0)