From a61dc3cfddd07cf91af5982dbf90f85260c13393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Thu, 23 Oct 2025 17:44:38 +0000 Subject: [PATCH] Add yamlint step to linting workflow --- .github/workflows/linting.yml | 3 + .pre-commit-config.yaml | 120 ++++++++++++++++------------------ .yamllint | 12 ++++ 3 files changed, 73 insertions(+), 62 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index ab892e7d8..dac5aad88 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -120,3 +120,6 @@ jobs: id: duplicates run: | python3 tools/duplicate-diff.py + + - name: yaml-lint + uses: ibiqlik/action-yamllint@b74a2626a991d676b6ec243a6458ff86cccf2d2d diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c381d3d15..96f226cb3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,9 +23,6 @@ repos: - --args=--config=__GIT_WORKING_DIR__/.tflint.hcl files: ^modules/ exclude: (tests/fixtures/|tools/lockfile/|^fast) - # - id: terraform_validate - # args: - # - --hook-config=--retry-once-with-cleanup=true - repo: local hooks: - id: cff-readme @@ -33,17 +30,17 @@ repos: entry: tools/pre-commit-tfdoc.sh language: python additional_dependencies: - - click - - deepdiff - - ghapi - - iso8601 - - marko - - requests - - yamale - - yapf - - jsonschema - - BeautifulSoup4 - #types: [terraform] + - click + - deepdiff + - ghapi + - iso8601 + - marko + - requests + - yamale + - yapf + - jsonschema + - BeautifulSoup4 + # types: [terraform] files: ^(modules|fast).*(tf|README.md)$ pass_filenames: true require_serial: true @@ -52,34 +49,34 @@ repos: language: python entry: tools/check_boilerplate.py additional_dependencies: - - click - - deepdiff - - ghapi - - iso8601 - - marko - - requests - - yamale - - yapf - - jsonschema - - BeautifulSoup4 + - click + - deepdiff + - ghapi + - iso8601 + - marko + - requests + - yamale + - yapf + - jsonschema + - BeautifulSoup4 pass_filenames: true args: - - --scan-files + - --scan-files - id: tflint-fast name: Checking FAST code with tflint entry: tools/tflint-fast.py language: python additional_dependencies: - - click - - deepdiff - - ghapi - - iso8601 - - marko - - requests - - yamale - - yapf - - jsonschema - - BeautifulSoup4 + - click + - deepdiff + - ghapi + - iso8601 + - marko + - requests + - yamale + - yapf + - jsonschema + - BeautifulSoup4 pass_filenames: false require_serial: true files: ^fast/.*tf @@ -99,16 +96,16 @@ repos: name: Check name lengths for FAST language: python additional_dependencies: - - click - - deepdiff - - ghapi - - iso8601 - - marko - - requests - - yamale - - yapf - - jsonschema - - BeautifulSoup4 + - click + - deepdiff + - ghapi + - iso8601 + - marko + - requests + - yamale + - yapf + - jsonschema + - BeautifulSoup4 pass_filenames: false files: ^fast entry: tools/check_names.py --prefix-length=10 --failed-only fast/stages @@ -116,16 +113,16 @@ repos: name: Check links in markdown files language: python additional_dependencies: - - click - - deepdiff - - ghapi - - iso8601 - - marko - - requests - - yamale - - yapf - - jsonschema - - BeautifulSoup4 + - click + - deepdiff + - ghapi + - iso8601 + - marko + - requests + - yamale + - yapf + - jsonschema + - BeautifulSoup4 entry: tools/check_links.py --no-show-summary --scan-files - id: duplicate-diff name: duplicate-diff @@ -136,13 +133,12 @@ repos: pass_filenames: true require_serial: true - -# - repo: https://github.com/adrienverge/yamllint -# rev: v1.34.0 -# hooks: -# - id: yamllint -# args: [-c=.yamllint, --no-warnings] -# exclude: (/templates/|modules/cloud-config-container/) +- repo: https://github.com/adrienverge/yamllint + rev: 79a6b2b1392eaf49cdd32ac4f14be1a809bbd8f7 # v1.37.0 + hooks: + - id: yamllint + args: ["-c=.yamllint", "--no-warnings"] + exclude: (/templates/|modules/cloud-config-container/) - repo: https://github.com/jumanjihouse/pre-commit-hooks rev: "3.0.0" diff --git a/.yamllint b/.yamllint index e5f87654f..6534a464b 100644 --- a/.yamllint +++ b/.yamllint @@ -5,6 +5,12 @@ yaml-files: - '*.yml' - '.yamllint' +## exclude +ignore: | + fast/stages/0-org-setup/assets/workflow-*.yaml + cloud-config.yaml + *-cloud-config.yaml + extends: default rules: @@ -14,3 +20,9 @@ rules: max: 120 level: warning braces: disable + document-start: disable + empty-lines: + max: 2 + max-start: 0 + max-end: 1 + comments-indentation: disable