Skip to content

Tags as enum#493

Open
ygerlach wants to merge 5 commits intolinuxmint:masterfrom
ygerlach:improveTags
Open

Tags as enum#493
ygerlach wants to merge 5 commits intolinuxmint:masterfrom
ygerlach:improveTags

Conversation

@ygerlach
Copy link
Copy Markdown
Contributor

This is just an internal change. There should be no (intended) visible change to the users.

I think the way tags are currently handled is horrific. I guess it works, but when one want to add or change something with the tags, one has to look up specific strings throughut the entire project. My goal is to improve that. That´s why i introduced the Tags enum. It works as flags, so in one Tags variable many Tag values can be held. It should also have all strings (and their parsing methods) related to tags in one place.

There would be another way to do this:
We could define a normal enum Tag and make the type not hold more than one Tag value. That could be implemented in a different class. Im not sure what is best in this case, hence this PR as RFC. To discuss this.

My main motivation to do this change, is to be able to add 1-2 new tags in future PRs in a simple manner.

@clefebvre clefebvre changed the title RFC: Tags as enum [Next] RFC: Tags as enum Jan 7, 2026
@clefebvre clefebvre changed the title [Next] RFC: Tags as enum RFC: Tags as enum Jan 22, 2026
@mtwebster
Copy link
Copy Markdown
Member

Definitely tags as 'flags' would be preferred and seems like it would be simplest to transition to from the current situation.

Pretty clever the [Flags] markup sets them up as bit-shifted values for you. Make that one thing I actually like about this language :)

@ygerlach
Copy link
Copy Markdown
Contributor Author

I would like to fix the way create_snapshot_for_tag kinda ignores the tags its given and uses App.cmd_tags anyways.
After that it should be easy to fix #156 as well.

instead of creating a snapshot with one tag and then update that; now we use the correct tags from the beginning

Fixes: linuxmint#156
@ygerlach ygerlach changed the title RFC: Tags as enum Tags as enum Apr 11, 2026
@ygerlach ygerlach marked this pull request as ready for review April 11, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants