Browse Source

feat(yamllint): include for this repo and apply rules throughout

* Semi-automated using `ssf-formula` (v0.5.0)
* Fix errors shown below:

```bash
chrony-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:")
pillar.example
  1:1       warning  missing document start "---"  (document-start)
  21:3      warning  comment not indented like content  (comments-indentation)
```
tags/v1.2.0
Imran Iqbal 5 years ago
parent
commit
f83a4988b6
No account linked to committer's email address
5 changed files with 53 additions and 27 deletions
  1. +9
    -4
      .travis.yml
  2. +16
    -0
      .yamllint
  3. +1
    -1
      chrony/config/file.sls
  4. +24
    -22
      pillar.example
  5. +3
    -0
      test/integration/default/inspec.yml

+ 9
- 4
.travis.yml View File

--- ---
stages: stages:
- test - test
- commitlint
- lint
- name: release - name: release
if: branch = master AND type != pull_request if: branch = master AND type != pull_request




jobs: jobs:
include: include:
# Define the commitlint stage
- stage: commitlint
# Define the `lint` stage (runs `yamllint` and `commitlint`)
- stage: lint
language: node_js language: node_js
node_js: lts/* node_js: lts/*
before_install: skip before_install: skip
script: script:
# Install and run `yamllint`
- pip install --user yamllint
# yamllint disable-line rule:line-length
- yamllint -s . .yamllint pillar.example
# Install and run `commitlint`
- npm install @commitlint/config-conventional -D - npm install @commitlint/config-conventional -D
- npm install @commitlint/travis-cli -D - npm install @commitlint/travis-cli -D
- commitlint-travis - commitlint-travis
# Define the release stage that runs semantic-release
# Define the release stage that runs `semantic-release`
- stage: release - stage: release
language: node_js language: node_js
node_js: lts/* node_js: lts/*

+ 16
- 0
.yamllint View File

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
# Extend the `default` configuration provided by `yamllint`
extends: default

# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
ignore: |
node_modules/

rules:
line-length:
# Increase from default of `80`
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
max: 88

+ 1
- 1
chrony/config/file.sls View File

chrony-config-file-file-managed: chrony-config-file-file-managed:
file.managed: file.managed:
- name: {{ chrony.config }} - name: {{ chrony.config }}
- source: {{ files_switch(['chrony.conf', 'chrony.conf.jinja'],
- source: {{ files_switch(['chrony.conf.jinja'],
lookup='chrony-config-file-file-managed' lookup='chrony-config-file-file-managed'
) )
}} }}

+ 24
- 22
pillar.example View File

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
chrony: chrony:
ntpservers: ntpservers:
- '0.debian.pool.ntp.org' - '0.debian.pool.ntp.org'
- 'generatecommandkey' - 'generatecommandkey'
- 'noclientlog' - 'noclientlog'
- 'logchange 0.5' - 'logchange 0.5'
# tofs:
# # The files_switch key serves as a selector for alternative
# # directories under the formula files directory. See TOFS pattern
# # doc for more info.
# # Note: Any value not evaluated by `config.get` will be used literally.
# # This can be used to set custom paths, as many levels deep as required.
# files_switch:
# - any/path/can/be/used/here
# - id
# - osfinger
# - os
# - os_family
# # All aspects of path/file resolution are customisable using the options below.
# # This is unnecessary in most cases; there are sensible defaults.
# path_prefix: template_alt
# dirs:
# files: files_alt
# default: default_alt
# source_files:
# chrony-config-file-file-managed:
# - 'chrony_alt.conf'
# - 'chrony_alt.conf.jinja'
tofs:
# # The files_switch key serves as a selector for alternative
# # directories under the formula files directory. See TOFS pattern
# # doc for more info.
# # Note: Any value not evaluated by `config.get` will be used literally.
# # This can be used to set custom paths, as many levels deep as required.
# files_switch:
# - any/path/can/be/used/here
# - id
# - osfinger
# - os
# - os_family
# # All aspects of path/file resolution are customisable using the options below.
# # This is unnecessary in most cases; there are sensible defaults.
# path_prefix: template_alt
# dirs:
# files: files_alt
# default: default_alt
source_files:
chrony-config-file-file-managed:
- 'chrony.conf'

+ 3
- 0
test/integration/default/inspec.yml View File

# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: default name: default
title: chrony formula title: chrony formula
maintainer: SaltStack Formulas maintainer: SaltStack Formulas

Loading…
Cancel
Save