Skip to content

Commit 5ca5a12

Browse files
committed
Add yamllint, fix most yaml errors
1 parent d292784 commit 5ca5a12

File tree

4 files changed

+48
-22
lines changed

4 files changed

+48
-22
lines changed

.github/dependabot.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
---
12
version: 2
23
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
5-
schedule:
6-
interval: "daily"
7-
- package-ecosystem: "docker"
8-
directory: "/"
9-
schedule:
10-
interval: "daily"
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
- package-ecosystem: "docker"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"

.github/workflows/ci.yml

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: "CI"
23
on:
34
push:
@@ -37,7 +38,9 @@ jobs:
3738
build-test:
3839
name: Build and Test
3940
runs-on: ubuntu-20.04
40-
needs: [ "lint", "shellcheck" ]
41+
needs:
42+
- lint
43+
- shellcheck
4144
steps:
4245
- uses: actions/checkout@v3
4346
- name: Build Docker image
@@ -55,7 +58,7 @@ jobs:
5558
steps:
5659
- uses: actions/checkout@v3
5760

58-
- name: Run integration test 1
61+
- name: Run integration test 1 - good Dockerfile
5962
uses: ./
6063
with:
6164
dockerfile: testdata/Dockerfile
@@ -117,6 +120,15 @@ jobs:
117120
# format: sarif
118121
# output-file: report.sarif
119122

123+
- name: Run integration test 9 - run with no Dockerfiles
124+
# This should not fail if no Dockerfiles are found in the path
125+
# especially if git change deletes Dockerfile
126+
uses: testdata/test_empty_dir
127+
with:
128+
dockerfile: ""
129+
failure-threshold: error
130+
recursive: true
131+
120132
release:
121133
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
122134
name: Release

.pre-commit-config.yaml

+23-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1-
- repo: local
2-
hooks:
3-
- id: lint-dockerfile
4-
name: Lint Dockerfile
5-
entry: make lint-dockerfile
6-
language: system
7-
files: \.yml$
8-
- id: lint-yaml
9-
name: Lint YAML
10-
entry: make lint-yaml
11-
language: system
12-
files: \.yml$
1+
---
2+
repos:
3+
- repo: local
4+
hooks:
5+
- id: lint-dockerfile
6+
name: Lint Dockerfile
7+
entry: make lint-dockerfile
8+
language: system
9+
files: \.yml$
10+
11+
- id: lint-yaml
12+
name: Lint YAML
13+
entry: make lint-yaml
14+
language: system
15+
files: \.yml$
16+
- repo: https://github.com/adrienverge/yamllint
17+
rev: v1.33.0
18+
hooks:
19+
- id: yamllint
20+
- repo: https://github.com/koalaman/shellcheck-precommit
21+
rev: v0.9.0
22+
hooks:
23+
- id: shellcheck

.yamllint renamed to .yamllint.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ rules:
66
max: 80
77
level: warning
88
document-start: disable
9+
truthy:
10+
level: warning

0 commit comments

Comments
 (0)