Skip to content

Commit a81c9ff

Browse files
committed
feat(yamllint): include for this repo and apply rules throughout
* Semi-automated using `ssf-formula` (v0.5.0) * Fix (or ignore) errors shown below: ```bash bind-formula$ $(grep "\- yamllint" .travis.yml | sed -e "s:^\s\+-\s\(.*\):\1:") pillar.example 1:1 warning comment not indented like content (comments-indentation) 1:89 error line too long (95 > 88 characters) (line-length) 2:1 warning missing document start "---" (document-start) 2:10 error wrong indentation: expected 0 but found 9 (indentation) 2:89 error line too long (103 > 88 characters) (line-length) 8:1 error syntax error: expected '<document start>', but found '<block mapping start>' 14:89 error line too long (94 > 88 characters) (line-length) 15:51 warning comment not indented like content (comments-indentation) 19:1 error duplication of key "bind" in mapping (key-duplicates) 21:89 error line too long (93 > 88 characters) (line-length) 23:89 error line too long (102 > 88 characters) (line-length) 27:89 error line too long (96 > 88 characters) (line-length) 32:89 error line too long (143 > 88 characters) (line-length) 33:89 error line too long (134 > 88 characters) (line-length) 35:24 error trailing spaces (trailing-spaces) 36:89 error line too long (91 > 88 characters) (line-length) 37:89 error line too long (93 > 88 characters) (line-length) 38:23 warning truthy value should be one of [false, true] (truthy) 39:27 warning truthy value should be one of [false, true] (truthy) 40:27 warning truthy value should be one of [false, true] (truthy) 44:23 warning truthy value should be one of [false, true] (truthy) 45:27 warning truthy value should be one of [false, true] (truthy) 46:27 warning truthy value should be one of [false, true] (truthy) 50:23 warning truthy value should be one of [false, true] (truthy) 51:27 warning truthy value should be one of [false, true] (truthy) 52:27 warning truthy value should be one of [false, true] (truthy) 55:23 warning truthy value should be one of [false, true] (truthy) 56:27 warning truthy value should be one of [false, true] (truthy) 57:27 warning truthy value should be one of [false, true] (truthy) 62:23 warning truthy value should be one of [false, true] (truthy) 63:27 warning truthy value should be one of [false, true] (truthy) 64:27 warning truthy value should be one of [false, true] (truthy) 89:89 error line too long (91 > 88 characters) (line-length) 90:1 warning comment not indented like content (comments-indentation) 97:1 warning comment not indented like content (comments-indentation) 98:89 error line too long (92 > 88 characters) (line-length) 99:51 warning comment not indented like content (comments-indentation) 99:89 error line too long (96 > 88 characters) (line-length) 102:1 warning comment not indented like content (comments-indentation) 102:35 error trailing spaces (trailing-spaces) 103:20 warning truthy value should be one of [false, true] (truthy) 103:89 error line too long (99 > 88 characters) (line-length) 104:51 warning comment not indented like content (comments-indentation) 106:89 error line too long (99 > 88 characters) (line-length) 109:40 error trailing spaces (trailing-spaces) 110:1 error duplication of key "bind" in mapping (key-duplicates) 113:89 error line too long (115 > 88 characters) (line-length) 115:89 error line too long (110 > 88 characters) (line-length) 116:13 error trailing spaces (trailing-spaces) 129:89 error line too long (120 > 88 characters) (line-length) 130:11 error trailing spaces (trailing-spaces) 150:81 error trailing spaces (trailing-spaces) 167:89 error line too long (118 > 88 characters) (line-length) 168:89 error line too long (101 > 88 characters) (line-length) 169:89 error line too long (103 > 88 characters) (line-length) 169:103 error trailing spaces (trailing-spaces) 170:89 error line too long (107 > 88 characters) (line-length) 170:107 error trailing spaces (trailing-spaces) 171:54 warning comment not indented like content (comments-indentation) 171:89 error line too long (120 > 88 characters) (line-length) 172:15 warning truthy value should be one of [false, true] (truthy) 172:89 error line too long (104 > 88 characters) (line-length) 174:21 error trailing spaces (trailing-spaces) 177:15 warning truthy value should be one of [false, true] (truthy) 178:19 error trailing spaces (trailing-spaces) 180:22 error trailing spaces (trailing-spaces) 186:24 warning truthy value should be one of [false, true] (truthy) 186:89 error line too long (124 > 88 characters) (line-length) 191:15 warning truthy value should be one of [false, true] (truthy) 193:89 error line too long (93 > 88 characters) (line-length) 193:93 error trailing spaces (trailing-spaces) 195:89 error line too long (101 > 88 characters) (line-length) 196:89 error line too long (104 > 88 characters) (line-length) 196:104 error trailing spaces (trailing-spaces) 197:15 warning truthy value should be one of [false, true] (truthy) 200:76 error trailing spaces (trailing-spaces) 206:89 error line too long (94 > 88 characters) (line-length) 208:89 error line too long (94 > 88 characters) (line-length) 209:89 error line too long (98 > 88 characters) (line-length) 213:36 error trailing spaces (trailing-spaces) 216:1 error duplication of key "bind" in mapping (key-duplicates) 218:25 warning truthy value should be one of [false, true] (truthy) 221:1 error too many blank lines (3 > 2) (empty-lines) 223:1 error duplication of key "bind" in mapping (key-duplicates) 231:15 warning truthy value should be one of [false, true] (truthy) 231:89 error line too long (98 > 88 characters) (line-length) 232:89 error line too long (94 > 88 characters) (line-length) 234:89 error line too long (98 > 88 characters) (line-length) 235:51 warning comment not indented like content (comments-indentation) 235:89 error line too long (107 > 88 characters) (line-length) 240:15 warning truthy value should be one of [false, true] (truthy) 240:89 error line too long (98 > 88 characters) (line-length) 241:15 warning truthy value should be one of [false, true] (truthy) 241:89 error line too long (101 > 88 characters) (line-length) 242:51 warning comment not indented like content (comments-indentation) 242:89 error line too long (97 > 88 characters) (line-length) 247:15 warning truthy value should be one of [false, true] (truthy) 247:89 error line too long (98 > 88 characters) (line-length) 248:89 error line too long (99 > 88 characters) (line-length) 249:51 warning comment not indented like content (comments-indentation) 249:89 error line too long (98 > 88 characters) (line-length) 253:15 warning truthy value should be one of [false, true] (truthy) 260:89 error line too long (99 > 88 characters) (line-length) 261:15 warning truthy value should be one of [false, true] (truthy) 271:89 error line too long (96 > 88 characters) (line-length) 284:89 error line too long (109 > 88 characters) (line-length) 285:51 warning comment not indented like content (comments-indentation) 285:89 error line too long (128 > 88 characters) (line-length) 286:89 error line too long (114 > 88 characters) (line-length) 287:89 error line too long (127 > 88 characters) (line-length) 289:89 error line too long (122 > 88 characters) (line-length) 290:89 error line too long (89 > 88 characters) (line-length) 291:89 error line too long (120 > 88 characters) (line-length) 292:89 error line too long (93 > 88 characters) (line-length) 293:19 warning truthy value should be one of [false, true] (truthy) 293:24 error trailing spaces (trailing-spaces) 300:89 error line too long (119 > 88 characters) (line-length) 301:51 warning comment not indented like content (comments-indentation) 301:89 error line too long (122 > 88 characters) (line-length) 302:89 error line too long (93 > 88 characters) (line-length) 305:1 error duplication of key "bind" in mapping (key-duplicates) 313:1 warning comment not indented like content (comments-indentation) 313:89 error line too long (99 > 88 characters) (line-length) 320:89 error line too long (89 > 88 characters) (line-length) 337:89 error line too long (95 > 88 characters) (line-length) 341:89 error line too long (120 > 88 characters) (line-length) 345:1 error too many blank lines (4 > 2) (empty-lines) 358:89 error line too long (89 > 88 characters) (line-length) 362:89 error line too long (117 > 88 characters) (line-length) 363:89 error line too long (89 > 88 characters) (line-length) 365:89 error line too long (102 > 88 characters) (line-length) 371:1 error duplication of key "bind" in mapping (key-duplicates) test/salt/pillar/default.sls 1:1 warning missing document start "---" (document-start) 11:15 warning truthy value should be one of [false, true] (truthy) 16:15 warning truthy value should be one of [false, true] (truthy) 19:15 warning truthy value should be one of [false, true] (truthy) 28:15 warning truthy value should be one of [false, true] (truthy) 114:1 error too many blank lines (1 > 0) (empty-lines) ```
1 parent d5d11a4 commit a81c9ff

