Skip to content

chore: enhance west command with safety check for init#3245

Open
prdktntwcklr wants to merge 1 commit intozmkfirmware:mainfrom
prdktntwcklr:chore/west-check
Open

chore: enhance west command with safety check for init#3245
prdktntwcklr wants to merge 1 commit intozmkfirmware:mainfrom
prdktntwcklr:chore/west-check

Conversation

@prdktntwcklr
Copy link
Copy Markdown
Contributor

@prdktntwcklr prdktntwcklr commented Feb 17, 2026

Summary

After cloning the ZMK repository, developers must run west init with the -l app/ option to correctly specify the local manifest repository (see docs). Omitting this option results in Zephyr being initialized in the wrong directory, leading to a misconfigured environment that is cumbersome and error-prone to clean up.

This PR introduces a safety check to the west command by modifying the .bashrc inside the devcontainer. The modification ensures that when running west init, users are reminded to include the -l app/ option, unless explicitly overridden.

Key Changes

If west init is run without the -l option, a warning message is displayed giving the user the option to bypass the check if needed:

root@c97ed173883e:/workspaces/zmk# west init
STOP: Are you sure you don't want 'west init -l app/'?
Run 'command west init' if you really meant it.

PR check-list

  • Branch has a clean commit history
  • Additional tests are included, if changing behaviors/core code that is testable.
  • Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
  • Pre-commit used to check formatting of files, commit messages, etc.
  • Includes any necessary documentation changes.

@prdktntwcklr prdktntwcklr marked this pull request as ready for review February 17, 2026 04:46
@prdktntwcklr prdktntwcklr requested a review from a team as a code owner February 17, 2026 04:46
Introduces a safety check to the west command by modifying the .bashrc inside the devcontainer. The modification ensures that when running west init, users are reminded to include the -l app/ option, unless explicitly overridden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant