diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..994d3782 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/psf/black + rev: 24.8.0 + hooks: + - id: black + files: ^src/ + - repo: https://github.com/terrencepreilly/darglint + rev: v1.8.1 + hooks: + - id: darglint + files: ^src/ + args: ["-v", "2", "-z", "short"] diff --git a/README.md b/README.md index 8397c605..5fe77cd8 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,16 @@ Here's a list of relevant env. variables that are used by AgentLab: - `AGENTLAB_EXP_ROOT`, desired path for your experiments to be stored, defaults to `~/agentlab-results`. - `AGENTXRAY_SHARE_GRADIO`, which prompts AgentXRay to open a public tunnel on launch. +## Contributing + +For development, install the dev extras and the pre-commit hooks so formatting +(black) and docstring checks (darglint) run automatically before each commit: + +```bash +pip install -e ".[dev]" +pre-commit install +``` + ## Misc if you want to download HF models more quickly