Skip to content

Commit c5d27e1

Browse files
aduh95MylesBorins
authored andcommitted
tools,doc: enforce alphabetical order for md refs
PR-URL: #35244 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com>
1 parent 9d91842 commit c5d27e1

17 files changed

+51
-36
lines changed

doc/api/inspector.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ session.post('HeapProfiler.takeHeapSnapshot', null, (err, r) => {
239239
});
240240
```
241241

242-
[`'Debugger.paused'`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused
243-
[`session.connect()`]: #inspector_session_connect
244242
[CPU Profiler]: https://chromedevtools.github.io/devtools-protocol/v8/Profiler
245243
[Chrome DevTools Protocol Viewer]: https://chromedevtools.github.io/devtools-protocol/v8/
246244
[Heap Profiler]: https://chromedevtools.github.io/devtools-protocol/v8/HeapProfiler
245+
[`'Debugger.paused'`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused
246+
[`session.connect()`]: #inspector_session_connect

doc/api/punycode.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ added: v0.6.1
148148

149149
Returns a string identifying the current [Punycode.js][] version number.
150150

151-
[Punycode.js]: https://github.com/bestiejs/punycode.js
152151
[Punycode]: https://tools.ietf.org/html/rfc3492
152+
[Punycode.js]: https://github.com/bestiejs/punycode.js

doc/api/wasi.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,6 @@ added:
162162
should be passed as the `wasi_snapshot_preview1` import during the instantiation
163163
of a [`WebAssembly.Instance`][].
164164

165+
[WebAssembly System Interface]: https://wasi.dev/
165166
[`WebAssembly.Instance`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance
166167
[`WebAssembly.Memory`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory
167-
[WebAssembly System Interface]: https://wasi.dev/

doc/guides/backporting-to-release-lines.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ replace that with the staging branch for the targeted release line.
8989
After the pull request lands, replace the `backport-requested-v10.x` label
9090
on the original pull request with `backported-to-v10.x`.
9191

92-
[Release Schedule]: https://github.com/nodejs/Release#release-schedule1
9392
[Release Plan]: https://github.com/nodejs/Release#release-plan
93+
[Release Schedule]: https://github.com/nodejs/Release#release-schedule1
9494
[`node-test-pull-request`]: https://ci.nodejs.org/job/node-test-pull-request/build

doc/guides/collaborator-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -771,10 +771,10 @@ If you cannot find who to cc for a file, `git shortlog -n -s <file>` can help.
771771
[backporting guide]: backporting-to-release-lines.md
772772
[commit message guidelines]: contributing/pull-requests.md#commit-message-guidelines
773773
[commit-example]: https://github.com/nodejs/node/commit/b636ba8186
774+
[git-email]: https://help.github.com/articles/setting-your-commit-email-address-in-git/
774775
[git-node]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md
775776
[git-node-metadata]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-metadata
776777
[git-username]: https://help.github.com/articles/setting-your-username-in-git/
777-
[git-email]: https://help.github.com/articles/setting-your-commit-email-address-in-git/
778778
[node-core-utils-credentials]: https://github.com/nodejs/node-core-utils#setting-up-credentials
779779
[node-core-utils-issues]: https://github.com/nodejs/node-core-utils/issues
780780
[unreliable tests]: https://github.com/nodejs/node/issues?q=is%3Aopen+is%3Aissue+label%3A%22CI+%2F+flaky+test%22

doc/guides/contributing/pull-requests.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -593,15 +593,15 @@ widely used, so don't be discouraged!
593593
If you want to know more about the code review and the landing process, see the
594594
[Collaborator Guide][].
595595

596-
[approved]: #getting-approvals-for-your-pull-request
597-
[benchmark results]: ../writing-and-running-benchmarks.md
598596
[Building guide]: ../../../BUILDING.md
599597
[CI (Continuous Integration) test run]: #ci-testing
600598
[Code of Conduct]: https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md
601599
[Collaborator Guide]: ../collaborator-guide.md
600+
[IRC in the #node-dev channel]: https://webchat.freenode.net?channels=node-dev&uio=d4
601+
[Onboarding guide]: ../../../onboarding.md
602+
[approved]: #getting-approvals-for-your-pull-request
603+
[benchmark results]: ../writing-and-running-benchmarks.md
602604
[guide for writing tests in Node.js]: ../writing-tests.md
603605
[hiding-a-comment]: https://help.github.com/articles/managing-disruptive-comments/#hiding-a-comment
604606
[https://ci.nodejs.org/]: https://ci.nodejs.org/
605-
[IRC in the #node-dev channel]: https://webchat.freenode.net?channels=node-dev&uio=d4
606-
[Onboarding guide]: ../../../onboarding.md
607607
[running tests]: ../../../BUILDING.md#running-tests

doc/guides/cpp-style-guide.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,15 @@ Node.js is built [without C++ exception handling][], so code using `throw` or
392392
even `try` and `catch` **will** break.
393393

394394
[C++ Core Guidelines]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
395-
[Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html
396-
[Google’s `cpplint`]: https://github.com/google/styleguide
397-
[errors]: https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md
398395
[ES.47]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-nullptr
399396
[ES.48]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts
400397
[ES.49]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-casts-named
398+
[Google C++ Style Guide]: https://google.github.io/styleguide/cppguide.html
399+
[Google’s `cpplint`]: https://github.com/google/styleguide
401400
[R.20]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-owner
402401
[R.21]: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rr-unique
403402
[Run Time Type Information]: https://en.wikipedia.org/wiki/Run-time_type_information
403+
[aliased_buffer.h]: https://github.com/nodejs/node/blob/master/src/aliased_buffer.h#L12
404404
[cppref_auto_ptr]: https://en.cppreference.com/w/cpp/memory/auto_ptr
405+
[errors]: https://github.com/nodejs/node/blob/master/doc/guides/using-internal-errors.md
405406
[without C++ exception handling]: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_exceptions.html#intro.using.exception.no
406-
[aliased_buffer.h]: https://github.com/nodejs/node/blob/master/src/aliased_buffer.h#L12

doc/guides/maintaining-V8.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ This would require some tooling to:
415415
as their support has ended.
416416

417417
[ChromiumReleaseCalendar]: https://www.chromium.org/developers/calendar
418-
[Node.js `canary` branch]: https://github.com/nodejs/node-v8/tree/canary
419418
[Node.js CI]: https://ci.nodejs.org/job/node-test-pull-request/
419+
[Node.js `canary` branch]: https://github.com/nodejs/node-v8/tree/canary
420420
[NodeJS-Backport-Approved-Chromium]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Approved
421421
[NodeJS-Backport-Approved-V8]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Approved
422422
[NodeJS-Backport-Done-Chromium]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Done
@@ -425,10 +425,10 @@ as their support has ended.
425425
[NodeJS-Backport-Rejected-V8]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Rejected
426426
[NodeJS-Backport-Review-Chromium]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=label%3ANodeJS-Backport-Review
427427
[NodeJS-Backport-Review-V8]: https://bugs.chromium.org/p/v8/issues/list?can=1&q=label%3ANodeJS-Backport-Review
428-
[`git-node`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-v8
429428
[V8 CI]: https://ci.nodejs.org/job/node-test-commit-v8-linux/
430429
[V8ActiveBranches]: https://build.chromium.org/p/client.v8.branches/console
431430
[V8Contributing]: https://github.com/v8/v8/wiki/Contributing
432431
[V8MergingPatching]: https://github.com/v8/v8/wiki/Merging%20&%20Patching
433432
[V8TemplateMergeRequest]: https://bugs.chromium.org/p/v8/issues/entry?template=Node.js%20merge%20request
434433
[V8TemplateUpstreamBug]: https://bugs.chromium.org/p/v8/issues/entry?template=Node.js%20upstream%20bug
434+
[`git-node`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-v8

doc/guides/maintaining-icu.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ Node.js (see the top level README.md). Only modifying `icu-small` would cause
261261
the patch not to be landed in case the user specifies the ICU source code
262262
another way.
263263

264+
[CLDR]: https://unicode.org/cldr
265+
[Ecma402]: https://github.com/tc39/ecma402
264266
[ICU]: http://icu-project.org
265267
[Unicode]: https://unicode.org
266268
[tz]: https://www.iana.org/time-zones
267-
[CLDR]: https://unicode.org/cldr
268-
[Ecma402]: https://github.com/tc39/ecma402

doc/guides/releases.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -869,9 +869,9 @@ test, or doc-related are to be listed as notable changes. Some SEMVER-MINOR
869869
commits may be listed as notable changes on a case-by-case basis. Use your
870870
judgment there.
871871

872-
[CI lockdown procedure]: https://github.com/nodejs/build/blob/master/doc/jenkins-guide.md#restricting-access-for-security-releases
873872
[Build issue tracker]: https://github.com/nodejs/build/issues/new
873+
[CI lockdown procedure]: https://github.com/nodejs/build/blob/master/doc/jenkins-guide.md#restricting-access-for-security-releases
874+
[Partner Communities]: https://github.com/nodejs/community-committee/blob/master/governance/PARTNER_COMMUNITIES.md
874875
[nodejs.org release-post.js script]: https://github.com/nodejs/nodejs.org/blob/master/scripts/release-post.js
875876
[nodejs.org repository]: https://github.com/nodejs/nodejs.org
876-
[Partner Communities]: https://github.com/nodejs/community-committee/blob/master/governance/PARTNER_COMMUNITIES.md
877877
[webchat.freenode.net]: https://webchat.freenode.net/

doc/guides/writing-and-running-benchmarks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ Supported options keys are:
551551
benchmarker
552552

553553
[autocannon]: https://github.com/mcollina/autocannon
554-
[wrk]: https://github.com/wg/wrk
555-
[t-test]: https://en.wikipedia.org/wiki/Student%27s_t-test#Equal_or_unequal_sample_sizes.2C_unequal_variances
554+
[benchmark-ci]: https://github.com/nodejs/benchmarking/blob/master/docs/core_benchmarks.md
556555
[git-for-windows]: https://git-scm.com/download/win
557556
[nghttp2.org]: https://nghttp2.org
558-
[benchmark-ci]: https://github.com/nodejs/benchmarking/blob/master/docs/core_benchmarks.md
557+
[t-test]: https://en.wikipedia.org/wiki/Student%27s_t-test#Equal_or_unequal_sample_sizes.2C_unequal_variances
558+
[wrk]: https://github.com/wg/wrk

doc/guides/writing-tests.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ Nightly coverage reports for the Node.js master branch are available at
434434

435435
[ASCII]: https://man7.org/linux/man-pages/man7/ascii.7.html
436436
[Google Test]: https://github.com/google/googletest
437+
[Test Coverage section of the Building guide]: https://github.com/nodejs/node/blob/master/BUILDING.md#running-coverage
437438
[`common` module]: https://github.com/nodejs/node/blob/master/test/common/README.md
438439
[all maintained branches]: https://github.com/nodejs/lts
440+
[directory structure overview]: https://github.com/nodejs/node/blob/master/test/README.md#test-directories
439441
[node.green]: https://node.green/
440442
[test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests
441-
[Test Coverage section of the Building guide]: https://github.com/nodejs/node/blob/master/BUILDING.md#running-coverage
442-
[directory structure overview]: https://github.com/nodejs/node/blob/master/test/README.md#test-directories

onboarding.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ needs to be pointed out separately during the onboarding.
245245
the [summit](https://github.com/nodejs/summit) repository for details.
246246

247247
[Code of Conduct]: https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md
248+
[Landing Pull Requests]: doc/guides/collaborator-guide.md#landing-pull-requests
249+
[Publicizing or hiding organization membership]: https://help.github.com/articles/publicizing-or-hiding-organization-membership/
248250
[`author-ready`]: doc/guides/collaborator-guide.md#author-ready-pull-requests
249251
[`core-validate-commit`]: https://github.com/nodejs/core-validate-commit
250252
[`git-node`]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md
251253
[`node-core-utils`]: https://github.com/nodejs/node-core-utils
252-
[Landing Pull Requests]: doc/guides/collaborator-guide.md#landing-pull-requests
253-
[Publicizing or hiding organization membership]: https://help.github.com/articles/publicizing-or-hiding-organization-membership/
254254
[set up the credentials]: https://github.com/nodejs/node-core-utils#setting-up-credentials
255255
[two-factor authentication]: https://help.github.com/articles/securing-your-account-with-two-factor-authentication-2fa/
256256
[using a TOTP mobile app]: https://help.github.com/articles/configuring-two-factor-authentication-via-a-totp-mobile-app/

src/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -929,6 +929,10 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
929929
}
930930
```
931931
932+
[C++ coding style]: ../doc/guides/cpp-style-guide.md
933+
[Callback scopes]: #callback-scopes
934+
[JavaScript value handles]: #js-handles
935+
[N-API]: https://nodejs.org/api/n-api.html
932936
[`BaseObject`]: #baseobject
933937
[`Context`]: #context
934938
[`Environment`]: #environment
@@ -951,10 +955,6 @@ static void GetUserInfo(const FunctionCallbackInfo<Value>& args) {
951955
[`v8.h` in Node.js master]: https://github.com/nodejs/node/blob/master/deps/v8/include/v8.h
952956
[`v8.h` in V8 master]: https://github.com/v8/v8/blob/master/include/v8.h
953957
[`vm` module]: https://nodejs.org/api/vm.html
954-
[C++ coding style]: ../doc/guides/cpp-style-guide.md
955-
[Callback scopes]: #callback-scopes
956-
[JavaScript value handles]: #js-handles
957-
[N-API]: https://nodejs.org/api/n-api.html
958958
[binding function]: #binding-functions
959959
[cleanup hooks]: #cleanup-hooks
960960
[event loop]: #event-loop

test/wpt/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,5 @@ Web API, or certain harness has not been ported in our test runner yet.
164164
In that case it needs to be marked with `skip` instead of `fail`.
165165

166166
[Web Platform Tests]: https://github.com/web-platform-tests/wpt
167-
[git node wpt]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-wpt
168167
[`test/fixtures/wpt/README.md`]: ../fixtures/wpt/README.md
168+
[git node wpt]: https://github.com/nodejs/node-core-utils/blob/master/docs/git-node.md#git-node-wpt

tools/doc/checkLinks.js

+18-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ function findMarkdownFilesRecursively(dirPath) {
2727
if (
2828
entry.isDirectory() &&
2929
entry.name !== 'api' &&
30-
entry.name !== 'tmp' &&
31-
entry.name !== 'fixtures' &&
3230
entry.name !== 'changelogs' &&
3331
entry.name !== 'deps' &&
34-
entry.name !== 'node_modules'
32+
entry.name !== 'fixtures' &&
33+
entry.name !== 'node_modules' &&
34+
entry.name !== 'out' &&
35+
entry.name !== 'tmp'
3536
) {
3637
findMarkdownFilesRecursively(path);
3738
} else if (entry.isFile() && extname(entry.name) === '.md') {
@@ -46,6 +47,7 @@ function checkFile(path) {
4647
.parse(fs.readFileSync(path));
4748

4849
const base = pathToFileURL(path);
50+
let previousDefinitionLabel;
4951
for (const node of getLinksRecursively(tree)) {
5052
const targetURL = new URL(node.url, base);
5153
if (targetURL.protocol === 'file:' && !fs.existsSync(targetURL)) {
@@ -55,5 +57,18 @@ function checkFile(path) {
5557
`Broken link at ${path}:${line}:${column} (${node.url})`);
5658
process.exitCode = 1;
5759
}
60+
if (node.type === 'definition') {
61+
if (previousDefinitionLabel &&
62+
previousDefinitionLabel > node.label) {
63+
const { line, column } = node.position.start;
64+
console.error((process.env.GITHUB_ACTIONS ?
65+
`::error file=${path},line=${line},col=${column}::` : '') +
66+
`Unordered reference at ${path}:${line}:${column} (` +
67+
`"${node.label}" should be before "${previousDefinitionLabel})"`
68+
);
69+
process.exitCode = 1;
70+
}
71+
previousDefinitionLabel = node.label;
72+
}
5873
}
5974
}

tools/icu/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ information on maintaining ICU in Node.js
3333
internationalization-related APIs in Node.js
3434
* [The ICU Homepage][ICU]
3535

36-
[ICU data slicer]: https://github.com/unicode-org/icu/blob/master/docs/userguide/icu_data/buildtool.md
3736
[ICU]: http://icu-project.org
37+
[ICU data slicer]: https://github.com/unicode-org/icu/blob/master/docs/userguide/icu_data/buildtool.md

0 commit comments

Comments
 (0)