Skip to content

Commit a81ae52

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 syslog-ng-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:") ./syslog_ng/defaults.yml 4:1 warning missing document start "---" (document-start) ./syslog_ng/os_family_map.yml 4:1 warning missing document start "---" (document-start) ./syslog_ng/os_codename_map.yml 5:1 warning missing document start "---" (document-start) pillar.example 1:1 warning missing document start "---" (document-start) 3:3 error wrong indentation: expected 4 but found 2 (indentation) 5:3 error wrong indentation: expected 4 but found 2 (indentation) 7:3 error wrong indentation: expected 4 but found 2 (indentation) 10:3 error wrong indentation: expected 4 but found 2 (indentation) 10:15 warning truthy value should be one of [false, true] (truthy) 11:14 warning truthy value should be one of [false, true] (truthy) 12:15 warning truthy value should be one of [false, true] (truthy) 13:20 warning truthy value should be one of [false, true] (truthy) 14:22 warning truthy value should be one of [false, true] (truthy) 15:21 warning truthy value should be one of [false, true] (truthy) 17:3 error wrong indentation: expected 4 but found 2 (indentation) 18:5 error wrong indentation: expected 6 but found 4 (indentation) 20:5 error wrong indentation: expected 6 but found 4 (indentation) 22:7 error wrong indentation: expected 8 but found 6 (indentation) 25:3 error wrong indentation: expected 4 but found 2 (indentation) 26:5 error wrong indentation: expected 6 but found 4 (indentation) 27:7 error wrong indentation: expected 8 but found 6 (indentation) 29:5 error wrong indentation: expected 6 but found 4 (indentation) 31:5 error wrong indentation: expected 6 but found 4 (indentation) 33:5 error wrong indentation: expected 6 but found 4 (indentation) 35:5 error wrong indentation: expected 6 but found 4 (indentation) 37:3 error wrong indentation: expected 4 but found 2 (indentation) 38:5 error wrong indentation: expected 6 but found 4 (indentation) 40:5 error wrong indentation: expected 6 but found 4 (indentation) 42:5 error wrong indentation: expected 6 but found 4 (indentation) 45:3 error wrong indentation: expected 4 but found 2 (indentation) pillar.debian.example 1:1 warning missing document start "---" (document-start) 3:24 warning truthy value should be one of [false, true] (truthy) 5:16 warning truthy value should be one of [false, true] (truthy) 6:17 warning truthy value should be one of [false, true] (truthy) 15:7 error wrong indentation: expected 8 but found 6 (indentation) 21:7 error wrong indentation: expected 8 but found 6 (indentation) 24:7 error wrong indentation: expected 8 but found 6 (indentation) 27:7 error wrong indentation: expected 8 but found 6 (indentation) 30:7 error wrong indentation: expected 8 but found 6 (indentation) 33:7 error wrong indentation: expected 8 but found 6 (indentation) 36:7 error wrong indentation: expected 8 but found 6 (indentation) 39:7 error wrong indentation: expected 8 but found 6 (indentation) 42:7 error wrong indentation: expected 8 but found 6 (indentation) 45:7 error wrong indentation: expected 8 but found 6 (indentation) 50:7 error wrong indentation: expected 8 but found 6 (indentation) 51:9 error wrong indentation: expected 10 but found 8 (indentation) 53:7 error wrong indentation: expected 8 but found 6 (indentation) 54:9 error wrong indentation: expected 10 but found 8 (indentation) 56:7 error wrong indentation: expected 8 but found 6 (indentation) 57:9 error wrong indentation: expected 10 but found 8 (indentation) 61:7 error wrong indentation: expected 8 but found 6 (indentation) 62:9 error wrong indentation: expected 10 but found 8 (indentation) 64:7 error wrong indentation: expected 8 but found 6 (indentation) 65:9 error wrong indentation: expected 10 but found 8 (indentation) 67:7 error wrong indentation: expected 8 but found 6 (indentation) 68:9 error wrong indentation: expected 10 but found 8 (indentation) 72:7 error wrong indentation: expected 8 but found 6 (indentation) 73:9 error wrong indentation: expected 10 but found 8 (indentation) 75:7 error wrong indentation: expected 8 but found 6 (indentation) 76:9 error wrong indentation: expected 10 but found 8 (indentation) 78:7 error wrong indentation: expected 8 but found 6 (indentation) 79:9 error wrong indentation: expected 10 but found 8 (indentation) 83:7 error wrong indentation: expected 8 but found 6 (indentation) 84:9 error wrong indentation: expected 10 but found 8 (indentation) 88:7 error wrong indentation: expected 8 but found 6 (indentation) 89:9 error wrong indentation: expected 10 but found 8 (indentation) 93:7 error wrong indentation: expected 8 but found 6 (indentation) 94:9 error wrong indentation: expected 10 but found 8 (indentation) 98:7 error wrong indentation: expected 8 but found 6 (indentation) 99:9 error wrong indentation: expected 10 but found 8 (indentation) 103:7 error wrong indentation: expected 8 but found 6 (indentation) 105:7 error wrong indentation: expected 8 but found 6 (indentation) 107:7 error wrong indentation: expected 8 but found 6 (indentation) 109:7 error wrong indentation: expected 8 but found 6 (indentation) 111:7 error wrong indentation: expected 8 but found 6 (indentation) 113:7 error wrong indentation: expected 8 but found 6 (indentation) 115:7 error wrong indentation: expected 8 but found 6 (indentation) 117:7 error wrong indentation: expected 8 but found 6 (indentation) 120:7 error wrong indentation: expected 8 but found 6 (indentation) 122:7 error wrong indentation: expected 8 but found 6 (indentation) 125:7 error wrong indentation: expected 8 but found 6 (indentation) 127:7 error wrong indentation: expected 8 but found 6 (indentation) 129:7 error wrong indentation: expected 8 but found 6 (indentation) 131:7 error wrong indentation: expected 8 but found 6 (indentation) 133:7 error wrong indentation: expected 8 but found 6 (indentation) 135:7 error wrong indentation: expected 8 but found 6 (indentation) 135:89 error line too long (97 > 88 characters) (line-length) 137:7 error wrong indentation: expected 8 but found 6 (indentation) 139:7 error wrong indentation: expected 8 but found 6 (indentation) 141:7 error wrong indentation: expected 8 but found 6 (indentation) 143:7 error wrong indentation: expected 8 but found 6 (indentation) 145:7 error wrong indentation: expected 8 but found 6 (indentation) 147:7 error wrong indentation: expected 8 but found 6 (indentation) 149:7 error wrong indentation: expected 8 but found 6 (indentation) 151:7 error wrong indentation: expected 8 but found 6 (indentation) ```
1 parent 7beedb7 commit a81ae52

