Skip to content

build: annotate markdown lint failures in pull requests - #32391

Closed
richardlau wants to merge 2 commits into
nodejs:masterfrom
richardlau:annotatemdlint
Closed

build: annotate markdown lint failures in pull requests#32391
richardlau wants to merge 2 commits into
nodejs:masterfrom
richardlau:annotatemdlint

Conversation

@richardlau

Copy link
Copy Markdown
Member

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.

Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers

Checklist

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 <riclau@uk.ibm.com>
@nodejs-github-botnodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Mar 20, 2020
@richardlau

Copy link
Copy Markdown
MemberAuthor

An example annotation:
image

Comment thread.github/workflows/remark-lint-problem-matcher.json Outdated

@TrottTrott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't pretend to have looked at those regular expressions carefully, but rubber-stamp LGTM.

Comment thread.github/workflows/remark-lint-problem-matcher.json

@gengjiawengengjiawen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any thought on doc the regexp ?

@mmarchinimmarchini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM (also love it, by far the simplest solution to annotate code I've seen).

One concern though: add-matcher doesn't seem to be documented (I would expect to see it here). Do you know if this is a stable API, or if there's any chance they'll pull it out in the near future?

@richardlau

Copy link
Copy Markdown
MemberAuthor

RSLGTM (also love it, by far the simplest solution to annotate code I've seen).

One concern though: add-matcher doesn't seem to be documented (I would expect to see it here). Do you know if this is a stable API, or if there's any chance they'll pull it out in the near future?

There’s no mention of problem matchers or annotations at all on that page (or any other help page for GitHub actions). The two referenced links are to the actions toolkit (https://github.com/actions/toolkit) where it’s documented. As to the stability of that your guess is as good as mine. If this does stop working it’s not the end of the world to lose the annotations — we would be back to where we are now without this PR.

Any thought on doc the regexp ?

What are you looking for? The regexps are trying to extract from the output of our markdown linting into the fields detailed in the first referenced link. Sample output to parse:

README.md
15:130 warning Line must be at most 80 characters maximum-line-length remark-lint
27:3-27:46 warning Marker style should be `*` unordered-list-marker-style remark-lint

richardlau added a commit that referenced this pull request Mar 24, 2020
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 <riclau@uk.ibm.com>
PR-URL: #32391
Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
@richardlau

Copy link
Copy Markdown
MemberAuthor

Landed in f467b9b.

@richardlau
richardlau deleted the annotatemdlint branch March 24, 2020 16:24
MylesBorins pushed a commit that referenced this pull request Mar 25, 2020
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 <riclau@uk.ibm.com>
PR-URL: #32391
Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
@MylesBorinsMylesBorins mentioned this pull request Mar 25, 2020
MylesBorins pushed a commit to MylesBorins/node that referenced this pull request Apr 2, 2020
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 <riclau@uk.ibm.com>
PR-URL: nodejs#32391
Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
MylesBorins pushed a commit that referenced this pull request Apr 2, 2020
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 <riclau@uk.ibm.com>
Backport-PR-URL: #32608
PR-URL: #32391
Refs: https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md
Refs: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
@codebyterecodebytere mentioned this pull request Apr 3, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metaIssues and PRs related to the general management of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@richardlau@Trott@addaleax@cjihrig@gengjiawen@mmarchini@BridgeAR@nodejs-github-bot