Skip to content

Commit ccb0f12

Browse files
committed
feat(hooks): update git hooks configuration and schema files
1 parent 8cd50a7 commit ccb0f12

File tree

10 files changed

+21
-20
lines changed

10 files changed

+21
-20
lines changed

booster/.husky/.git-hooks.config.dist.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": ".git-hooks.config.schema.json",
2+
"$schema": ".husky/.git-hooks.config.schema.json",
33

44
"verbose": false,
55

File renamed without changes.

booster/.git-hooks.config.schema.json renamed to booster/.husky/.git-hooks.config.schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@
4848
"properties": {
4949
"preCommit": {
5050
"$ref": "#/definitions/hookConfig",
51-
"description": "Pre-commit hook configuration. All default tools run; overrides are applied on top."
51+
"description": "Pre-commit hook configuration. Only tools listed under 'tools' will run."
5252
},
5353
"prePush": {
5454
"$ref": "#/definitions/hookConfig",
55-
"description": "Pre-push hook configuration. ONLY the tools listed here will run as quality checks. Use passFiles:false for whole-project analysis tools."
55+
"description": "Pre-push hook configuration. Only tools listed under 'tools' will run. Use passFiles:false for whole-project analysis tools."
5656
},
5757
"commitMsg": {
5858
"$ref": "#/definitions/hookConfig",
59-
"description": "Commit-msg hook configuration. ONLY the tools listed here will run."
59+
"description": "Commit-msg hook configuration. Only tools listed under 'tools' will run."
6060
}
6161
},
6262
"additionalProperties": false
@@ -69,7 +69,7 @@
6969
"properties": {
7070
"tools": {
7171
"type": "object",
72-
"description": "Tool overrides/additions scoped to this hook. Tool names are case-insensitive. For pre-commit: all default tools run and these are merged on top. For pre-push/commit-msg: ONLY tools listed here will run.",
72+
"description": "Tools to run for this hook. Only tools listed here will execute. Built-in tools can be referenced by name — registry definitions fill in defaults. Custom tools require 'command', 'type', and 'extensions'.",
7373
"properties": {
7474
"ESLint": { "$ref": "#/definitions/toolOverride", "description": "ESLint - JavaScript/TypeScript linting (group: lint)" },
7575
"Prettier": { "$ref": "#/definitions/toolOverride", "description": "Prettier - Code formatting (group: format)" },

booster/.husky/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Create a `.git-hooks.config.json` file (or `.githooks.json`) in the project root
6666

6767
```json
6868
{
69-
"$schema": "https://raw.githubusercontent.com/TerrorSquad/php-booster/main/booster/.git-hooks.config.schema.json",
69+
"$schema": "https://raw.githubusercontent.com/TerrorSquad/php-booster/main/booster/.husky/.git-hooks.config.schema.json",
7070
"verbose": false,
7171
"skip": {
7272
"preCommit": false,

booster/integrate_booster.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,13 +1862,15 @@ function update_hooks_only() {
18621862
mkdir -p .husky
18631863
rm -rf .husky/tests
18641864

1865-
# Copy everything except the 'tests' directory
1866-
for item in "$husky_src"/*; do
1867-
local item_name=$(basename "$item")
1865+
# Copy everything except the 'tests' directory.
1866+
# Use find to include dotfiles (shell globs exclude them by default).
1867+
while IFS= read -r item; do
1868+
local item_name
1869+
item_name=$(basename "$item")
18681870
if [ "$item_name" != "tests" ]; then
18691871
cp -R "$item" .husky/
18701872
fi
1871-
done
1873+
done < <(find "$husky_src" -maxdepth 1 -mindepth 1)
18721874

18731875
# Set execute permissions for scripts and hooks
18741876
find ".husky" -type f \( -name "*.sh" -o -name "*.bash" -o -name "*.mjs" -o -name "pre-commit" -o -name "commit-msg" -o -name "pre-push" \) -exec chmod +x {} \;

booster/manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
"items": [
2929
"commitlint.config.ts",
3030
"validate-branch-name.config.cjs",
31-
"renovate.json",
32-
".git-hooks.config.example.json"
31+
"renovate.json"
3332
]
3433
},
3534
"php": {

booster/package-release.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ mkdir -p "$OUTPUT_DIR"
2525
# Files/dirs to include in the package
2626
INCLUDE_ITEMS=$(cat <<'EOF'
2727
.editorconfig
28-
.git-hooks.config.example.json
29-
.git-hooks.config.schema.json
3028
.github
3129
.gitignore
3230
.husky

booster/src/main.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,15 @@ function update_hooks_only() {
105105
mkdir -p .husky
106106
rm -rf .husky/tests
107107

108-
# Copy everything except the 'tests' directory
109-
for item in "$husky_src"/*; do
110-
local item_name=$(basename "$item")
108+
# Copy everything except the 'tests' directory.
109+
# Use find to include dotfiles (shell globs exclude them by default).
110+
while IFS= read -r item; do
111+
local item_name
112+
item_name=$(basename "$item")
111113
if [ "$item_name" != "tests" ]; then
112114
cp -R "$item" .husky/
113115
fi
114-
done
116+
done < <(find "$husky_src" -maxdepth 1 -mindepth 1)
115117

116118
# Set execute permissions for scripts and hooks
117119
find ".husky" -type f \( -name "*.sh" -o -name "*.bash" -o -name "*.mjs" -o -name "pre-commit" -o -name "commit-msg" -o -name "pre-push" \) -exec chmod +x {} \;

docs/content/3.tools/4.git_hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ For project-specific customizations, create a `.git-hooks.config.json` file at y
108108

109109
```json [.git-hooks.config.json]
110110
{
111-
"$schema": "https://raw.githubusercontent.com/TerrorSquad/php-booster/main/booster/.git-hooks.config.schema.json",
111+
"$schema": "https://raw.githubusercontent.com/TerrorSquad/php-booster/main/booster/.husky/.git-hooks.config.schema.json",
112112
"verbose": false,
113113
"skip": {
114114
"preCommit": false,

tools/internal-test/lib/test_orchestrator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _install_dependencies_with_mise(self) -> None:
121121
"openapi/openapi.yml",
122122
".husky/commit-msg",
123123
".husky/shared/index.ts",
124-
".git-hooks.config.example.json",
124+
".husky/.git-hooks.config.example.json",
125125
".husky/.git-hooks.config.dist.json",
126126
".husky/generate-config.ts",
127127
".git-hooks.config.json",

0 commit comments

Comments
 (0)