From e88e4e92e0ba1a2c9df3cc1d1b57d4dc1191ecc4 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 1 Nov 2021 16:38:23 +0100 Subject: [PATCH] Add workflow to lint workflows --- .github/workflows/workflows-ci.yaml | 55 +++++++++++++++++++++++++ .mdlrc | 1 + .yamllint | 64 +++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 .github/workflows/workflows-ci.yaml create mode 100644 .mdlrc create mode 100644 .yamllint diff --git a/.github/workflows/workflows-ci.yaml b/.github/workflows/workflows-ci.yaml new file mode 100644 index 0000000..057947a --- /dev/null +++ b/.github/workflows/workflows-ci.yaml @@ -0,0 +1,55 @@ +--- +name: Workflows CI + +# yamllint disable-line rule:truthy +on: + push: + pull_request: + types: + - opened + - reopened + - synchronize + workflow_dispatch: + +jobs: + lint-markdown: + name: MarkdownLint + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out code from GitHub + uses: actions/checkout@v2.3.5 + - name: 🚀 Run mdl + uses: actionshub/markdownlint@2.0.2 + + lint-shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out code from GitHub + uses: actions/checkout@v2.3.5 + - name: 🚀 Run Shellcheck + uses: ludeeus/action-shellcheck@1.1.0 + env: + SHELLCHECK_OPTS: -s bash + + lint-yamllint: + name: YAMLLint + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out code from GitHub + uses: actions/checkout@v2.3.5 + - name: 🚀 Run YAMLLint + uses: frenck/action-yamllint@v1.1 + + lint-prettier: + name: Prettier + runs-on: ubuntu-latest + steps: + - name: ⤵️ Check out code from GitHub + uses: actions/checkout@v2.3.5 + - name: 🚀 Run Prettier + uses: creyD/prettier_action@v4.0 + with: + prettier_options: --write **/*.{json,js,md,yaml} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.mdlrc b/.mdlrc new file mode 100644 index 0000000..2b0128d --- /dev/null +++ b/.mdlrc @@ -0,0 +1 @@ +rules "~MD024" \ No newline at end of file diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..0a2a889 --- /dev/null +++ b/.yamllint @@ -0,0 +1,64 @@ +--- +rules: + braces: + level: error + min-spaces-inside: 0 + max-spaces-inside: 1 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: + level: error + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + colons: + level: error + max-spaces-before: 0 + max-spaces-after: 1 + commas: + level: error + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: + level: error + require-starting-space: true + min-spaces-from-content: 2 + comments-indentation: + level: error + document-end: + level: error + present: false + document-start: + level: error + present: true + empty-lines: + level: error + max: 1 + max-start: 0 + max-end: 1 + hyphens: + level: error + max-spaces-after: 1 + indentation: + level: error + spaces: 2 + indent-sequences: true + check-multi-line-strings: false + key-duplicates: + level: error + line-length: + level: warning + max: 120 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + new-line-at-end-of-file: + level: error + new-lines: + level: error + type: unix + trailing-spaces: + level: error + truthy: + level: error