Skip to content

Commit 29bf363

Browse files
authored
Merge pull request #59 from myii/feat/update-yamllint-config
feat(yamllint): update ignored paths and add `octal-values`
2 parents 6f17c4c + 929ce19 commit 29bf363

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

ssf/defaults.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ ssf_node_anchors:
1717
# An alternative method could be to use:
1818
# `git describe --abbrev=0 --tags`
1919
# yamllint disable rule:line-length
20-
title: 'chore(issues): update `Bug report` & `Feature request` templates [skip ci]'
21-
body: '* Automated using https://github.com/myii/ssf-formula/pull/58'
20+
title: 'chore(yamllint): update ignored paths and add `octal-values` [skip ci]'
21+
body: '* Automated using https://github.com/myii/ssf-formula/pull/59'
2222
# yamllint enable rule:line-length
2323
github:
2424
owner: saltstack-formulas
@@ -176,6 +176,7 @@ ssf_node_anchors:
176176
- 'node_modules/'
177177
additional_ssf:
178178
- 'test/**/states/**/*.sls'
179+
- '.kitchen/'
179180
additional: []
180181
yaml-files:
181182
default:
@@ -211,7 +212,9 @@ ssf_node_anchors:
211212
max: 88
212213
# new-line-at-end-of-file: {}
213214
# new-lines: {}
214-
# octal-values: {}
215+
octal-values:
216+
forbid-implicit-octal: 'true'
217+
forbid-explicit-octal: 'true'
215218
# quoted-strings: {}
216219
# trailing-spaces: {}
217220
# truthy: {}

ssf/files/default/.yamllint

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ extends: {{ yamllint.extends }}
1717
# Files to ignore completely
1818
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
1919
# 2. Any SLS files under directory `test/`, which are actually state files
20+
# 3. Any YAML files under directory `.kitchen/`, introduced during local testing
2021
{%- if semrel_formula == 'ssf' %}
21-
# 3. All Jinja templates under `ssf/files/` (result in `yamllint` syntax errors)
22+
# 4. All Jinja templates under `ssf/files/` (result in `yamllint` syntax errors)
2223
# Not disabling via. `*.yml` since we may end up with non-Jinja YAML files here
2324
{%- elif semrel_formula == 'mysql' %}
24-
# 3. Any YAML files using Jinja (result in `yamllint` syntax errors)
25+
# 4. Any YAML files using Jinja (result in `yamllint` syntax errors)
2526
{%- elif semrel_formula in ['postgres', 'salt'] %}
26-
# 3. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
27+
# 4. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
2728
{%- endif %}
2829
{%- set yl_ignores = {'ignore':
2930
yamllint.ignore.default +
@@ -83,3 +84,10 @@ rules:
8384
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
8485
{%- endif %}
8586
max: {{ yamllint.rules.get('line-length').max }}
87+
88+
{#- Don't need the `if` here since we're always providing a `octal-values` setting #}
89+
octal-values:
90+
{%- set yl_ov = yamllint.rules.get('octal-values') %}
91+
{{- format_ignore(yl_ov) }}
92+
forbid-implicit-octal: {{ yamllint.rules.get('octal-values').get('forbid-implicit-octal') }}
93+
forbid-explicit-octal: {{ yamllint.rules.get('octal-values').get('forbid-explicit-octal') }}

0 commit comments

Comments
 (0)