Support Linting YAML as part of Travis CI build (#554)

* add yamllint command to travis CI

installs and runs a linter across the YAML in the
project to ensure consistency in the written YAML.

this uses yamllint and the default yamllint config with
"truthy" and "line-length" disabled.

* run dos2unix on CRLF files

* YAMLLINT: remove trailing spaces

* YAMLLint: add YAML document start

* YAMLLint: too many spaces around bracket

* YAMLLint: fix indentation

* YAMLLint: remove duplicate key

* YAMLLint: newline at end of file

* YAMLLint: Too few spaces after comma

* YAMLLint: too many spaces after colon
pull/544/head
James Ward 4 years ago committed by Liz Rice
parent dc14cb14b0
commit 5f34058dc7

@ -1,3 +1,4 @@
---
env:
- GO111MODULE=on
- KUBEBENCH_CFG=/etc/kube-bench/cfg

@ -10,10 +10,12 @@ notifications:
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y rpm
- pip install --user yamllint==1.18.0
- gem install --no-ri --no-rdoc fpm
- go get -t -v ./...
script:
- yamllint -c ./.yamllint.yaml .
- GO111MODULE=on go test ./...
- IMAGE_NAME=kube-bench make build-docker
- docker run -v `pwd`:/host kube-bench install

@ -0,0 +1,6 @@
---
extends: default
rules:
line-length: disable
truthy: disable

@ -774,7 +774,6 @@ groups:
op: has
value: "/etc/origin/master/ca-bundle.crt"
set: true
test_items:
- flag: "masterCA"
compare:
op: has

@ -1,3 +1,4 @@
---
# use this pod with: kubectl run ubuntu -it --pid=host -- /bin/bash
# this allows you to debug what is running on the host.
apiVersion: v1

@ -1,3 +1,4 @@
---
apiVersion: batch/v1
kind: Job
metadata:

@ -1,3 +1,4 @@
---
apiVersion: kind.sigs.k8s.io/v1alpha3
kind: Cluster
networking:
@ -16,4 +17,3 @@ nodes:
# the control plane node config
- role: control-plane
image: "kindest/node:v1.14.6"

@ -1,3 +1,4 @@
---
apiVersion: batch/v1
kind: Job
metadata:
@ -29,4 +30,3 @@ spec:
- name: etc-kubernetes
hostPath:
path: "/etc/kubernetes"

@ -1,3 +1,4 @@
---
apiVersion: batch/v1
kind: Job
metadata:

@ -1,3 +1,4 @@
---
apiVersion: batch/v1
kind: Job
metadata:

@ -1,3 +1,4 @@
---
apiVersion: batch/v1
kind: Job
metadata:

@ -1,3 +1,4 @@
---
apiVersion: batch/v1
kind: Job
metadata:

Loading…
Cancel
Save