Skip to content

jaseci-labs/jac-pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jac Pre-commit Hooks

Production-ready pre-commit hooks for the Jac programming language.

Hooks

Hook Description
jac-format Formats .jac files with consistent code style
jac-check Runs type checking on .jac files

Installation

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-check

Then install the hooks:

pre-commit install

Usage

Running on All Files

pre-commit run --all-files

Running Individual Hooks

# Format only
pre-commit run jac-format --all-files

# Type check only
pre-commit run jac-check --all-files

Running Manually

You can also run the hooks directly:

# Format a file
jac format myfile.jac

# Type check a file
jac check myfile.jac

Hook Details

jac-format

Automatically 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

jac-check

Performs static type analysis on Jac files to catch type errors before runtime.

  • Modifies files: No
  • Fails on: Type errors

Requirements

Development

Testing Locally

# 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.jac

Running Tests

pip install -e ".[dev]"
pytest

License

MIT License - see LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages