Skip to content

Commit 571cc4b

Browse files
committed
feat(yamllint): include for this repo and apply rules throughout
* Semi-automated using `ssf-formula` (v0.5.0) * Fix errors shown below: ```bash php-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:") ./test/integration/default/inspec.yml 1:1 warning missing document start "---" (document-start) pillar.example 3:1 warning missing document start "---" (document-start) 7:22 warning truthy value should be one of [false, true] (truthy) 8:22 warning truthy value should be one of [false, true] (truthy) 10:22 warning truthy value should be one of [false, true] (truthy) 16:17 warning truthy value should be one of [false, true] (truthy) 41:12 error wrong indentation: expected 10 but found 11 (indentation) 46:27 warning truthy value should be one of [false, true] (truthy) 70:18 warning truthy value should be one of [false, true] (truthy) 74:19 warning truthy value should be one of [false, true] (truthy) 83:22 warning truthy value should be one of [false, true] (truthy) 97:22 warning truthy value should be one of [false, true] (truthy) 107:89 error line too long (93 > 88 characters) (line-length) 118:20 warning truthy value should be one of [false, true] (truthy) 126:14 error wrong indentation: expected 12 but found 13 (indentation) 126:23 warning truthy value should be one of [false, true] (truthy) 151:20 warning truthy value should be one of [false, true] (truthy) 177:19 warning truthy value should be one of [false, true] (truthy) 197:25 warning truthy value should be one of [false, true] (truthy) ```
1 parent 83ff9d9 commit 571cc4b

File tree

4 files changed

+57
-29
lines changed

4 files changed

+57
-29
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/debian.sls test/salt/pillar/redhat.sls test/salt/pillar/suse.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

pillar.example

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
## php.ng pillar examples
25

36
php:
47
# Use the following values to mute deprecation warnings
5-
warning_messages: #
6-
v1.0.0: #
7-
mute_critical: True #
8-
mute_upcoming: True #
8+
warning_messages:
9+
v1.0.0:
10+
mute_critical: true
11+
mute_upcoming: true
912
# Use external repository instead the default (only Ubuntu family)
10-
use_external_repo: True
13+
use_external_repo: true
1114
# Set the external repository name (valid only if use_external_repo is not none)
1215
external_repo_name: 'ondrej/php'
1316
# Use Software Collections Repository offering PHP 5.4, 5.5, 5.6, 7.0 and 7.1
1417
# https://www.softwarecollections.org/en/ for more information.
1518
# SCL is only supported on RHEL and CentOS and only active when using php.ng
16-
use_scl_repo: True
19+
use_scl_repo: true
1720
# Which PHP version from the SCL repos to use
1821
scl_php_version: 71
1922
# Set the MongoDB driver version. You can specify (optionally) the driver version
@@ -49,12 +52,12 @@ php:
4952
# to pass forward special arguments to the pkg.installed call
5053
# you MUST include the name argument for this to work
5154
cli:
52-
-
53-
name: php-cli
54-
fromrepo: my-specialrepo
55-
-
56-
name: php-common
57-
skip_verify: True
55+
-
56+
name: php-cli
57+
fromrepo: my-specialrepo
58+
-
59+
name: php-common
60+
skip_verify: true
5861

5962
# php-fpm os-specific settings
6063
fpm:
@@ -77,12 +80,12 @@ php:
7780

7881
# settings for the php-fpm service
7982
service:
80-
# if True, enables the php-fpm service, if False disables it
81-
enabled: True
83+
# if true, enables the php-fpm service, if false disables it
84+
enabled: true
8285
# additional arguments passed forward to
8386
# service.enabled/disabled
8487
opts:
85-
reload: True
88+
reload: true
8689

8790
# settings for the relevant php-fpm configuration files
8891
config:
@@ -91,7 +94,7 @@ php:
9194
ini:
9295
# arguments passed through to file.managed
9396
opts:
94-
recurse: True
97+
recurse: true
9598
# php.ini file contents that will be merged with the
9699
# defaults in php.ng.ini.defaults. See php.ng.ini.defaults for
97100
# syntax guidelines.
@@ -105,7 +108,7 @@ php:
105108
conf:
106109
# arguments passed through to file.managed
107110
opts:
108-
recurse: True
111+
recurse: true
109112
# php-fpm conf file contents that will be merged with
110113
# php.ng.lookup.fpm.defaults. See php.ng.ini.defaults for
111114
# ini-style syntax guidelines.
@@ -115,7 +118,8 @@ php:
115118

116119
# settings for fpm-pools
117120
pools:
118-
# defaults will apply for each pools settings and can be overwritten by pool settings
121+
# defaults will apply for each pools settings and can be overwritten
122+
# by pool settings
119123
defaults:
120124
user: nginx
121125
group: nginx
@@ -124,17 +128,17 @@ php:
124128
# name of the pool file to be managed, this will be appended
125129
# to the path specified in php.ng.lookup.fpm.pools
126130
'mypool.conf':
127-
# If true, the pool file will be managed, if False it will be
131+
# If true, the pool file will be managed, if false it will be
128132
# absent
129-
enabled: True
133+
enabled: true
130134

131135
# Overwrite the filename for ext_pillar that doesn't allow
132136
# dots in fields names.
133137
filname: my_other_name.conf
134138

135139
# arguments passed forward to file.managed or file.absent
136140
opts:
137-
replace: False
141+
replace: false
138142

139143
# pool file contents. See php.ng.ini.defaults for ini-style
140144
# syntax guidelines.
@@ -159,7 +163,7 @@ php:
159163
ini:
160164
# opts passed forward directly to file.managed
161165
opts:
162-
replace: False
166+
replace: false
163167
# contents of the php.ini file that are merged with defaults
164168
# from php.ng.ini.defaults. See php.ng.ini.defaults for ini-style
165169
# syntax guidelines
@@ -185,7 +189,7 @@ php:
185189
# its contents will be joined by commas in final rendering.
186190
defaults:
187191
PHP:
188-
engine: on
192+
engine: 'On'
189193
output_buffering: 4096
190194
disable_functions:
191195
- pcntl_alarm
@@ -204,5 +208,5 @@ php:
204208
- mysql
205209

206210
# When using php.ng.apache2 on FreeBSD:
207-
# Set this to False if you're not using apache-formula
208-
use_apache_formula: True
211+
# Set this to false if you're not using apache-formula
212+
use_apache_formula: true

test/integration/default/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: default
25
title: php formula
36
maintainer: SaltStack Formulas

0 commit comments

Comments
 (0)