Skip to content

Commit

Permalink
chore: add prettier-check command
Browse files Browse the repository at this point in the history
  • Loading branch information
agustin9998 committed Nov 10, 2023
1 parent 6760dd7 commit 5e70ead
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 14 deletions.
68 changes: 54 additions & 14 deletions captainhook.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"commit-msg": {
"enabled": true,
"actions": [
{ "action": "\\Webgriffe\\CaptainHook\\PreventCommitCaseSensitiveSameFilename" },
{ "action": "\\Ramsey\\CaptainHook\\ValidateConventionalCommit" }
{
"action": "\\Webgriffe\\CaptainHook\\PreventCommitCaseSensitiveSameFilename"
},
{
"action": "\\Ramsey\\CaptainHook\\ValidateConventionalCommit"
}
]
},
"pre-commit": {
Expand All @@ -15,34 +19,70 @@
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\OnBranch",
"args": ["main", "master", "develop"]
"args": [
"main",
"master",
"develop"
]
}
]
},
{ "action": "composer run-script ecs:fix", "options": [] },
{ "action": "composer run-script rector:fix ", "options": [] },
{ "action": "npm run format", "options": [] },
{ "action": "npm run lint", "options": [] },
{ "action": "npm run spell-checker:staged", "options": [] }
{
"action": "composer run-script ecs:fix",
"options": []
},
{
"action": "composer run-script rector:fix ",
"options": []
},
{
"action": "npm run prettier-check",
"options": []
},
{
"action": "npm run lint",
"options": []
},
{
"action": "npm run spell-checker:staged",
"options": []
}
]
},
"pre-push": {
"enabled": true,
"actions": [
{
"action": "\\Webgriffe\\CaptainHook\\PreventPushForce",
"options": { "protected-branches": ["master", "main"] }
"options": {
"protected-branches": [
"master",
"main"
]
}
},
{
"action": "\\CaptainHook\\App\\Hook\\Branch\\Action\\EnsureNaming",
"options": {
"regex": "#^(master|main|develop|staging|demo|(feature|test|(bug|hot)fix)(\\/[a-zA-Z0-9]+([-_][a-zA-Z0-9]+)*){1,2}|release\\/[0-9]+(\\.[0-9]+)*(-(alpha|beta|rc)[0-9]*)?)$#"
}
},
{ "action": "\\CaptainHook\\App\\Hook\\Composer\\Action\\CheckLockFile", "options": [] },
{ "action": "composer run-script phpstan", "options": [] },
{ "action": "composer run-script rector", "options": [] },
{ "action": "composer run-script ecs", "options": [] }
{
"action": "\\CaptainHook\\App\\Hook\\Composer\\Action\\CheckLockFile",
"options": []
},
{
"action": "composer run-script phpstan",
"options": []
},
{
"action": "composer run-script rector",
"options": []
},
{
"action": "composer run-script ecs",
"options": []
}
]
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"prettier-check": "prettier --check \"./resources/js/**/*.{js,cjs,mjs,ts,tsx,md,json}\" --ignore-path ../../.gitignore",
"format": "prettier --check \"./resources/js/**/*.{js,cjs,mjs,ts,tsx,md,json}\" --ignore-path ../../.gitignore --write",
"type-check": "tsc --noEmit",
"lint": "eslint . --fix",
Expand Down

0 comments on commit 5e70ead

Please sign in to comment.