Skip to content

Commit

Permalink
feat(yamllint): add rule empty-values
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Sep 10, 2019
1 parent 7b11026 commit e25c1ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ssf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ ssf_node_anchors:
# An alternative method could be to use:
# `git describe --abbrev=0 --tags`
# yamllint disable-line rule:line-length
title: 'chore: use standard test pillar path'
body: '* Semi-automated using https://github.com/myii/ssf-formula/pull/28'
title: 'ci(yamllint): add rule `empty-values`'
body: '* Automated using https://github.com/myii/ssf-formula/pull/27'
github:
owner: saltstack-formulas
repo: ''
Expand Down Expand Up @@ -135,7 +135,9 @@ ssf_node_anchors:
# document-end: {}
# document-start: {}
# empty-lines: {}
# empty-values: {}
empty-values:
forbid-in-block-mappings: 'true'
forbid-in-flow-mappings: 'true'
# hyphens: {}
# indentation: {}
key-duplicates: {}
Expand Down
7 changes: 7 additions & 0 deletions ssf/files/default/.yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ rules:
{{- format_ignore(yl_ci) }}
{%- endif %}

{#- Don't need the `if` here since we're always providing a `empty-values` setting #}
empty-values:
{%- set yl_ev = yamllint.rules.get('empty-values') %}
{{- format_ignore(yl_ev) }}
forbid-in-block-mappings: {{ yamllint.rules.get('empty-values').get('forbid-in-block-mappings') }}
forbid-in-flow-mappings: {{ yamllint.rules.get('empty-values').get('forbid-in-flow-mappings') }}

{%- if yamllint.rules.get('key-duplicates') %}
key-duplicates:
{%- set yl_kd = yamllint.rules.get('key-duplicates') %}
Expand Down

0 comments on commit e25c1ef

Please sign in to comment.