From f2cdea2f2b84155c97a9edf39c2daa00302993fc Mon Sep 17 00:00:00 2001 From: Ben Christianson Date: Thu, 14 Mar 2024 13:20:13 -0500 Subject: [PATCH] Set up linter checks --- .github/workflows/lint.yaml | 56 +++++++++++++++++++++++++++++++++++++ .markdownlint.json | 6 ++++ .markdownlintignore | 4 +++ .yamllint.yaml | 16 +++++++++++ package.json | 1 + 5 files changed, 83 insertions(+) create mode 100644 .github/workflows/lint.yaml create mode 100644 .markdownlint.json create mode 100644 .markdownlintignore create mode 100644 .yamllint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..4f95ff9 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,56 @@ +--- +name: "Lint" +on: + push: + workflow_call: +jobs: + eslint: + name: "Run eslint" + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - uses: "actions/setup-node@v4" + with: + node-version: "lts/iron" + cache: "npm" + - name: "Install Dependencies" + run: "npm ci" + - name: "Run eslint" + run: "npm run lint:ts" + prettier: + name: "Run Prettier" + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - uses: "actions/setup-node@v4" + with: + node-version: "lts/iron" + cache: "npm" + - name: "Install Dependencies" + run: "npm ci" + - name: "Run prettier" + run: "npm run prettier" + markdownlint: + name: "Run Markdownlint" + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v4" + - uses: "actions/setup-node@v4" + with: + node-version: "lts/iron" + cache: "npm" + - name: "Install Dependencies" + run: "npm ci" + - name: "Run markdownlint" + run: "npm run mdl" + yaml: + name: "Lint YAML" + runs-on: "ubuntu-latest" + container: + image: "alpine:latest" + steps: + - uses: "actions/checkout@v4" + - name: "Install yamllint" + run: "apk add yamllint" + - name: "Run yamllint" + run: "yamllint -s ." diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..1215192 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,6 @@ +{ + "line-length": { + "code_blocks": false, + "tables": false + } +} diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 0000000..3329d7e --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1,4 @@ +/node_modules +/target +/sounds +/LICENSE.md diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..6699ed6 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,16 @@ +--- +extends: "default" +ignore: + - "/node_modules" + - "/target" + - "/sounds" +rules: + truthy: + check-keys: false + line-length: + max: 120 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + quoted-strings: + quote-type: "double" + required: true diff --git a/package.json b/package.json index 777a0b9..8a12975 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "prettier": "prettier --check .", "lint": "npm run lint:ts && npm run prettier", "format": "prettier --write .", + "mdl": "markdownlint .", "test": "mocha" }, "repository": {