Skip to content

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

Closed

Description

@sheldonhull

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

Activity

  1. miniscruff commented on Mar 12, 2024

    @miniscruff
    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.

  2. sheldonhull commented on Mar 13, 2024

    @sheldonhull
    ContributorAuthor

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

  3. miniscruff commented on Mar 13, 2024

    @miniscruff
    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.

  4. sheldonhull commented on Mar 13, 2024

    @sheldonhull
    ContributorAuthor

    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.

  5. miniscruff commented on Mar 13, 2024

    @miniscruff
    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.

  6. sheldonhull commented on Mar 14, 2024

    @sheldonhull
    ContributorAuthor

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

  7. 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[/+] on Mar 14, 2024
  8. miniscruff commented on Mar 14, 2024

    @miniscruff
    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.

  9. miniscruff commented on Mar 14, 2024

    @miniscruff
    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.

  10. miniscruff commented on Mar 18, 2024

    @miniscruff
    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.

  11. miniscruff commented on May 10, 2024

    @miniscruff
    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.

  12. sheldonhull commented on May 13, 2024

    @sheldonhull
    ContributorAuthor

    You are awesome, thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions