Skip to content

fix: don't re-add removed markdownlint comments to generated lists - #541

Merged
JimMadge merged 3 commits into
all-contributors:mainfrom
JoshuaKGoldberg:markdownlint-preserve-removal
Oct 14, 2026
Merged

JimMadge merged 3 commits into
all-contributors:mainfrom
JoshuaKGoldberg:markdownlint-preserve-removal

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Fixes #540.

Why: Repos that removed the markdownlint comments from their contributors list get them re-added on every run.

How: When a previously generated list (one with <!-- prettier-ignore-start -->) doesn't have <!-- markdownlint-disable -->, generation now leaves the markdownlint comments out; new and hand-written lists still get them.

In other words, there are two ways to control this:

  • options.withMarkdownlint: set to false to explicitly remove, true to explicitly add, or leave undefined to 👇
  • (infer from existing): true if there was no content or the existing content has the markdownlint-disable comment, false if the existing content doesn't have the comment

Checklist:

  • Documentation N/A
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Fixes all-contributors#540.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@matbrgz

This comment was marked as spam.

@matbrgz

This comment was marked as spam.

@JimMadge JimMadge 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.

Looks good. One question about the logic.

I would prefer to go with the configuration option you explained in #540. I think it is clearer and easier to document.

We could use what you have done here just changing withMarkdownLint to be taken from the config rather than calculated from the previous table.

Comment thread src/generate/index.js Resolved
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the markdownlint-preserve-removal branch from 8060b8f to b7e1ec1 Compare October 2, 2026 02:39
JoshuaKGoldberg and others added 2 commits October 1, 2026 22:40
Co-authored-by: Jim Madge <jim+github@jmadge.com>
@JimMadge
JimMadge merged commit d3c1239 into all-contributors:main Oct 14, 2026
6 checks passed
@JoshuaKGoldberg

Copy link
Copy Markdown
Contributor Author

🙌 yay, thanks @JimMadge!

@JoshuaKGoldberg
JoshuaKGoldberg deleted the markdownlint-preserve-removal branch October 14, 2026 11:53
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

3 participants