Skip to content

Commit

Permalink
add pre-commit hook for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
eug-L committed Aug 22, 2024
1 parent 6a3442b commit 5c53f11
Show file tree
Hide file tree
Showing 8 changed files with 763 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
./build/tawkto
**/vendor
.phpcs.cache
node_modules/
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
6 changes: 6 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
'*.php': [
'composer run lint:fix',
'composer run lint'
]
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.14.0
1 change: 1 addition & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<exclude-pattern>\.github/*</exclude-pattern>
<exclude-pattern>*/docker/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>

<arg value="ps"/>
<arg name="colors"/>
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"license": "AFL-3.0",
"scripts": {
"post-install-cmd": "npm install",
"lint": "phpcs -p -s -v --runtime-set ignore_warnings_on_exit true .",
"lint:fix": "phpcbf -p -s -v .; err=$?; if [ $err -eq 1 ]; then exit 0; else exit $err; fi;",
"auto-index": "composer run auto-index:1.6 && composer run auto-index:1.7",
Expand Down
Loading

0 comments on commit 5c53f11

Please sign in to comment.