miniscruff/changie

kinds doesn't support a key value, so can cause invalid characters in file names

Closed this issue ยท 11 comments

golang/go#28001

EDIT: prior thought this was project, but meant to say label. Replaced reference to project with label here for clarity for future readers....

I had a repo with emoji in the label, so ๐Ÿ”จ Refactor for example.
File name therefore had this.

Go install refused due to this character being invalid for a filepath according to it's logic.
CleanShot 2024-03-12 at 17 34 45@2x

There should be a project key value to specify a file system safe key same with kinds and components. Not much I can do as I think that rule is forced by some os's and isn't really go specific.

So I should use label for the emoji but not key correct? I'll double check maybe I did that wrong.

So I should use label for the emoji but not key correct? I'll double check maybe I did that wrong.

Yea the labels are meant for nice values while the keys are meant for safe values for files or templates. Labels should only be used for like selections or previews type stuff, the key is the actual look up value.

And label is what would be used in the go template for .Kind? That's why I think I used it. Wanted to map emoji to kind of change.

And label is what would be used in the go template for .Kind? That's why I think I used it. Wanted to map emoji to kind of change.

The label is what appears in the kind selection list, and the template yes I believe so. Where as the key is used in the file to prevent trying to save an emoji or something with a slash for example. If you have a config or idea of what you want I can try and build something for you. I think what you want is supported already just gotta get it how you want it.

I do know dagger uses an emoji for breaking changes, but using the colon style for GitHub.

I realize my mistake. I'm talking about Kinds, not projects.

kinds:
- label: Added
- label: Changed
- label: Deprecated
- label: Removed
- label: Fixed
- label: Security

I use

kinds:
  - label: ๐ŸŽ“ What I Learned
  - label: ๐Ÿ”จ Product Specific
  - label: ๐Ÿ“ Architecture
  - label: ๐Ÿค– CI
  - label: ๐Ÿ’ป Developer Workflows
  - label: ๐Ÿ“„ Process
  - label: ๐Ÿ”’ Security
  - label: ๐Ÿ‘ฅ Team & Collaboration
  - label: ๐ŸŽ‰ Community & Engagement
  - label: ๐Ÿค” Issues To Consider
  - label: ๐Ÿ‘€ Advice Request

This results in files like this:

CleanShot 2024-03-14 at 13 35 39

The result is nice as the categories are nicely organized. I don't think Key exists on kind, as I tried it and realized I was making things up :-)

Wow ok, turns out kind config doesn't have a key value like I thought... Hmm. Mighty unfortunate. Ideally there would be a key value where you would specify a safe key for files and templating. Projects have this but kinds don't. I would consider that an issue and the solution to your problem.

Oh you can see the kind format which is what's generated in the output to use emojis separate from the label used in the prompt. That's what dagger is doing. Not ideal as there should still be a key option though.

Update: I included this as part of the config design here #610 going to mull it over for a few days and then maybe break it down into tickets.

OK one more update, since I plan on adding this new config with the config revamp anyway, I can also add it with the current system so you don't have to wait too long to benefit from it. Will handle this next stream.

You are awesome, thanks for this!