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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sheldonhull opened this issue Mar 12, 2024 · 11 comments 路 Fixed by #657
Closed

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

sheldonhull opened this issue Mar 12, 2024 · 11 comments 路 Fixed by #657
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@sheldonhull
Copy link
Contributor

sheldonhull commented Mar 12, 2024

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

@sheldonhull sheldonhull added the bug Something isn't working label Mar 12, 2024
@miniscruff
Copy link
Owner

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.

@sheldonhull
Copy link
Contributor Author

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

@miniscruff
Copy link
Owner

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.

@sheldonhull
Copy link
Contributor Author

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.

@miniscruff
Copy link
Owner

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.

@sheldonhull
Copy link
Contributor Author

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 :-)

@sheldonhull sheldonhull changed the title invalid character when files are in a go repo using go install kinds doesn't support a key value, so can cause invalid characters in file names Mar 14, 2024
@miniscruff
Copy link
Owner

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.

@miniscruff
Copy link
Owner

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.

@miniscruff miniscruff added the good first issue Good for newcomers label Mar 15, 2024
@miniscruff
Copy link
Owner

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.

@miniscruff
Copy link
Owner

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.

@sheldonhull
Copy link
Contributor Author

You are awesome, thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants