Kaynağa Gözat

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

feat(yamllint): include for this repo and apply rules throughout
tags/v1.2.0
Niels Abspoel 5 yıl önce
ebeveyn
işleme
cf43fc4559
İşleme yapanın e-posta adresine bağlı hesap yok
5 değiştirilmiş dosya ile 53 ekleme ve 27 silme
  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 Dosyayı Görüntüle

@@ -3,7 +3,7 @@
---
stages:
- test
- commitlint
- lint
- name: release
if: branch = master AND type != pull_request

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

jobs:
include:
# Define the commitlint stage
- stage: commitlint
# Define the `lint` stage (runs `yamllint` and `commitlint`)
- stage: lint
language: node_js
node_js: lts/*
before_install: skip
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/travis-cli -D
- commitlint-travis
# Define the release stage that runs semantic-release
# Define the release stage that runs `semantic-release`
- stage: release
language: node_js
node_js: lts/*

+ 16
- 0
.yamllint Dosyayı Görüntüle

@@ -0,0 +1,16 @@
# -*- 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 Dosyayı Görüntüle

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

+ 24
- 22
pillar.example Dosyayı Görüntüle

@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
chrony:
ntpservers:
- '0.debian.pool.ntp.org'
@@ -18,25 +21,24 @@ chrony:
- 'generatecommandkey'
- 'noclientlog'
- '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 Dosyayı Görüntüle

@@ -1,3 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: default
title: chrony formula
maintainer: SaltStack Formulas

Yükleniyor…
İptal
Kaydet