From 1d9636e6e27eafd096916a1cda7eca7e5d302176 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 4 Oct 2019 17:24:25 +0100 Subject: [PATCH] feat(salt-lint): include for this repo --- pillar.example | 1 + ssf/config/formulas.sls | 1 + ssf/defaults.yaml | 6 ++++-- ssf/files/default/.salt-lint | 13 +++++++++++++ ssf/formulas.yaml | 5 +++++ 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 ssf/files/default/.salt-lint diff --git a/pillar.example b/pillar.example index 8b89e0d5..bcae88d7 100644 --- a/pillar.example +++ b/pillar.example @@ -127,6 +127,7 @@ ssf: - inspec/README.md - .gitignore - .cirrus.yml + - .salt-lint - .travis.yml - .yamllint - commitlint.config.js diff --git a/ssf/config/formulas.sls b/ssf/config/formulas.sls index b4ba1f31..f19ec14c 100644 --- a/ssf/config/formulas.sls +++ b/ssf/config/formulas.sls @@ -109,6 +109,7 @@ prepare-git-branch-for-{{ formula }}: platforms: {{ context.platforms | yaml }} platforms_matrix: {{ context.platforms_matrix | yaml }} platforms_matrix_commented_includes: {{ context.platforms_matrix_commented_includes | yaml }} + salt_lint: {{ context.salt_lint | yaml }} script_kitchen: {{ context.script_kitchen | yaml }} suite: {{ suite | yaml }} travis: {{ context.travis | yaml }} diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index 479eadd4..ab389c1b 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -22,8 +22,8 @@ ssf_node_anchors: # An alternative method could be to use: # `git describe --abbrev=0 --tags` # yamllint disable rule:line-length - title: 'feat(tofs): implementation for all file.managed' - body: '* Checked using https://github.com/myii/ssf-formula/pull/54' + title: 'ci: merge travis matrix, add `salt-lint` & `rubocop` to `lint` job' + body: '* Automated using https://github.com/myii/ssf-formula/pull/60' # yamllint enable rule:line-length github: owner: saltstack-formulas @@ -164,6 +164,7 @@ ssf_node_anchors: # To deal with excessive instances when mimicking `kitchen list -b` # If values are set, only use these as commented entries in the matrix platforms_matrix_commented_includes: [] + salt_lint: {} script_kitchen: bin: bin/kitchen cmd: verify @@ -187,6 +188,7 @@ ssf_node_anchors: default: - '*.yaml' - '*.yml' + - '.salt-lint' - '.yamllint' additional_ssf: - '*.example' diff --git a/ssf/files/default/.salt-lint b/ssf/files/default/.salt-lint new file mode 100644 index 00000000..a539954b --- /dev/null +++ b/ssf/files/default/.salt-lint @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +exclude_paths: [] +skip_list: + # Using `salt-lint` for linting other files as well, such as Jinja macros/templates + - 205 # Use ".sls" as a Salt State file extension + # Skipping `207` and `208` because `210` is sufficient, at least for the time-being + # I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755` + - 207 # File modes should always be encapsulated in quotation marks + - 208 # File modes should always contain a leading zero +tags: [] +verbosity: 1 diff --git a/ssf/formulas.yaml b/ssf/formulas.yaml index 632a4a3b..b8a615dc 100644 --- a/ssf/formulas.yaml +++ b/ssf/formulas.yaml @@ -181,6 +181,9 @@ ssf_node_anchors: .cirrus.yml: &file__--cirrus--yml <<: *file_default template: jinja + .salt-lint: &file__--salt-lint + <<: *file_default + template: jinja .travis.yml: &file__--travis--yml <<: *file_default template: jinja @@ -1256,6 +1259,7 @@ ssf: ignore: additional: - ssf/files/default/.cirrus.yml + - ssf/files/default/.salt-lint - ssf/files/default/.travis.yml - ssf/files/default/.yamllint - ssf/files/default/kitchen.yml @@ -1274,6 +1278,7 @@ ssf: docs/TOFS_pattern.rst: *file__docs__TOFS_pattern--rst formula/libtofs.jinja: *file__formula__libtofs--jinja .gitignore: *file__--gitignore + .salt-lint: *file__--salt-lint .travis.yml: *file__--travis--yml .yamllint: *file__--yamllint commitlint.config.js: *file__commitlint--config--js