-
Notifications
You must be signed in to change notification settings - Fork 13
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
Make the pre-commit
hook fix formatting
#147
Conversation
@@ -112,7 +111,7 @@ | |||
"lint:php": "composer lint", | |||
"lint:php:fix": "composer lint-fix", | |||
"packages-update": "wp-scripts packages-update", | |||
"precommit": "./bin/pre-commit.sh", | |||
"prepare": "git config --local core.hooksPath .githooks", |
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.
This won't always work, but I like it more than importing husky and updating its versions.
Also, we won't need a .husky/
directory, only .githooks/
.
I don't like directories named after vendors, but we still have some.
husky
with a vanilla git
commithusky
with a vanilla git
command
There aren't this many commits for this work, those are because this PR targeted another branch, and I merged that branch in. |
Sorry, this actually isn't ready for review. It has some bugs. |
<directory suffix=".php">./tests/php/Integration/Helpers/</directory> | ||
<directory prefix="Test" suffix=".php">./tests/php/Integration/</directory> | ||
</testsuite> | ||
</testsuites> |
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.
Not related, I just wanted to indent this with tabs, like phpcs.xml
husky
with a vanilla git
commandpre-commit
hook fix formatting
This PR din't have that many commits Those are because this was branched off another PR, and I merged that in. |
executor: | ||
name: php | ||
docker: | ||
- image: cimg/php:8.2-node |
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.
To make linting pass
Sorry, this is ready for review again. |
Sorry for yet another GCB PR! |
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.
This is working well, @kienstra! It's a nice touch to do this without relying on husky.
Before making the commit, I had linting errors:
After making the commit, the auto-fixable errors were all fixed and the commit succeeded:
Hi @mike-day, Thanks for the screenshots and for testing this. |
Changes
husky
, this adds the pre-commit hook with agit
command inpackage.json
prepare
Testing instructions
git checkout remove/husky
composer i && nvm use && npm i
git commit -m "Should be fixed"