Skip to content

Commit 334bbf0

Browse files
committed
Document usage of lefthook for Git hooks
1 parent 9bf4f82 commit 334bbf0

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,29 @@ Or, if you don't want to rely on npm, or use pail, etc:
9393
php artisan serve
9494
```
9595

96+
## Git hooks
97+
98+
We use the [lefthook Git hooks manager][lefthook] to run pre-commit hooks that:
99+
100+
1. Automatically format and stage PHP code using [Laravel Pint][pint]
101+
102+
2. Perform static analysis on the PHP code using [Larastan][larastan]
103+
104+
3. Format Blade templates using the [shufo/blade-formatter][blade-formatter]
105+
106+
4. Checks for missing translation files or strings using the
107+
[Laravel translations checker][translations-checker]
108+
109+
[lefthook]: <https://lefthook.dev/> "evilmartians/lefthook: Fast and powerful Git hooks manager for any type of projects."
110+
[pint]: <https://github.com/laravel/pint> "laravel/pint: Laravel Pint is an opinionated PHP code style fixer for minimalists."
111+
[larastan]: <https://github.com/larastan/larastan> "larastan/larastan: Adds code analysis to Laravel improving developer productivity and code quality"
112+
[blade-formatter]: <https://github.com/shufo/blade-formatter> "shufo/blade-formatter: An opinionated blade template formatter for Laravel that respects readability"
113+
[translations-checker]: <https://github.com/LarsWiegers/laravel-translations-checker> "LarsWiegers/laravel-translations-checker: Never worry about missing translations again! Use the translations checker."
114+
115+
> [!TIP]
116+
>
117+
> Take a look at the [config/lefthook.yaml](config/lefthook.yaml) file.
118+
96119
## API
97120

98121
The API route is `/api/`.

0 commit comments

Comments
 (0)