File tree

5 files changed

+93
-59
lines changed

5 files changed

+93
-59
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/default.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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
comments-indentation:
14+
ignore: |
15+
pillar.example
16+
key-duplicates:
17+
ignore: |
18+
pillar.example
19+
line-length:
20+
ignore: |
21+
pillar.example
22+
# Increase from default of `80`
23+
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
24+
max: 88

pillar.example

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
# Note - Each section beginning with 'bind:' below represents a different way you may configure
2-
pillars for bind. When configuring your pillar(s), you may use any combination of subsections,
3-
but salt will not merge sections with the same heading.
5+
# pillars for bind. When configuring your pillar(s), you may use any combination of subsections,
6+
# but salt will not merge sections with the same heading.
47

58

69
### Overrides for the defaults specified by ###
@@ -32,36 +35,36 @@ bind:
3235
use_extensive_logging: # Enable extensive config for logging. Partial example. For proposed settings please refer to
3336
channel: # https://kb.isc.org/article/AA-01526/0/BIND-Logging-some-basic-recommendations.html
3437
default_log:
35-
file: default
38+
file: default
3639
size: '200m' # size of a individual file (default 20m)
3740
versions: '10' # how many files will be stored (default 3)
38-
print-time: yes
39-
print-category: yes
40-
print-severity: yes
41+
print-time: true
42+
print-category: true
43+
print-severity: true
4144
severity: info
4245
queries_log:
4346
file: queries
44-
print-time: yes
45-
print-category: yes
46-
print-severity: yes
47+
print-time: true
48+
print-category: true
49+
print-severity: true
4750
severity: info
4851
query-errors_log:
4952
file: query-errors
50-
print-time: yes
51-
print-category: yes
52-
print-severity: yes
53+
print-time: true
54+
print-category: true
55+
print-severity: true
5356
severity: dynamic
5457
default_syslog:
55-
print-time: yes
56-
print-category: yes
57-
print-severity: yes
58+
print-time: true
59+
print-category: true
60+
print-severity: true
5861
syslog: daemon
5962
severity: info
6063
default_debug:
6164
file: named.run
62-
print-time: yes
63-
print-category: yes
64-
print-severity: yes
65+
print-time: true
66+
print-category: true
67+
print-severity: true
6568
severity: info
6669
category:
6770
default:
@@ -99,21 +102,21 @@ bind:
99102
# (ipv4: 4, ipv6: 6). Omitting this reverts to
100103
# binds default of both.
101104

