-
Notifications
You must be signed in to change notification settings - Fork 449
[bugfix] Fix pre-commit hook cross-platform compatibility #4643
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
Conversation
|
Follow-up: Can someone test the PR on windows? I do not have a windows machine to test it right now. |
|
tested working on windows wsl2 (linux), and windows native Windows NativePS C:\Users\ben\Developer\ComfyUI_frontend> git commit -m "test"
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
❯ lint-staged.config.js — 5 files
↓ ./**/*.js — no files
❯ ./**/*.{ts,tsx,vue,mts} — 2 files
✔ eslint --fix C:/Users/ben/Developer/ComfyUI_frontend/src/components/MenuHambu…
✔ prettier --write C:/Users/ben/Developer/ComfyUI_frontend/src/components/MenuH…
✖ vue-tsc --noEmit [FAILED]
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...
✖ vue-tsc --noEmit:
src/components/MenuHamburger.vue(32,7): error TS6133: 'testString' is declared but its value is never read.
src/main.ts(73,7): error TS6133: 'unusedVar' is declared but its value is never read.
husky - pre-commit script failed (code 1)
PS C:\Users\ben\Developer\ComfyUI_frontend> git commit -m "test"
→ No staged files match any configured task.
⚠️ Warning: Found unused NEW i18n keys:
- g.unusedTestKey
✨ Total unused new keys: 1
These keys were added but are not used anywhere in the codebase.
Consider using them or removing them in a future update.
[pr-4643 759abe99] test
1 file changed, 1 insertion(+), 1 deletion(-)
PS C:\Users\ben\Developer\ComfyUI_frontend> WSl2ben@DESKTOP-MBL3P6I:~/Developer/comfy-workspace-2/frontend-2$ git commit -m "test"
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
❯ lint-staged.config.js — 3 files
↓ ./**/*.js — no files
❯ ./**/*.{ts,tsx,vue,mts} — 2 files
✔ eslint --fix /home/ben/Developer/comfy-workspace-2/frontend-2/src/compo…
✔ prettier --write /home/ben/Developer/comfy-workspace-2/frontend-2/src/c…
✖ vue-tsc --noEmit [FAILED]
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...
✖ vue-tsc --noEmit:
src/components/MenuHamburger.vue(32,7): error TS6133: 'testString' is declared but its value is never read.
src/main.ts(73,7): error TS6133: 'unusedVar' is declared but its value is never read.
husky - pre-commit script failed (code 1)
ben@DESKTOP-MBL3P6I:~/Developer/comfy-workspace-2/frontend-2$ git commit -m "test"
→ No staged files match any configured task.
⚠️ Warning: Found unused NEW i18n keys:
- g.unusedTestKey
✨ Total unused new keys: 1
These keys were added but are not used anywhere in the codebase.
Consider using them or removing them in a future update.
[pr-4643 0eccc6be] test
1 file changed, 1 insertion(+), 1 deletion(-) |
|
I wonder if we need a |
|
Thanks for testing
Could make it select more files ComfyUI_frontend/.gitattributes Lines 4 to 7 in 47e1808
|
|
Below issue is already fixed - no action required. Just in case relevant for future searches: the Various workarounds exist. This one being repo-based meant it always worked for everyone (the lack of shebang and CRLF endings being unrelated). |
Summary
#\!/usr/bin/env bashfor better cross-platform compatibilitynpxworks on both Windows and Unix systemsProblem
The pre-commit hook was failing with "command not found" errors due to:
Sample error messages:
Solution
#\!/usr/bin/env bashshebang for cross-platform compatibilitynpxworks universallyTest plan
┆Issue is synchronized with this Notion page by Unito