Skip to content

Commit 86aed1e

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 logrotate-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:") ./logrotate/osmap.yaml 1:1 warning missing document start "---" (document-start) ./logrotate/osfamilymap.yaml 1:1 warning missing document start "---" (document-start) 7:15 warning truthy value should be one of [false, true] (truthy) 12:14 warning truthy value should be one of [false, true] (truthy) 14:23 warning truthy value should be one of [false, true] (truthy) 16:14 warning truthy value should be one of [false, true] (truthy) 24:14 warning truthy value should be one of [false, true] (truthy) ./logrotate/defaults.yaml 4:1 warning missing document start "---" (document-start) 11:23 warning truthy value should be one of [false, true] (truthy) 13:13 warning truthy value should be one of [false, true] (truthy) 15:13 warning truthy value should be one of [false, true] (truthy) 16:1 error too many blank lines (1 > 0) (empty-lines) pillar.example 3:1 warning missing document start "---" (document-start) 5:4 warning missing starting space in comment (comments) 6:6 warning missing starting space in comment (comments) 6:5 warning comment not indented like content (comments-indentation) 7:6 warning missing starting space in comment (comments) 9:13 warning truthy value should be one of [false, true] (truthy) 11:13 warning truthy value should be one of [false, true] (truthy) 12:15 warning truthy value should be one of [false, true] (truthy) 13:14 warning truthy value should be one of [false, true] (truthy) 26:12 error trailing spaces (trailing-spaces) 48:12 error too many spaces after hyphen (hyphens) 69:1 error too many blank lines (1 > 0) (empty-lines) ```
1 parent 71696e0 commit 86aed1e

File tree

7 files changed

+55
-26
lines changed

7 files changed

+55
-26
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
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

logrotate/defaults.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=yaml
3-
3+
---
44
logrotate:
55
pkg: logrotate
66
conf_file: '/etc/logrotate.conf'
77
include_dir: '/etc/logrotate.d'
88
user: root
99
group: root
1010
service: cron
11-
login_records_jobs: True
11+
login_records_jobs: true
1212
default_config:
13-
weekly: True
13+
weekly: true
1414
rotate: 4
15-
create: True
16-
15+
create: true

logrotate/osfamilymap.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
Arch:
25
service: logrotate.timer
36
default_config:
47
tabooext: + .pacorig .pacnew .pacsave
58
Debian:
69
default_config:
7-
compress: True
10+
compress: true
811
RedHat:
912
pkg: cronie
1013
service: crond
1114
default_config:
12-
dateext: True
15+
dateext: true
1316
Suse:
14-
login_records_jobs: False
17+
login_records_jobs: false
1518
default_config:
16-
dateext: True
19+
dateext: true
1720
compresscmd: /usr/bin/xz
1821
uncompresscmd: /usr/bin/xzdec
1922
Gentoo:
2023
pkg: app-admin/logrotate
2124
service: cronie
2225
default_config:
2326
tabooext: + .keep
24-
dateext: True
27+
dateext: true
2528
FreeBSD:
2629
conf_file: /usr/local/etc/logrotate.conf
2730
include_dir: /usr/local/etc/logrotate.d

logrotate/osmap.yaml

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
Ubuntu:
25
default_config:
36
su: root syslog

pillar.example

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
# vim: sts=2 ts=2 sw=2 et ai
2-
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
34
logrotate:
45
# default OS values can be overridden in 'lookup' dict
5-
#lookup:
6-
#pkg: logrotate
7-
#service: crond
6+
# lookup:
7+
# pkg: logrotate
8+
# service: crond
89
default_config:
9-
weekly: True
10+
weekly: true
1011
rotate: 52
11-
create: True
12-
compress: True
13-
dateext: True
12+
create: true
13+
compress: true
14+
dateext: true
1415
jobs:
1516
/tmp/var/log/mysql/error:
1617
config:
@@ -23,7 +24,7 @@ logrotate:
2324
- create 640 root adm
2425
- sharedscripts
2526
mysql:
26-
path:
27+
path:
2728
- /tmp/var/log/mysql/*.log
2829
config:
2930
- weekly
@@ -45,7 +46,7 @@ logrotate:
4546
config:
4647
- sharedscripts
4748
- postrotate
48-
- /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
49+
- /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
4950
- endscript
5051
nginx:
5152
contents: |
@@ -66,4 +67,3 @@ logrotate:
6667
invoke-rc.d nginx rotate >/dev/null 2>&1
6768
endscript
6869
}
69-

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: logrotate formula
36
maintainer: SaltStack Formulas

0 commit comments

Comments
 (0)