102-
# Debian and FreeBSD based systems
103-
default_zones: True # If set to True, the default-zones configuration
104-
# will be enabled. Defaults to False.
105+
# Debian and FreeBSD based systems
106+
default_zones: true # If set to true, the default-zones configuration
107+
# will be enabled. Defaults to false.
105108

106109
includes: # Include any additional configuration file(s) in
107110
- /some/additional/named.conf # named.conf
108111

109-
# Debian based systems optional configs
112+
# Debian based systems optional configs
110113
bind:
111114
config:
112115
options:
113116
querylog: 'yes' # Enable query logs, by default is disabled in map.jinja (yes,no)
114117

115118
rndc_client: # Generate rndc.conf file it uses previously defined keys
116-
options:
119+
options:
117120
default:
118121
server: localhost
119122
port: 953
@@ -127,7 +130,7 @@ bind:
127130
key: my_default_key
128131

129132
controls: # If you define controls then you also should configure rndc_client
130-
local:
133+
local:
131134
enabled: true
132135
bind:
133136
address: 127.0.0.1
@@ -147,7 +150,7 @@ bind:
147150
keys:
148151
- core_dhcp
149152

150-
statistics: # Enable statistics-channel
153+
statistics: # Enable statistics-channel
151154
local:
152155
enabled: true
153156
bind:
@@ -166,38 +169,38 @@ bind:
166169

167170
configured_zones: # Debian based systems can have zones using only configured_zones
168171
sub.domain.com: # This zone will be copied from zones_source_dir
169-
file: sub.domain.com # You can optionally specify name of a file here.
170-
type: master # Yo don't have define zone again in available_zones.
172+
file: sub.domain.com # You can optionally specify name of a file here.
173+
type: master # Yo don't have define zone again in available_zones.
171174
# This feature is backward compatibile and only available in debian
172-
notify: False # if type master you need specify notify True/False
175+
notify: false # if type master you need specify notify true/false
173176

174-
sub2.domain.com:
177+
sub2.domain.com:
175178
file: sub2.domain.com
176179
type: master
177-
notify: True
178-
allow-query:
180+
notify: true
181+
allow-query:
179182
- any
180-
allow-transfer:
183+
allow-transfer:
181184
- my_net
182185
allow-update: 'none'
183186
also-notify:
184187
- 1.2.3.4
185188
- 1.2.3.3
186-
zone-statistics: yes # Enable detailed statistics for zone. You need enable statistics first
189+
zone-statistics: true # Enable detailed statistics for zone. You need enable statistics first
187190

188191
test.zone.com:
189192
file: test.zone.com
190193
type: slave
191-
notify: False
194+
notify: false
192195
masters:
193-
- my_dns_masters # You can specify masters by using name
196+
- my_dns_masters # You can specify masters by using name
194197

