Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(yamllint): update ignored paths and add octal-values #59

Merged
merged 2 commits into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ssf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ssf_node_anchors:
# An alternative method could be to use:
# `git describe --abbrev=0 --tags`
# yamllint disable rule:line-length
title: 'chore(issues): update `Bug report` & `Feature request` templates [skip ci]'
body: '* Automated using https://github.com/myii/ssf-formula/pull/58'
title: 'chore(yamllint): update ignored paths and add `octal-values` [skip ci]'
body: '* Automated using https://github.com/myii/ssf-formula/pull/59'
# yamllint enable rule:line-length
github:
owner: saltstack-formulas
Expand Down Expand Up @@ -176,6 +176,7 @@ ssf_node_anchors:
- 'node_modules/'
additional_ssf:
- 'test/**/states/**/*.sls'
- '.kitchen/'
additional: []
yaml-files:
default:
Expand Down Expand Up @@ -211,7 +212,9 @@ ssf_node_anchors:
max: 88
# new-line-at-end-of-file: {}
# new-lines: {}
# octal-values: {}
octal-values:
forbid-implicit-octal: 'true'
forbid-explicit-octal: 'true'
# quoted-strings: {}
# trailing-spaces: {}
# truthy: {}
Expand Down
14 changes: 11 additions & 3 deletions ssf/files/default/.yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ extends: {{ yamllint.extends }}
# Files to ignore completely
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
# 2. Any SLS files under directory `test/`, which are actually state files
# 3. Any YAML files under directory `.kitchen/`, introduced during local testing
{%- if semrel_formula == 'ssf' %}
# 3. All Jinja templates under `ssf/files/` (result in `yamllint` syntax errors)
# 4. All Jinja templates under `ssf/files/` (result in `yamllint` syntax errors)
# Not disabling via. `*.yml` since we may end up with non-Jinja YAML files here
{%- elif semrel_formula == 'mysql' %}
# 3. Any YAML files using Jinja (result in `yamllint` syntax errors)
# 4. Any YAML files using Jinja (result in `yamllint` syntax errors)
{%- elif semrel_formula in ['postgres', 'salt'] %}
# 3. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
# 4. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
{%- endif %}
{%- set yl_ignores = {'ignore':
yamllint.ignore.default +
Expand Down Expand Up @@ -83,3 +84,10 @@ rules:
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)
{%- endif %}
max: {{ yamllint.rules.get('line-length').max }}

{#- Don't need the `if` here since we're always providing a `octal-values` setting #}
octal-values:
{%- set yl_ov = yamllint.rules.get('octal-values') %}
{{- format_ignore(yl_ov) }}
forbid-implicit-octal: {{ yamllint.rules.get('octal-values').get('forbid-implicit-octal') }}
forbid-explicit-octal: {{ yamllint.rules.get('octal-values').get('forbid-explicit-octal') }}