From a93fba6ee30899a792c0d06c627dd9da41871a38 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 20 Mar 2020 07:49:34 -0400 Subject: [PATCH 1/2] build: annotate markdown lint failures in pull requests Add a problem matcher for output from remark-lint to our lint-md GitHub Actions CI workflow so that any markdown linter failures are annotated in the pull request in the web UI. Signed-off-by: Richard Lau --- .github/workflows/CI.yml | 4 +++- .../remark-lint-problem-matcher.json | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/remark-lint-problem-matcher.json diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 356a9f990e4290..f5b6281149c0fb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -64,7 +64,9 @@ jobs: with: node-version: 10.x - name: Lint docs - run: NODE=$(which node) make lint-md + run: | + echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" + NODE=$(which node) make lint-md lint-js: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/remark-lint-problem-matcher.json b/.github/workflows/remark-lint-problem-matcher.json new file mode 100644 index 00000000000000..5baa5accfec66a --- /dev/null +++ b/.github/workflows/remark-lint-problem-matcher.json @@ -0,0 +1,23 @@ +{ + "problemMatcher": [ + { + "owner": "remark-lint", + "pattern": [ + { + // Filename may be decorated by ANSI escape sequences + "regexp": "^(?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)*$", + "file": 1 + }, + { + "regexp": "^\\s+(?:\\d+:\\d+-)?(\\d+):(\\d+)\\s+\\S*(error|warning|info)\\S*\\s+(.+)\\s+(\\S+)\\s+(?:\\S+)$", + "line": 1, + "column": 2, + "severity": 3, + "message": 4, + "code": 5, + "loop": true + } + ] + } + ] +} From 79dc0adadd702d7584d0e0ed99932c5e844f4b8c Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 20 Mar 2020 14:06:10 +0000 Subject: [PATCH 2/2] fixup! build: annotate markdown lint failures in pull requests --- .github/workflows/remark-lint-problem-matcher.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/remark-lint-problem-matcher.json b/.github/workflows/remark-lint-problem-matcher.json index 5baa5accfec66a..cfb281310a9a0f 100644 --- a/.github/workflows/remark-lint-problem-matcher.json +++ b/.github/workflows/remark-lint-problem-matcher.json @@ -4,7 +4,6 @@ "owner": "remark-lint", "pattern": [ { - // Filename may be decorated by ANSI escape sequences "regexp": "^(?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)*$", "file": 1 },