Merge pull request #139 from myii/chore/standardise-structure

ci(yamllint): add rule `empty-values` & use new `yaml-files` setting
This commit is contained in:
Éric Veiras Galisson 2019-09-11 08:28:44 +02:00 committed by GitHub
commit c7d5555a21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 16 deletions

View file

@ -56,9 +56,9 @@ jobs:
before_install: skip
script:
# Install and run `yamllint`
- pip install --user yamllint
# yamllint disable-line rule:line-length
- yamllint -s . .yamllint pillar.example test/salt/pillar/default.sls
# Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0
- yamllint -s .
# Install and run `commitlint`
- npm install @commitlint/config-conventional -D
- npm install @commitlint/travis-cli -D

View file

@ -6,19 +6,35 @@ extends: default
# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
ignore: |
node_modules/
test/**/states/**/*.sls
yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .yamllint
# SaltStack Formulas additional settings
- '*.example'
- test/**/*.sls
rules:
comments-indentation:
ignore: |
pillar.example
pillar-with-views.example
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
key-duplicates:
ignore: |
pillar.example
line-length:
ignore: |
pillar.example
pillar-with-views.example
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88

View file

@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
bind:
configured_acls: # We have an internal ACL restricted to our
internal: # private IP range.
@ -20,11 +23,11 @@ bind:
mydomain.com: # Notice that this value matches on both views.
type: master
file: external.mydomain.com.txt # Specify the file to be used, which must match the file
recursion: yes # name of the zone below under available_zones.
recursion: 'yes' # name of the zone below under available_zones.
# This filename also must match the corresponding zone name
# without the .txt extension (and be sure to use .txt as the extension).
notify: False
dnssec: False
notify: false
dnssec: false
internal: # The 'internal' view that is restricted to the 'internal' ACL.
match_clients:
@ -35,9 +38,9 @@ bind:
file: internal.mydomain.com.txt # Different file - matches the internal zone below.
# Again, this filename must match the corresponding zone name
# without the .txt extension (and be sure to use .txt as the extension).
recursion: yes
notify: False
dnssec: False
recursion: 'yes'
notify: false
dnssec: false
available_zones:
external.mydomain.com: # Beginning of the 'external' zone definition.