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

Feature: Add xand tag #442

Merged
merged 11 commits into from
Aug 8, 2024
Merged

Feature: Add xand tag #442

merged 11 commits into from
Aug 8, 2024

Conversation

tinytyranid
Copy link
Contributor

I have added the possibility to add a xand tag.

It works similarly to the xor tag, but requires all flags within the xand group to be set.

I have tried to stay consistent to the style already used, and touch existing functions as little as possible.

The one issue I have not handled here which should probably be resolved before merging is the possibility of a user putting two or more flags in the same xor and xand group, which would cause problems. The reason I have not solved this issue is because I was a bit unsure about how you would like to handle it. Should it be up to the user to check for this when testing their application? Or should kong give an error? Do you have a standard for how you handle issues like this?

@alecthomas
Copy link
Owner

I like the idea, but "xand" isn't really a valid boolean operator! Can we rename it to "and"?

To answer your question, I think having a check that xor and and aren't used together would be good.

@alecthomas
Copy link
Owner

Thanks for the PR BTW, appreciate it!

@tinytyranid
Copy link
Contributor Author

I like the idea, but "xand" isn't really a valid boolean operator! Can we rename it to "and"?

To answer your question, I think having a check that xor and and aren't used together would be good.

Renaming it to "and" is not a problem.
I will fix that right away!

I will also try to make a check for when they are used together, but that might take a bit longer to finish.

@tinytyranid tinytyranid changed the title Feature: Add xand tag Feature: Add and tag Aug 7, 2024
@tinytyranid tinytyranid changed the title Feature: Add and tag Feature: Add xand tag Aug 7, 2024
Copy link
Owner

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

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

Nice nice, thanks!

@alecthomas alecthomas merged commit ff6d5ba into alecthomas:master Aug 8, 2024
5 checks passed
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