Skip to content

Commit c6a7788

Browse files
authored
Merge pull request #38 from myii/chore/standardise-structure
feat(yamllint): include for this repo and apply rules throughout
2 parents 55eef18 + 073f66e commit c6a7788

File tree

13 files changed

+64
-23
lines changed

13 files changed

+64
-23
lines changed

.travis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---
44
stages:
55
- test
6-
- commitlint
6+
- lint
77
- name: release
88
if: branch = master AND type != pull_request
99

@@ -45,16 +45,21 @@ script:
4545

4646
jobs:
4747
include:
48-
# Define the commitlint stage
49-
- stage: commitlint
48+
# Define the `lint` stage (runs `yamllint` and `commitlint`)
49+
- stage: lint
5050
language: node_js
5151
node_js: lts/*
5252
before_install: skip
5353
script:
54+
# Install and run `yamllint`
55+
- pip install --user yamllint
56+
# yamllint disable-line rule:line-length
57+
- yamllint -s . .yamllint pillar.example test/salt/pillar/install_binary.sls test/salt/pillar/dev_server.sls test/salt/pillar/prod_server.sls
58+
# Install and run `commitlint`
5459
- npm install @commitlint/config-conventional -D
5560
- npm install @commitlint/travis-cli -D
5661
- commitlint-travis
57-
# Define the release stage that runs semantic-release
62+
# Define the release stage that runs `semantic-release`
5863
- stage: release
5964
language: node_js
6065
node_js: lts/*

.yamllint

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
# Extend the `default` configuration provided by `yamllint`
5+
extends: default
6+
7+
# Files to ignore completely
8+
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
9+
ignore: |
10+
node_modules/
11+
12+
rules:
13+
line-length:
14+
# Increase from default of `80`
15+
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
16+
max: 88

kitchen.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ platforms:
1717
platform: rhel
1818
run_command: /sbin/init
1919
provision_command:
20-
- curl -L https://bootstrap.saltstack.com | sh -s -- -X # install latest stable Salt
20+
# install latest stable Salt
21+
- curl -L https://bootstrap.saltstack.com | sh -s -- -X
2122

2223
## SALT `develop`
2324
- name: debian-9-develop-py3

pillar.example

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# -*- coding: utf-8 -*-
2-
# vim: ft=sls syntax=yaml softtabstop=2 tabstop=2 shiftwidth=2 expandtab autoindent
3-
2+
# vim: ft=yaml
3+
---
44
vault:
55
version: 1.1.0
66
platform: linux_amd64
7-
dev_mode: False
8-
verify_download: True
7+
dev_mode: false
8+
verify_download: true
99
config:
1010
storage:
1111
consul:
@@ -51,4 +51,3 @@ vault:
5151
oEIgXTMyCILo34Fa/C6VCm2WBgz9zZO8/rHIiQm1J5zqz0DrDwKBUM9C
5252
=LYpS
5353
-----END PGP PUBLIC KEY BLOCK-----
54-

test/integration/dev_server/inspec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
name: dev_server
25
title: vault formula
36
maintainer: SaltStack Formulas

test/integration/install_binary/inspec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
name: install_binary
25
title: vault formula
36
maintainer: SaltStack Formulas

test/integration/prod_server/inspec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
name: prod_server
25
title: vault formula
36
maintainer: SaltStack Formulas

test/salt/pillar/dev_server.sls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
vault:
2-
dev_mode: True
5+
dev_mode: true
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
vault:
2-
# version: 1.0.3 # test upgrades by doing a double-converge, changing the version pillar between each one
5+
# test upgrades by doing a double-converge, changing the version pillar
6+
# between each one
7+
# version: 1.0.3
38
version: 1.1.0
4-
verify_download: False
9+
verify_download: false

test/salt/pillar/prod_server.sls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
vault:
25
config:
36
storage:
47
file:
58
path: /var/lib/vault/data
69
tls_disable: 1
710
self_signed_cert:
8-
enabled: True
11+
enabled: true
912
hostname: localhost
1013
password: localhost
1114
country: GB

0 commit comments

Comments
 (0)