Files
finance/HOOKS.md

39 lines
1.1 KiB
Markdown

# Git Hooks
This project uses Git hooks to enforce code quality standards. The hooks are managed using [Husky](https://typicode.github.io/husky/).
## Pre-commit Hook
The pre-commit hook runs automatically before each commit and performs the following checks:
- Runs Biome checks (`npm run check`) to ensure code formatting and linting standards are met
### Usage
The hook runs automatically when you commit changes:
```bash
git add .
git commit -m "Your commit message"
```
If the code doesn't pass the Biome checks, the commit will be rejected with an error message.
### Bypassing the Hooks
In rare cases when you need to bypass the pre-commit hooks (not recommended for regular use), you can use the `--no-verify` flag:
```bash
git commit -m "Your commit message" --no-verify
```
> **Warning:** Bypassing hooks should be done only in exceptional circumstances. It's better to fix code quality issues than to bypass the checks.
## Adding New Hooks
To add additional Git hooks:
1. Create a new script in the `.husky` directory
2. Make it executable: `chmod +x .husky/your-hook-name`
3. Update this documentation to include information about the new hook