@fatsolutions/ganchos
v1.1.2
Published
Git Hook Manager for Polyglot Monorepos, developed in house by FatSolutions
Maintainers
Readme
@fatsolutions/ganchos
Git Hook Manager for Polyglot Monorepos.
Installation
pnpm add -D @fatsolutions/ganchosQuick Setup
Add your desired languages to package.json:
{
"ganchos": {
"languages": ["typescript", "python", "cairo"]
}
}The hooks will be automatically installed on pnpm install via the postinstall bootstrap.
Manual Setup
If you prefer manual control, skip the ganchos field in package.json and use the CLI:
# Enable languages
pnpm ganchos enable typescript python cairo
# Install the hooks
pnpm ganchos installCLI Commands
| Command | Description |
|---------|-------------|
| ganchos install | Install git hooks based on configuration |
| ganchos generate | Generate hook content to stdout (for inspection) |
| ganchos list | List configured and available languages |
| ganchos enable <languages...> | Enable one or more languages |
| ganchos disable <languages...> | Disable one or more languages |
Supported Languages
- javascript - ESLint, Prettier
- typescript - TypeScript compiler, ESLint, Prettier
- python - Black, isort, flake8, mypy (work in progress)
- cairo - scarb fmt, scarb lint
How It Works
- Configuration is stored in
.ganchos.json(auto-generated, added to.git/info/exclude) - Language-specific hook scripts are located in
hooks/pre-commit/ - On commit, the pre-commit hook runs checks for all enabled languages on staged files
- Auto-fixable issues (formatting) are fixed automatically; you'll be prompted to review and commit again
Language-Specific Requirements
JavaScript/TypeScript
eslintandprettieravailable vianpx
Python
- Optional:
black,isort,flake8,mypyinstalled in your environment
Cairo (Starknet)
scarbinstalled (installation guide)Scarb.tomlpresent in project root or package directories
Monorepo Support
Ganchos detects packages/ subdirectories and runs language tools from the appropriate project roots:
- Looks for
package.json,tsconfig.json,pyproject.toml,Scarb.tomlin package directories - Falls back to root-level configuration when appropriate
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
GPL-2.0