195198
test.zone2.com: # Zone definied in default style of this formula
196-
type: slave # You need specify all info inside available_zones
197-
notify: False
199+
type: slave # You need specify all info inside available_zones
200+
notify: false
198201

199202

200-
configured_masters: # Configure master dns
203+
configured_masters: # Configure master dns
201204
my_dns_masters:
202205
- 10.10.20.20
203206
- 10.10.30.30
@@ -210,13 +213,12 @@ bind:
210213
- 10.167.73.21
211214
- 10.174.60.44
212215

213-
# End Debian based systems features
216+
# End Debian based systems features
214217

215218
# on SUSE include the forwarders.conf file generated by netconfig(8)
216219
bind:
217220
config:
218-
include_forwarders: True
219-
221+
include_forwarders: true
220222

221223

222224
### Keys, Zones, ACLs and Views ###
@@ -228,7 +230,7 @@ bind:
228230
configured_zones:
229231
sub.domain.com: # First domain zone
230232
type: master # We're the master of this zone
231-
notify: False # Don't notify any NS RRs of any changes to zone
233+
notify: false # Don't notify any NS RRs of any changes to zone
232234
also-notify: # Do notify these IP addresses (pointless as
233235
- 1.1.1.1 # notify has been set to no)
234236
- 2.2.2.2 # If using views, do not define configured_zones
@@ -237,28 +239,28 @@ bind:
237239

238240
sub.domain2.com: # Domain zone with DNSSEC
239241
type: master # We're the master of this zone
240-
notify: False # Don't notify any NS RRs of any changes to zone
241-
dnssec: True # Create and manage signed zonefile with zonesigner
242+
notify: false # Don't notify any NS RRs of any changes to zone
243+
dnssec: true # Create and manage signed zonefile with zonesigner
242244
# You will have to install dnssec-tools by hand
243245
# on many distributions
244246

245247
sub.domain3.com: # Domain zone with DNSSEC
246248
type: master # We're the master of this zone
247-
notify: False # Don't notify any NS RRs of any changes to zone
249+
notify: false # Don't notify any NS RRs of any changes to zone
248250
auto-dnssec: 'maintain' # Bind will create and manage the signed zonefile
249251
# itself, we only have to provide the clear zone
250252

251253
1.168.192.in-addr.arpa: # Reverse lookup for local IPs
252254
type: master # As above
253-
notify: False # As above
255+
notify: false # As above
254256
allow-transfer: # As above
255257
- 1.1.1.1
256258
- 2.2.2.2
257259

258260
dynamic.domain.com: # Our ddns zone
259261
type: master # As above
260262
allow-update: "key core_dhcp" # Who we allow updates from (refers to above key)
261-
notify: True # Notify NS RRs of changes
263+
notify: true # Notify NS RRs of changes
262264

263265
sub.anotherdomain.com: # Another domain zone
264266
type: forward # This time it's a forwarding zone
@@ -290,7 +292,7 @@ bind:
290292
# serve a different record set in each.
291293
# If doing this, you need to configure the zones and their record sets
292294
# underneath the 'available_zones' section.
293-
notify: False
295+
notify: false
294296
update_policy: # A given update policy
295297
- "grant core_dhcp name dns_entry_allowed_to_update. ANY"
296298

@@ -341,8 +343,6 @@ bind:
341343
_dmarc: '"v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com; fo=1:d:s; adkim=r; aspf=r; pct=100; ri=86400"'
342344

343345

344-
345-
346346
3.2.1.in-addr.arpa: # auto-generated reverse zone
347347
file: example.com.rev.txt
348348
soa: # Declare the SOA RRs for the zone

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

test/salt/pillar/default.sls

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
14
bind:
25
configured_acls:
36
client1:
@@ -8,15 +11,15 @@ bind:
811
configured_zones:
912
example.com:
1013
type: master
11-
notify: False
14+
notify: false
1215
update_policy:
1316
- "grant core_dhcp name dns_entry_allowed_to_update. ANY"
1417
example.net:
1518
type: master
16-
notify: False
19+
notify: false
1720
example.org:
1821
type: slave
19-
notify: False
22+
notify: false
2023
masters:
2124
- 192.0.2.1
2225
- 192.0.2.2
@@ -25,7 +28,7 @@ bind:
2528
notify: false
2629
100.51.198.in-addr.arpa:
2730
type: master
28-
notify: False
31+
notify: false
2932
available_zones:
3033
example.net:
3134
file: example.net
@@ -111,4 +114,3 @@ bind:
111114
net: 198.51.100.0/24
112115
for_zones:
113116
- example.net
114-

0 commit comments

Comments
 (0)