This repository contains pre-commit hooks to improve the development experience with the open source dataflow library Hamilton.
Install pre-commit and add this to your .pre-commit-config.yaml
- repo: https://github.com/dagworks-inc/hamilton-pre-commit
rev: v0.1.3 # use a ref >= 0.1.3
hooks:
- id: cli-command
name: Hamilton CLI command
args: [
hamilton build my_module.py, # commands to execute
hamilton build my_module2.py, # they are executed in order
hamilton validate --context config.json my_module.py my_module2.py, # exits on the first failure
]
You can specify hamilton
CLI commands to execute in a list. The hook will execute them in order. It's most useful with hamilton build
to check for valid Hamilton syntax and hamilton validate
to verify a specific dataflow path. More thorough validation should be done using tests given pre-commits are meant to be lightweight.
If you are interested in the command line tool, use pip install sf-hamilton[cli]
and see the main Hamilton repository.
Distributed under the terms of the MIT license, hamilton-pre-commit
is free and open source software.
If you encounter any problems, please file an issue along with a detailed description.