Skip to content

build: separate lint task package READMEs and /docs .md files#11139

Open
batpigandme wants to merge 5 commits intostdlib-js:developfrom
batpigandme:docs-remarkconfig
Open

build: separate lint task package READMEs and /docs .md files#11139
batpigandme wants to merge 5 commits intostdlib-js:developfrom
batpigandme:docs-remarkconfig

Conversation

@batpigandme
Copy link
Copy Markdown
Member

@batpigandme batpigandme commented Mar 25, 2026

Dedicated Remark configuration for Markdown files in package directories and the docs directory and update the pre-commit hook to run separate linting tasks for package and non-package files.

Assisted-by: Calude-Opus-4-6


type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown status: na
  • task: lint_package_json status: na
  • task: lint_repl_help status: na
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: na
  • task: lint_javascript_tests status: na
  • task: lint_javascript_benchmarks status: na
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: na
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: missing_dependencies
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: na
  • task: lint_license_headers status: passed ---

Resolves #11121

Description

What is the purpose of this pull request?

This pull request:

This PR adds separate remark lint configurations for package READMEs, /docs Markdown files, and general Markdown files. Previously, all Markdown files were linted with the same remark config, which meant rules specific to package READMEs (like remark-lint-expected-html-sections and remark-lint-html-section-structure) were applied to files where they don't belong (e.g., files in /docs).

Remark configurations:

  • .remarkrc.js — default config for general Markdown files (no HTML section rules)
  • .remarkrc.pkg-readmes.js — package READMEs (includes HTML section rules)
  • .remarkrc.docs.js — documentation files (no HTML section rules, separate for future customization)

New Make targets:

Linting:

  • make lint-markdown-package-readmes — lint all package READMEs
  • make lint-markdown-package-readme-files FILES='...' — lint a specified list of package READMEs
  • make lint-markdown-docs — lint all documentation Markdown files
  • make lint-markdown-docs-files FILES='...' — lint a specified list of documentation files
  • make lint-markdown / make lint-markdown-files — lint general Markdown (unchanged targets, now uses default config)

Listing:

  • make list-markdown-pkg-readmes — list all package README files (now defined in ls/markdown/pkg_readmes.mk
  • make list-markdown-docs — list all documentation Markdown files (now defined in ls/markdown/docs.mk

All targets support filter patterns, e.g.:

make lint-markdown-package-readmes MARKDOWN_PKG_READMES_FILTER=".*/math/base/special/abs/.*"
make list-markdown-docs MARKDOWN_DOCS_FILTER=".*/contributing/.*"

Pre-commit hook now splits changed Markdown files into three categories and lints each with the appropriate config.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

I realize it's a bit weird that we're loading the plugins list for docs for the general remarkrc. We don't need to do the HTML section linting for non-package-README files, though. The reason for having three targets is because we might want to do separate processing for /docs files in the future. Currently it's the same config as "everything else".

https://github.com/stdlib-js/stdlib/pull/11139/changes#diff-e7ff32f40f118b3274e48d9933d7c636c4d7cb9788b6d6dcf25a370631567b91

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

Used for understanding the current remark build and for generating new make setup (all of which I read and reviewed).


@stdlib-js/reviewers

Introduce a dedicated Remark configuration for Markdown files located outside of the package directory and update the pre-commit hook to run separate linting tasks for package and non-package files.

Assisted-by: Calude-Opus-4-6

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: missing_dependencies
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@batpigandme
Copy link
Copy Markdown
Member Author

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Mar 25, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Mar 25, 2026
@github-actions github-actions bot mentioned this pull request Mar 25, 2026
Introduce specialized remark configurations and Makefile targets to provide granular linting for different classes of Markdown files (package readmes, and docs).
Update the pre-commit hook to run separate tasks for package READMEs, documentation files, and general Markdown files.

Assisted-by: Claude-Opus-4-6

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@batpigandme
Copy link
Copy Markdown
Member Author

@kgryte Per our discussion yesterday, I've separated out package READMEs and docs (although docs rules apply to everything not in the package READMEs, it makes sense to have a separate config for future editing). I've updated the PR description above to reflect the changes.

The find variables and list targets are now in tools/make/lib/ls/markdown/:

  • pkg_readmes.mkFIND_MARKDOWN_PKG_READMES_CMD, MARKDOWN_PKG_READMES_FILES, list-markdown-pkg-readmes
  • docs.mkFIND_MARKDOWN_DOCS_CMD, MARKDOWN_DOCS_FILES, list-markdown-docs
  • files.mk — existing FIND_MARKDOWN_CMD, MARKDOWN_FILES, list-markdown-files

@batpigandme batpigandme changed the title build: separate lint task for non-package Markdown files build: separate lint task package READMEs and /docs files Mar 26, 2026
@batpigandme batpigandme changed the title build: separate lint task package READMEs and /docs files build: separate lint task package READMEs and /docs .md files Mar 26, 2026
@batpigandme
Copy link
Copy Markdown
Member Author

/stdlib merge

@stdlib-bot stdlib-bot added the bot: In Progress Pull request is currently awaiting automation. label Mar 26, 2026
@stdlib-bot stdlib-bot removed the bot: In Progress Pull request is currently awaiting automation. label Mar 26, 2026
@batpigandme batpigandme marked this pull request as ready for review March 27, 2026 12:23
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 27, 2026
@batpigandme batpigandme requested a review from kgryte March 27, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: Apply a subset of remark rules/plugins to files in /docs

2 participants