Skip to content

Commit f458f58

Browse files
authored
Merge pull request #121 from myii/chore/standardise-structure
ci(yamllint): add rule `empty-values` & use new `yaml-files` setting
2 parents ab87ffd + a437b3b commit f458f58

File tree

4 files changed

+41
-27
lines changed

4 files changed

+41
-27
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ jobs:
5656
before_install: skip
5757
script:
5858
# Install and run `yamllint`
59-
- pip install --user yamllint
60-
# yamllint disable-line rule:line-length
61-
- yamllint -s . .yamllint pillar.example test/salt/pillar/default.sls
59+
# Need at least `v1.17.0` for the `yaml-files` setting
60+
- pip install --user yamllint>=1.17.0
61+
- yamllint -s .
6262
# Install and run `commitlint`
6363
- npm install @commitlint/config-conventional -D
6464
- npm install @commitlint/travis-cli -D

.yamllint

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,24 @@ extends: default
66

77
# Files to ignore completely
88
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
9+
# 2. Any SLS files under directory `test/`, which are actually state files
910
ignore: |
1011
node_modules/
12+
test/**/states/**/*.sls
13+
14+
yaml-files:
15+
# Default settings
16+
- '*.yaml'
17+
- '*.yml'
18+
- .yamllint
19+
# SaltStack Formulas additional settings
20+
- '*.example'
21+
- test/**/*.sls
1122

1223
rules:
24+
empty-values:
25+
forbid-in-block-mappings: true
26+
forbid-in-flow-mappings: true
1327
line-length:
1428
# Increase from default of `80`
1529
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)

openvpn/defaults.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ openvpn:
1111
external_repo_version: stable
1212
group: nobody
1313
# None, will default to 'user'
14-
log_user:
14+
log_user: ~
1515
multi_services: false
1616
pkgs: ['openvpn']
1717
service: openvpn

pillar.example

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ openvpn:
7878
ping: 10
7979
ping_restart: 30
8080
ping_exit: 60
81-
print-timer-rem:
81+
print-timer-rem: ~
8282
dev: tun
83-
dev_node:
83+
dev_node: ~
8484
ca: /path/to/mycacert.pem
8585
ca_content: |
8686
-----BEGIN CERTIFICATE-----
@@ -111,17 +111,17 @@ openvpn:
111111
# dh: dh2048.pem
112112
server: '10.8.0.0 255.255.255.0'
113113
ifconfig_pool_persist: ipp.txt
114-
server_bridge:
114+
server_bridge: ~
115115
push:
116116
- "route 192.168.10.0 255.255.255.0"
117-
route_nopull:
117+
route_nopull: ~
118118
route:
119119
- "192.168.11.0 255.255.255.0"
120120
client_config_dir: clients
121121
client_config:
122122
client1: |
123123
iroute 192.168.10.0 255.255.255.0
124-
learn_address:
124+
learn_address: ~
125125
client_to_client: false
126126
duplicate_cn: false
127127
keepalive: '10 120'
@@ -148,8 +148,8 @@ openvpn:
148148
user: nobody
149149
group: nobody
150150
tun_mtu: 1350
151-
persist_key:
152-
persist_tun:
151+
persist_key: ~
152+
persist_tun: ~
153153
status: openvpn-status.log
154154
log: openvpn.log
155155
log_append: openvpn.log
@@ -163,13 +163,13 @@ openvpn:
163163
# or, a lifetime in seconds:
164164
# auth_gen_token: 604800
165165
myserver3:
166-
daemon:
166+
daemon: ~
167167
port: 443
168168
port_share: '127.0.0.1 4430'
169-
ccd_exclusive:
169+
ccd_exclusive: ~
170170
auths:
171171
- SHA384
172-
username_as_common_name:
172+
username_as_common_name: ~
173173
plugins:
174174
- '/usr/lib/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf'
175175
mysitetosite1:
@@ -209,23 +209,23 @@ openvpn:
209209
cert: /path/to/mycert.pem
210210
key: /path/to/mykey.pem
211211
myclient2:
212-
client:
212+
client: ~
213213
dev: tun
214-
dev_node:
214+
dev_node: ~
215215
proto: udp
216216
remote:
217217
- 'my-server-1 1194'
218218
- 'my-server-2 1194'
219-
remote_random:
220-
resolv_retry infinite:
221-
nobind:
219+
remote_random: ~
220+
resolv_retry: infinite
221+
nobind: ~
222222
user: nobody
223223
group: nobody
224-
persist_key:
225-
persist_tun:
226-
http_proxy_retry:
224+
persist_key: ~
225+
persist_tun: ~
226+
http_proxy_retry: ~
227227
http_proxy: 'proxy-server proxy-port'
228-
mute_replay_warnings:
228+
mute_replay_warnings: ~
229229
ca: /path/to/mycacert.pem
230230
# The following two commented options are examples for Windows
231231
# dev_node: ovpn-myclient2
@@ -282,9 +282,9 @@ openvpn:
282282
auth_user_pass_content: |
283283
user
284284
password
285-
fast_io:
286-
pull:
287-
tls-client:
285+
fast_io: ~
286+
pull: ~
287+
tls-client: ~
288288
key-direction: 1
289289
route-method: exe
290290
route-delay: 2
@@ -293,7 +293,7 @@ openvpn:
293293
keysize: 256
294294
sndbuf: 524288
295295
rcvbuf: 524288
296-
route_nopull:
296+
route_nopull: ~
297297
route:
298298
- "8.8.8.8 255.255.255.255 net_gateway"
299299
myclient3:

0 commit comments

Comments
 (0)