Skip to content

Allow Removing Certain GFM Alert Types#435

Open
rdestefa wants to merge 3 commits into
commonmark:mainfrom
rdestefa:issue-431-disallow-github-alert-types
Open

Allow Removing Certain GFM Alert Types#435
rdestefa wants to merge 3 commits into
commonmark:mainfrom
rdestefa:issue-431-disallow-github-alert-types

Conversation

@rdestefa
Copy link
Copy Markdown
Contributor

@rdestefa rdestefa commented Jun 3, 2026

Implements #431

@rdestefa rdestefa force-pushed the issue-431-disallow-github-alert-types branch from 7ba63e2 to 4de8627 Compare June 3, 2026 02:24
@rdestefa rdestefa force-pushed the issue-431-disallow-github-alert-types branch 2 times, most recently from 4d37b9f to 9fb058c Compare June 4, 2026 05:46
@rdestefa
Copy link
Copy Markdown
Contributor Author

rdestefa commented Jun 4, 2026

@robinst Another quick PR if you have time. No rush though!

@rdestefa rdestefa force-pushed the issue-431-disallow-github-alert-types branch from 9fb058c to 2f4175c Compare June 4, 2026 05:49
@rdestefa rdestefa force-pushed the issue-431-disallow-github-alert-types branch from 2f4175c to 4256dc7 Compare June 4, 2026 05:52
* @return {@code this}
* @see AlertsExtension#STANDARD_TYPES
*/
public Builder removeTypes(String... types) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm wondering if it would be nicer if the API was just setAllowedTypes(Map<String, String>) instead, which would allow you to set the exact types you want (including custom ones). It would just override the whole map. With the current API in some cases you'd have to do remove+add. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! Agree that setAllowedTypes(Map<String, String>) would be better than removeTypes(String...). I think addCustomType would still be good to keep so users who just want to add 1 or 2 more types don't need to completely recreate the set, but I made two commits so you can see which you think works best:

  • d665735 - Replaces removeTypes with setAllowedTypes, but keeps addCustomType
  • 9c813f6 - Additionally removes addCustomType

@rdestefa rdestefa requested a review from robinst June 6, 2026 21:15
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.

2 participants