From 6ff3bb03b95e6421b07dd1fa9c14c5387c7f30aa Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Tue, 20 Aug 2024 11:06:03 -0500 Subject: [PATCH] Switch markdownlint GH action to use super-linter (#4567) --- .github/linters/.markdown-lint.yml | 5 +++ .github/workflows/lint-code-base.yml | 31 +++++++++++++++++++ .../markdownlint-problem-matcher.json | 17 ---------- .github/workflows/markdownlint.yml | 29 ----------------- .markdownlint.json | 9 ------ 5 files changed, 36 insertions(+), 55 deletions(-) create mode 100644 .github/linters/.markdown-lint.yml create mode 100644 .github/workflows/lint-code-base.yml delete mode 100644 .github/workflows/markdownlint-problem-matcher.json delete mode 100644 .github/workflows/markdownlint.yml delete mode 100644 .markdownlint.json diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml new file mode 100644 index 0000000000..767b122e56 --- /dev/null +++ b/.github/linters/.markdown-lint.yml @@ -0,0 +1,5 @@ +default: true +MD013: # line length + code_block_line_length: 256 + heading_line_length: 96 +MD033: false # no inline HTML diff --git a/.github/workflows/lint-code-base.yml b/.github/workflows/lint-code-base.yml new file mode 100644 index 0000000000..779a667ec2 --- /dev/null +++ b/.github/workflows/lint-code-base.yml @@ -0,0 +1,31 @@ +name: Lint Code Base + +on: + pull_request: null + +permissions: {} + +jobs: + run-lint: + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + - name: Lint Code Base + uses: github/super-linter@v6 # https://github.com/github/super-linter + env: + DEFAULT_BRANCH: main + FILTER_REGEX_EXCLUDE: eng/common/.*|eng/readme-templates/.* + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: false + VALIDATE_MARKDOWN: true diff --git a/.github/workflows/markdownlint-problem-matcher.json b/.github/workflows/markdownlint-problem-matcher.json deleted file mode 100644 index f0741f6b90..0000000000 --- a/.github/workflows/markdownlint-problem-matcher.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "markdownlint", - "pattern": [ - { - "regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$", - "file": 1, - "line": 2, - "column": 3, - "code": 4, - "message": 5 - } - ] - } - ] -} diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml deleted file mode 100644 index 5fbfec943e..0000000000 --- a/.github/workflows/markdownlint.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: markdownlint - -permissions: - contents: read - -on: - pull_request: - paths: - - "**/*.md" - - ".markdownlint.json" - - ".github/workflows/markdownlint.yml" - - ".github/workflows/markdownlint-problem-matcher.json" - -jobs: - lint: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Run Markdownlint - run: | - echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" - npm i -g markdownlint-cli - markdownlint "**/*.md" diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index cd8da2c680..0000000000 --- a/.markdownlint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "default": true, - // line length - "MD013": { - "code_block_line_length": 256, - "heading_line_length": 96 - }, - "MD033": false, // no inline HTML -}