Add yamlint step to linting workflow

This commit is contained in:
Wiktor Niesiobędzki
2025-10-23 17:44:38 +00:00
parent bc31714f68
commit a61dc3cfdd
3 changed files with 73 additions and 62 deletions

View File

@@ -120,3 +120,6 @@ jobs:
id: duplicates id: duplicates
run: | run: |
python3 tools/duplicate-diff.py python3 tools/duplicate-diff.py
- name: yaml-lint
uses: ibiqlik/action-yamllint@b74a2626a991d676b6ec243a6458ff86cccf2d2d

View File

@@ -23,9 +23,6 @@ repos:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl - --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
files: ^modules/ files: ^modules/
exclude: (tests/fixtures/|tools/lockfile/|^fast) exclude: (tests/fixtures/|tools/lockfile/|^fast)
# - id: terraform_validate
# args:
# - --hook-config=--retry-once-with-cleanup=true
- repo: local - repo: local
hooks: hooks:
- id: cff-readme - id: cff-readme
@@ -33,17 +30,17 @@ repos:
entry: tools/pre-commit-tfdoc.sh entry: tools/pre-commit-tfdoc.sh
language: python language: python
additional_dependencies: additional_dependencies:
- click - click
- deepdiff - deepdiff
- ghapi - ghapi
- iso8601 - iso8601
- marko - marko
- requests - requests
- yamale - yamale
- yapf - yapf
- jsonschema - jsonschema
- BeautifulSoup4 - BeautifulSoup4
#types: [terraform] # types: [terraform]
files: ^(modules|fast).*(tf|README.md)$ files: ^(modules|fast).*(tf|README.md)$
pass_filenames: true pass_filenames: true
require_serial: true require_serial: true
@@ -52,34 +49,34 @@ repos:
language: python language: python
entry: tools/check_boilerplate.py entry: tools/check_boilerplate.py
additional_dependencies: additional_dependencies:
- click - click
- deepdiff - deepdiff
- ghapi - ghapi
- iso8601 - iso8601
- marko - marko
- requests - requests
- yamale - yamale
- yapf - yapf
- jsonschema - jsonschema
- BeautifulSoup4 - BeautifulSoup4
pass_filenames: true pass_filenames: true
args: args:
- --scan-files - --scan-files
- id: tflint-fast - id: tflint-fast
name: Checking FAST code with tflint name: Checking FAST code with tflint
entry: tools/tflint-fast.py entry: tools/tflint-fast.py
language: python language: python
additional_dependencies: additional_dependencies:
- click - click
- deepdiff - deepdiff
- ghapi - ghapi
- iso8601 - iso8601
- marko - marko
- requests - requests
- yamale - yamale
- yapf - yapf
- jsonschema - jsonschema
- BeautifulSoup4 - BeautifulSoup4
pass_filenames: false pass_filenames: false
require_serial: true require_serial: true
files: ^fast/.*tf files: ^fast/.*tf
@@ -99,16 +96,16 @@ repos:
name: Check name lengths for FAST name: Check name lengths for FAST
language: python language: python
additional_dependencies: additional_dependencies:
- click - click
- deepdiff - deepdiff
- ghapi - ghapi
- iso8601 - iso8601
- marko - marko
- requests - requests
- yamale - yamale
- yapf - yapf
- jsonschema - jsonschema
- BeautifulSoup4 - BeautifulSoup4
pass_filenames: false pass_filenames: false
files: ^fast files: ^fast
entry: tools/check_names.py --prefix-length=10 --failed-only fast/stages entry: tools/check_names.py --prefix-length=10 --failed-only fast/stages
@@ -116,16 +113,16 @@ repos:
name: Check links in markdown files name: Check links in markdown files
language: python language: python
additional_dependencies: additional_dependencies:
- click - click
- deepdiff - deepdiff
- ghapi - ghapi
- iso8601 - iso8601
- marko - marko
- requests - requests
- yamale - yamale
- yapf - yapf
- jsonschema - jsonschema
- BeautifulSoup4 - BeautifulSoup4
entry: tools/check_links.py --no-show-summary --scan-files entry: tools/check_links.py --no-show-summary --scan-files
- id: duplicate-diff - id: duplicate-diff
name: duplicate-diff name: duplicate-diff
@@ -136,13 +133,12 @@ repos:
pass_filenames: true pass_filenames: true
require_serial: true require_serial: true
- repo: https://github.com/adrienverge/yamllint
# - repo: https://github.com/adrienverge/yamllint rev: 79a6b2b1392eaf49cdd32ac4f14be1a809bbd8f7 # v1.37.0
# rev: v1.34.0 hooks:
# hooks: - id: yamllint
# - id: yamllint args: ["-c=.yamllint", "--no-warnings"]
# args: [-c=.yamllint, --no-warnings] exclude: (/templates/|modules/cloud-config-container/)
# exclude: (/templates/|modules/cloud-config-container/)
- repo: https://github.com/jumanjihouse/pre-commit-hooks - repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: "3.0.0" rev: "3.0.0"

View File

@@ -5,6 +5,12 @@ yaml-files:
- '*.yml' - '*.yml'
- '.yamllint' - '.yamllint'
## exclude
ignore: |
fast/stages/0-org-setup/assets/workflow-*.yaml
cloud-config.yaml
*-cloud-config.yaml
extends: default extends: default
rules: rules:
@@ -14,3 +20,9 @@ rules:
max: 120 max: 120
level: warning level: warning
braces: disable braces: disable
document-start: disable
empty-lines:
max: 2
max-start: 0
max-end: 1
comments-indentation: disable