Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine nocase and strictcase tag options under a case option #153

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

dsnet
Copy link
Collaborator

@dsnet dsnet commented Feb 4, 2025

WARNING: This commit contains breaking changes.

Instead of specifying nocase or strictcase tag options, use a single case tag option, which is a key-value pair where the value can only be 'ignore' or 'strict'.
This reads more naturally as case:ignore or case:strict and is more clear that case:ignore and case:strict are mutually exclusive tag options.

@dsnet dsnet requested review from mvdan, johanbrandhorst and neild and removed request for mvdan February 4, 2025 02:09
@dsnet
Copy link
Collaborator Author

dsnet commented Feb 4, 2025

\cc @prattmic, thank you for the suggestion.

out.casing |= nocase
case "strictcase":
out.casing |= strictcase
case "case":
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can refactor this in the future to share more code with the format:value logic below, but good enough for now.

WARNING: This commit contains breaking changes.

Instead of specifying `nocase` or `strictcase` tag options,
use a single `case` tag option, which is a key-value pair
where the value can only be 'ignore' or 'strict'.
This reads more naturally as `case:ignore` or `case:strict` and
is more clear that `case:ignore` and `case:strict` are
mutually exclusive tag options.
Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

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

Love this change

@dsnet dsnet merged commit 1ae217a into master Feb 11, 2025
8 checks passed
@dsnet dsnet deleted the case-option branch February 11, 2025 17:11
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.

4 participants