-
Notifications
You must be signed in to change notification settings - Fork 21
feat(scripts): git hook to format generators #856
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
✅ Deploy Preview for api-clients-automation canceled.
|
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice
@@ -1,4 +1,5 @@ | |||
#!/bin/sh | |||
. "$(dirname "$0")/_/husky.sh" | |||
|
|||
./scripts/ci/husky/pre-commit.js | |||
./scripts/husky/pre-commit.js | |||
./scripts/husky/format-generators.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the JSON one too? You can have a common format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good idea
package.json
Outdated
@@ -13,6 +13,7 @@ | |||
"clean": "rm -rf **/dist **/build **/node_modules **/.gradle **/vendor || true", | |||
"cli": "yarn workspace scripts ts-node --transpile-only ./cli/index.ts", | |||
"docker": "docker exec -it dev yarn cli $*", | |||
"docker:no-tty": "docker exec -t dev yarn cli $*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's only used in the script maybe it's worth having the raw command, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah good idea again !
c45181d
to
988836d
Compare
🧭 What and Why
🎟 JIRA Ticket: APIC-592
I'm tired of seeing the CI fail because of the generators being unformatted, so here is a hook to format generators everytime there are changes.
We need the
docker:no-tty
script because we don't have a tty inside the hook.Changes included:
format-generators
script🧪 Test
Try modifying a generator file and commit it.