@@ -4,9 +4,9 @@ Git hooks for development workflow automation.
44
55## Features
66
7- - ** commit-msg** : Validates commit messages follow [ Conventional Commits] ( https://www.conventionalcommits.org/ ) format
7+ - ** commit-msg** : Validates commit messages follow [ Conventional Commits] ( https://www.conventionalcommits.org/ ) format (with optional ClickUp ID)
88- ** pre-commit** : Runs PHPCS code quality checks for Drupal and WordPress projects
9- - ** pre-push** : Validates branch naming conventions (ClickUp IDs or conventional format)
9+ - ** pre-push** : Validates branch naming + runs custom commands from config file
1010
1111## Installation
1212
@@ -62,14 +62,16 @@ Validates that commit messages follow Conventional Commits format:
6262
6363```
6464<type>(<optional-scope>): <description>
65+ CU-xxxxxxxxx - <type>(<optional-scope>): <description>
6566```
6667
6768Valid types: ` feat ` , ` fix ` , ` docs ` , ` style ` , ` refactor ` , ` perf ` , ` test ` , ` build ` , ` ci ` , ` chore ` , ` revert `
6869
6970Examples:
7071- ` feat: add user authentication `
7172- ` fix(api): resolve timeout issue `
72- - ` docs: update installation guide `
73+ - ` CU-86b7kybxx - feat: add git hooks `
74+ - ` CU-86b7kybxx - fix(auth): resolve login bug `
7375
7476### pre-commit
7577
@@ -80,14 +82,77 @@ For PHP projects (Drupal/WordPress), automatically:
8082
8183### pre-push
8284
83- Validates branch names follow one of these formats:
84- - ClickUp ID: ` CU-xxxxxxxxx ` (9 alphanumeric characters)
85- - Conventional: ` <type>/<description> ` (e.g., ` feat/user-login ` , ` fix/header-bug ` )
86- - Special branches: ` master ` , ` main ` , ` develop ` , ` staging ` , ` production `
85+ 1 . ** Branch validation** - Validates branch names follow one of these formats:
86+ - ClickUp ID: ` CU-xxxxxxxxx `
87+ - Conventional: ` <type>/<description> ` (e.g., ` feat/user-login ` , ` fix/header-bug ` )
88+ - Special branches: ` master ` , ` main ` , ` develop ` , ` staging ` , ` production `
89+
90+ 2 . ** Custom commands** - Runs commands defined in ` .dev-hooks.yml ` before pushing
91+
92+ ## Configuration File
93+
94+ Create a ` .dev-hooks.yml ` file in your project root to configure custom pre-push commands.
95+
96+ Copy the example file to get started:
97+
98+ ``` bash
99+ cp .dev-hooks.example.yml .dev-hooks.yml
100+ ```
101+
102+ ### Example Configuration
103+
104+ ``` yaml
105+ # Pre-push commands
106+ pre-push :
107+ enabled : true
108+ skip_branch_validation : false
109+
110+ commands :
111+ - name : " Run Tests"
112+ run : " pytest"
113+
114+ - name : " Lint Check"
115+ run : " ruff check src/"
116+
117+ - name : " Type Check"
118+ run : " mypy src/"
119+
120+ # Docker support (optional)
121+ docker :
122+ enabled : false
123+ compose : true
124+ container : " app"
125+ compose_file : " docker-compose.yml"
126+ ` ` `
127+
128+ ### Docker Support
129+
130+ For dockerized projects, enable docker execution:
131+
132+ ` ` ` yaml
133+ docker :
134+ enabled : true
135+ compose : true
136+ container : " php"
137+
138+ pre-push :
139+ commands :
140+ - name : " PHPUnit"
141+ run : " vendor/bin/phpunit"
142+ ` ` `
143+
144+ Commands will be executed inside the container:
145+ ` ` ` bash
146+ docker-compose exec -T php vendor/bin/phpunit
147+ ```
87148
88149## Development
89150
90151``` bash
152+ # Create virtual environment
153+ python3 -m venv venv
154+ source venv/bin/activate
155+
91156# Install in development mode
92157pip install -e .
93158
0 commit comments