Production-ready pre-commit hooks for the Jac programming language.
| Hook | Description |
|---|---|
jac-format |
Formats .jac files with consistent code style |
jac-check |
Runs type checking on .jac files |
Add the following to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/Jaseci-Labs/jac-pre-commit
rev: v0.9.3 # Use the latest release tag
hooks:
- id: jac-format
- id: jac-checkThen install the hooks:
pre-commit installpre-commit run --all-files# Format only
pre-commit run jac-format --all-files
# Type check only
pre-commit run jac-check --all-filesYou can also run the hooks directly:
# Format a file
jac format myfile.jac
# Type check a file
jac check myfile.jacAutomatically formats Jac source files to maintain consistent code style across your project. Files are modified in place.
- Modifies files: Yes (auto-fix)
- Fails on: Parse errors
Performs static type analysis on Jac files to catch type errors before runtime.
- Modifies files: No
- Fails on: Type errors
- Python 3.10+
- jaclang >= 0.9.3
# Clone the repository
git clone https://github.com/Jaseci-Labs/jac-pre-commit.git
cd jac-pre-commit
# Install in development mode
pip install -e .
# Test against a local jac file
pre-commit try-repo . jac-format --files /path/to/test.jac
pre-commit try-repo . jac-check --files /path/to/test.jacpip install -e ".[dev]"
pytestMIT License - see LICENSE for details.