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

qmk new-keymap: validate keymap name #23420

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fauxpark
Copy link
Member

@fauxpark fauxpark commented Apr 5, 2024

Description

Avoids slashes in the keymap name (eg. partial paths).

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@fauxpark fauxpark added bug python cli qmk cli command labels Apr 5, 2024
@fauxpark fauxpark requested a review from a team April 5, 2024 02:55
@fauxpark
Copy link
Member Author

fauxpark commented Apr 5, 2024

Build failures are unrelated.

Copy link
Contributor

@lesshonor lesshonor left a comment

Choose a reason for hiding this comment

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

While I get the reasoning, forbidding uppercase letters and hyphens strikes me as something end users will repeatedly hit face-first and raise questions/complaints about unless that restriction is clearly noted. (The advice to use your GitHub username is fairly common; though case-insensitive, GH usernames allow uppercase letters while disallowing underscores1 and allowing hyphens.)

Footnotes

  1. Outside of enterprise SSO.

@fauxpark
Copy link
Member Author

fauxpark commented Apr 6, 2024

I'm not married to the regex, I just took the one used in qmk new-keyboard and removed the slash.
That said, there may be conflicting constraints here between what is allowed as a GitHub username and what we prefer as keyboard/keymap names due to the case sensitivity issue.

Given we're no longer accepting user keymaps into the repo perhaps this is less of an "our problem", but I can see, and have seen, people getting confused that their keymap is not being found because they typed it in with the wrong case.

@fauxpark fauxpark requested a review from lesshonor July 15, 2024 02:22
@fauxpark fauxpark added the breaking_change_2024q4 Targeting breaking changes Q4 2024 label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change_2024q4 Targeting breaking changes Q4 2024 bug cli qmk cli command python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants