Skip to content

Commit c78aa26

Browse files
Merge pull request #49 from myii/chore/standardise-structure
feat(yamllint): include for this repo and apply rules throughout
2 parents 1caf9ea + 03d15e9 commit c78aa26

File tree

7 files changed

+38
-6
lines changed

7 files changed

+38
-6
lines changed

.travis.yml

+9-4
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

@@ -33,16 +33,21 @@ script:
3333

3434
jobs:
3535
include:
36-
# Define the commitlint stage
37-
- stage: commitlint
36+
# Define the `lint` stage (runs `yamllint` and `commitlint`)
37+
- stage: lint
3838
language: node_js
3939
node_js: lts/*
4040
before_install: skip
4141
script:
42+
# Install and run `yamllint`
43+
- pip install --user yamllint
44+
# yamllint disable-line rule:line-length
45+
- yamllint -s . .yamllint pillar.example test/salt/pillar/repositories.pillar.sls test/salt/pillar/preferences.pillar.sls
46+
# Install and run `commitlint`
4247
- npm install @commitlint/config-conventional -D
4348
- npm install @commitlint/travis-cli -D
4449
- commitlint-travis
45-
# Define the release stage that runs semantic-release
50+
# Define the release stage that runs `semantic-release`
4651
- stage: release
4752
language: node_js
4853
node_js: lts/*

.yamllint

+16
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

pillar.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
apt:
55
# Set the right keyring for the distro (ie ubuntu-keyring or ...)
66
keyring_package: debian-archive-keyring
7-
7+
88
remove_sources_list: true
99
clean_sources_list_d: true
1010

test/integration/preferences/inspec.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
name: preferences
25
title: apt formula
36
maintainer: SaltStack Formulas

test/integration/repositories/inspec.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
name: repositories
25
title: apt formula
36
maintainer: SaltStack Formulas

test/salt/pillar/preferences.pillar.sls

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
apt:
25
remove_preferences: true
36
clean_preferences_d: true

test/salt/pillar/repositories.pillar.sls

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
apt:
25
remove_sources_list: true
36
clean_sources_list_d: true
@@ -16,4 +19,3 @@ apt:
1619
arch: [amd64]
1720
comps: []
1821
key_url: https://cli-assets.heroku.com/apt/release.key
19-

0 commit comments

Comments
 (0)