File tree

8 files changed

+162
-131
lines changed

8 files changed

+162
-131
lines changed

.travis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@
22
# vim: ft=yaml
33
---
44
stages:
5-
- commitlint
5+
- lint
66
- name: release
77
if: branch = master AND type != pull_request
88

99
jobs:
1010
include:
11-
# Define the commitlint stage
12-
- stage: commitlint
11+
# Define the `lint` stage (runs `yamllint` and `commitlint`)
12+
- stage: lint
1313
language: node_js
1414
node_js: lts/*
1515
before_install: skip
1616
script:
17+
# Install and run `yamllint`
18+
- pip install --user yamllint
19+
# yamllint disable-line rule:line-length
20+
- yamllint -s . .yamllint pillar.example pillar.debian.example
21+
# Install and run `commitlint`
1722
- npm install @commitlint/config-conventional -D
1823
- npm install @commitlint/travis-cli -D
1924
- commitlint-travis
20-
# Define the release stage that runs semantic-release
25+
# Define the release stage that runs `semantic-release`
2126
- stage: release
2227
language: node_js
2328
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.debian.example

Lines changed: 77 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
syslog_ng:
25
options:
3-
- chain_hostnames: no
6+
- chain_hostnames: false
47
- flush_lines: 0
5-
- use_dns: no
6-
- use_fqdn: no
8+
- use_dns: false
9+
- use_fqdn: false
710
- owner: root
811
- group: adm
912
- perm: =0640
@@ -12,143 +15,144 @@ syslog_ng:
1215

1316
source:
1417
- s_src:
15-
- system: null
16-
- internal: null
18+
- system: null
19+
- internal: null
1720

1821
destination:
1922
# First some standard logfile
2023
- d_auth:
21-
- file:
22-
- /var/log/auth.log
24+
- file:
25+
- /var/log/auth.log
2326
- d_cron:
24-
- file:
25-
- /var/log/cron.log
27+
- file:
28+
- /var/log/cron.log
2629
- d_daemon:
27-
- file:
28-
- /var/log/daemon.log
30+
- file:
31+
- /var/log/daemon.log
2932
- d_kern:
30-
- file:
31-
- /var/log/kern.log
33+
- file:
34+
- /var/log/kern.log
3235
- d_lpr:
33-
- file:
34-
- /var/log/lpr.log
36+
- file:
37+
- /var/log/lpr.log
3538
- d_mail:
36-
- file:
37-
- /var/log/mail.log
39+
- file:
40+
- /var/log/mail.log
3841
- d_syslog:
39-
- file:
40-
- /var/log/syslog
42+
- file:
43+
- /var/log/syslog
4144
- d_user:
42-
- file:
43-
- /var/log/user.log
45+
- file:
46+
- /var/log/user.log
4447
- d_uucp:
45-
- file:
46-
- /var/log/uucp.log
48+
- file:
49+
- /var/log/uucp.log
4750

4851
# This files are the log come from the mail subsystem.
4952
- d_mailinfo:
50-
- file:
51-
- /var/log/mail.info
53+
- file:
54+
- /var/log/mail.info
5255
- d_mailwarn:
53-
- file:
54-
- /var/log/mail.warn
56+
- file:
57+
- /var/log/mail.warn
5558
- d_mailerr:
56-
- file:
57-
- /var/log/mail.err
59+
- file:
60+
- /var/log/mail.err
5861

5962
# Logging for INN news system
6063
- d_newscrit:
61-
- file:
62-
- /var/log/news/news.crit
64+
- file:
65+
- /var/log/news/news.crit
6366
- d_newserr:
64-
- file:
65-
- /var/log/news/news.err
67+
- file:
68+
- /var/log/news/news.err
6669
- d_newsnotice:
67-
- file:
68-
- /var/log/news/news.notice
70+
- file:
71+
- /var/log/news/news.notice
6972

7073
# Some 'catch-all' logfiles
7174
- d_debug:
72-
- file:
73-
- /var/log/debug
75+
- file:
76+
- /var/log/debug
7477
- d_error:
75-
- file:
76-
- /var/log/error
78+
- file:
79+
- /var/log/error
7780
- d_messages:
78-
- file:
79-
- /var/log/messages
81+
- file:
82+
- /var/log/messages
8083

8184
# The root's console.
8285
- d_console:
83-
- usertty:
84-
- root
86+
- usertty:
87+
- root
8588

8689
# Virtual console.
8790
- d_console_all:
88-
- file:
89-
- '`tty10`'
91+
- file:
92+
- '`tty10`'
9093

9194
# The named pipe /dev/xconsole is for the nsole' utility.
9295
- d_xconsole:
93-
- pipe:
94-
- /dev/xconsole
96+
- pipe:
97+
- /dev/xconsole
9598

9699
# Debian only
97100
- d_ppp:
98-
- file:
99-
- /var/log/ppp.log
101+
- file:
102+
- /var/log/ppp.log
100103

101104
filter:
102105
- f_dbg:
103-
- level: =debug
106+
- level: =debug
104107
- f_info:
105-
- level: =info
108+
- level: =info
106109
- f_notice:
107-
- level: =notice
110+
- level: =notice
108111
- f_warn:
109-
- level: =warn
112+
- level: =warn
110113
- f_err:
111-
- level: =err
114+
- level: =err
112115
- f_crit:
113-
- level: =crit .. emerg
116+
- level: =crit .. emerg
114117
- f_error:
115-
- level: =err .. emerg
118+
- level: =err .. emerg
116119
- f_console:
117-
- level: =warn .. emerg
120+
- level: =warn .. emerg
118121

119122
- f_debug:
120-
- =level(debug) and not facility(auth, authpriv, news, mail)
123+
- =level(debug) and not facility(auth, authpriv, news, mail)
121124
- f_messages:
122-
- =level(info,notice,warn) and not facility(auth,authpriv,cron,daemon,mail,news)
125+
- =level(info,notice,warn) and not facility(auth,authpriv,cron,daemon,mail,news)
123126

124127
- f_auth:
125-
- =facility(auth, authpriv) and not filter(f_debug)
128+
- =facility(auth, authpriv) and not filter(f_debug)
126129
- f_cron:
127-
- =facility(cron) and not filter(f_debug)
130+
- =facility(cron) and not filter(f_debug)
128131
- f_daemon:
129-
- =facility(daemon) and not filter(f_debug)
132+
- =facility(daemon) and not filter(f_debug)
130133
- f_kern:
131-
- =facility(kern) and not filter(f_debug)
134+
- =facility(kern) and not filter(f_debug)
132135
- f_lpr:
133-
- =facility(lpr) and not filter(f_debug)
136+
- =facility(lpr) and not filter(f_debug)
134137
- f_local:
135-
- =facility(local0, local1, local3, local4, local5, local6, local7) and not filter(f_debug)
138+
# yamllint disable-line rule:line-length
139+
- =facility(local0, local1, local3, local4, local5, local6, local7) and not filter(f_debug)
136140
- f_mail:
137-
- =facility(mail) and not filter(f_debug)
141+
- =facility(mail) and not filter(f_debug)
138142
- f_news:
139-
- =facility(news) and not filter(f_debug)
143+
- =facility(news) and not filter(f_debug)
140144
- f_syslog3:
141-
- =not facility(auth, authpriv, mail) and not filter(f_debug)
145+
- =not facility(auth, authpriv, mail) and not filter(f_debug)
142146
- f_user:
143-
- =facility(user) and not filter(f_debug)
147+
- =facility(user) and not filter(f_debug)
144148
- f_uucp:
145-
- =facility(uucp) and not filter(f_debug)
149+
- =facility(uucp) and not filter(f_debug)
146150
- f_cnews:
147-
- =level(notice, err, crit) and facility(news)
151+
- =level(notice, err, crit) and facility(news)
148152
- f_cother:
149-
- =level(debug, info, notice, warn) or facility(daemon, mail)
153+
- =level(debug, info, notice, warn) or facility(daemon, mail)
150154
- f_ppp:
151-
- =facility(local2) and not filter(f_debug)
155+
- =facility(local2) and not filter(f_debug)
152156

153157
log:
154158
-

pillar.example

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,64 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
syslog_ng:
25
module:
3-
- tfson
6+
- tfson
47
include:
5-
- scl.conf
8+
- scl.conf
69
last_include:
7-
- /etc/syslog-ng/conf.d/*.conf
10+
- /etc/syslog-ng/conf.d/*.conf
811
version: 3.5
912
options:
10-
- threaded: yes
11-
- use_dns: no
12-
- use_fqdn: yes
13-
- keep_hostname: yes
14-
- chain_hostnames: no
15-
- check_hostname: no
13+
- threaded: true
14+
- use_dns: false
15+
- use_fqdn: true
16+
- keep_hostname: true
17+
- chain_hostnames: false
18+
- check_hostname: false
1619
source:
17-
- s_internal:
18-
- internal: null
19-
- s_local:
20-
- unix-stream: /dev/log
21-
- file:
22-
- /proc/kmsg
23-
- program_override: kernel
20+
- s_internal:
21+
- internal: null
22+
- s_local:
23+
- unix-stream: /dev/log
24+
- file:
25+
- /proc/kmsg
26+
- program_override: kernel
2427
destination:
25-
- df_messages:
26-
- file:
27-
- /var/log/messages
28-
- df_secure:
29-
- file: /var/log/secure
30-
- df_console:
31-
- usertty: root
32-
- dp_devnull:
33-
- program: /bin/cat >/dev/null
34-
- dr_central:
35-
- syslog: my-remote.example.com
28+
- df_messages:
29+
- file:
30+
- /var/log/messages
31+
- df_secure:
32+
- file: /var/log/secure
33+
- df_console:
34+
- usertty: root
35+
- dp_devnull:
36+
- program: /bin/cat >/dev/null
37+
- dr_central:
38+
- syslog: my-remote.example.com
3639
filter:
37-
- f_messages:
38-
- level: =info..emerg
39-
- f_secure:
40-
- facility: =authpriv
41-
- f_emerg:
42-
- level: =emerg
43-
- facility: =uucp, news
40+
- f_messages:
41+
- level: =info..emerg
42+
- f_secure:
43+
- facility: =authpriv
44+
- f_emerg:
45+
- level: =emerg
46+
- facility: =uucp, news
4447
log:
45-
-
46-
- source: =s_internal
47-
- source: =s_local
48-
- destination: =dr_central
49-
-
50-
- source: =s_local
51-
- filter: =f_emerg
52-
- destination: =df_console
53-
-
54-
- source: =s_local
55-
- filter: =f_secure
56-
- destination: =df_secure
57-
- flags: =final
58-
-
59-
- source: =s_local
60-
- filter: =f_messages
61-
- destination: =df_messages
48+
-
49+
- source: =s_internal
50+
- source: =s_local
51+
- destination: =dr_central
52+
-
53+
- source: =s_local
54+
- filter: =f_emerg
55+
- destination: =df_console
56+
-
57+
- source: =s_local
58+
- filter: =f_secure
59+
- destination: =df_secure
60+
- flags: =final
61+
-
62+
- source: =s_local
63+
- filter: =f_messages
64+
- destination: =df_messages

0 commit comments

Comments
 (0)