Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: implement markdown formatting #40181

Merged
merged 2 commits into from
Sep 25, 2021
Merged

tools: implement markdown formatting #40181

merged 2 commits into from
Sep 25, 2021

Conversation

Trott
Copy link
Member

@Trott Trott commented Sep 22, 2021

Markdown formatter is now available via mark format-md (orvcbuild format-md on Windows).

This PR depends on #40180 which is the first (large) commit in this PR. To see the relevant part, view the diff for the remaining commits only. The first commit will go away when 40180 lands. (40180 has landed so the paragraph crossed out here is no longer relevant.)

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Sep 22, 2021
@Trott
Copy link
Member Author

Trott commented Sep 22, 2021

Although the goal is to eventually document this feature and get it into workflows in general, for right now, I'd prefer to keep it as a feature that only people experienced with the project use. It's easy to get into a situation where the formatter is giving you markdown that the linter will not accept and the resolution is sometimes not obvious. Also, as of this moment, if you remove .mdlinttimestamp and run the formatter, it will format everything and make a ton of changes. When that is no longer the case (probably because those changes will have been submitted to the code base--can't do it automatically though because some changes, such as to README.md, require changes in ncu and other tools), then advertising the formatter more widely may be a good idea.

Makefile Outdated Show resolved Hide resolved
tools/lint-md/lint-md.src.mjs Outdated Show resolved Hide resolved
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 23, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 23, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

Largely rubber-stamp lgtm

@Trott Trott added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Sep 25, 2021
@github-actions github-actions bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 25, 2021
@github-actions
Copy link
Contributor

Commit Queue failed
- Loading data for nodejs/node/pull/40181
✔  Done loading data for nodejs/node/pull/40181
----------------------------------- PR info ------------------------------------
Title      tools: implement markdown formatting (#40181)
Author     Rich Trott  (@Trott)
Branch     Trott:md-formatter -> nodejs:master
Labels     windows, build, meta, tools, author ready, needs-ci
Commits    2
 - tools: implement markdown formatting
 - tools: fix lint-md autolinking
Committers 1
 - Rich Trott 
PR-URL: https://github.com/nodejs/node/pull/40181
Reviewed-By: James M Snell 
Reviewed-By: Daijiro Wachi 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/40181
Reviewed-By: James M Snell 
Reviewed-By: Daijiro Wachi 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last review:
   ⚠  - tools: implement markdown formatting
   ⚠  - tools: fix lint-md autolinking
   ℹ  This PR was created on Wed, 22 Sep 2021 20:55:54 GMT
   ✔  Approvals: 2
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/40181#pullrequestreview-762097873
   ✔  - Daijiro Wachi (@watilde): https://github.com/nodejs/node/pull/40181#pullrequestreview-762796964
   ✔  Last GitHub Actions successful
   ℹ  Last Full PR CI on 2021-09-23T14:03:41Z: https://ci.nodejs.org/job/node-test-pull-request/40047/
   ⚠  Commits were pushed after the last Full PR CI run:
   ⚠  - tools: implement markdown formatting
   ⚠  - tools: fix lint-md autolinking
- Querying data for job/node-test-pull-request/40047/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/1273387386

@github-actions github-actions bot added the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Sep 25, 2021
Markdown formatter is now available via `mark format-md` (or
`vcbuild format-md` on Windows).

PR-URL: nodejs#40181
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Update a transitive dependency in lint-md to fix an autolink bug in the
formatter that causes a lot of our files (particularly changelogs) to be
misformatted when run through the automatic formatter.

Refs: syntax-tree/mdast-util-gfm-autolink-literal@7555d45

PR-URL: nodejs#40181
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
@Trott
Copy link
Member Author

Trott commented Sep 25, 2021

Landed in b0ef080...85811d1

@Trott Trott merged commit 85811d1 into nodejs:master Sep 25, 2021
@Trott Trott deleted the md-formatter branch September 25, 2021 17:24
targos pushed a commit that referenced this pull request Oct 4, 2021
Markdown formatter is now available via `mark format-md` (or
`vcbuild format-md` on Windows).

PR-URL: #40181
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
targos pushed a commit that referenced this pull request Oct 4, 2021
Update a transitive dependency in lint-md to fix an autolink bug in the
formatter that causes a lot of our files (particularly changelogs) to be
misformatted when run through the automatic formatter.

Refs: syntax-tree/mdast-util-gfm-autolink-literal@7555d45

PR-URL: #40181
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. build Issues and PRs related to build files or the CI. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants