From 929ce195496e42d4242f53a78abdfe6b63a25f43 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 7 Oct 2019 17:20:20 +0100 Subject: [PATCH] feat(yamllint): add explicit settings for `octal-values` * https://github.com/adrienverge/yamllint/issues/204 --- ssf/defaults.yaml | 8 +++++--- ssf/files/default/.yamllint | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index 21c87e21..dcbe01b0 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -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 @@ -212,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: {} diff --git a/ssf/files/default/.yamllint b/ssf/files/default/.yamllint index 68ce8411..43c3f664 100644 --- a/ssf/files/default/.yamllint +++ b/ssf/files/default/.yamllint @@ -84,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') }}