Skip to content

feat(generate): support markdownlint opt-out and preservation in contributors list - #553

Closed
matbrgz wants to merge 1 commit into
all-contributors:mainfrom
matbrgz:feat/markdownlint-opt-out
Closed

matbrgz wants to merge 1 commit into
all-contributors:mainfrom
matbrgz:feat/markdownlint-opt-out

Conversation

@matbrgz

@matbrgz matbrgz commented Sep 27, 2026

Copy link
Copy Markdown

Description

Resolves #540.

Currently, injectListBetweenTags always injects <!-- markdownlint-disable --> and <!-- markdownlint-restore --> with no way to opt out. In projects that do not use markdownlint, these comments are unwanted noise that get re-injected on every run even after being removed manually.

This PR adds:

  1. Config Option & CLI Flag:
    • "markdownlint": false in .all-contributorsrc to disable markdownlint comments.
    • --no-markdownlint CLI flag.
  2. Automatic Preservation:
    • If markdownlint is not explicitly configured (undefined), injectListBetweenTags inspects the existing content between tags. If the existing list has <!-- prettier-ignore-start --> but lacks <!-- markdownlint-disable -->, it preserves the developer's omission and avoids re-adding them.
    • Fully backward compatible: existing repositories and fresh init lists keep their markdownlint comments by default.
  3. Tests:
    • Unit tests covering explicit opt-out (markdownlint: false), explicit inclusion (markdownlint: true), and automatic preservation for existing files with and without markdownlint comments.

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Bug fix

…ributors list

Allow projects to opt out of markdownlint comments around the contributors table, and preserve existing tables where markdownlint comments were removed.

- Support markdownlint config option in .all-contributorsrc (markdownlint: false) and CLI flag (--no-markdownlint / --markdownlint).
- When markdownlint is not explicitly configured, inspect existing table content; if prettier-ignore-start is present without markdownlint-disable, preserve the user's omission.
- Add unit tests verifying markdownlint opt-out, explicit inclusion, and preservation of existing tables.
- Closes #540

Co-Authored-By: Antigravity <noreply@google.com>
@JoshuaKGoldberg

Copy link
Copy Markdown
Contributor

@matbrgz I already sent #541 a couple days ago, which you auto-responded on. Is your bot running a little too much? 🙂

@matbrgz

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated contributors list always adds markdownlint-disable/restore comments, with no opt-out

2 participants