Skip to content

Contrib and Codebase Guide#

General Setup and Information#

To get setup run

# Install black
pip3 install pre-commit
pre-commit install

To understand our linting and mypy type checking have a look at our pre-commit actions. You can set up your enviornment accordingly. For help interpreting this if you need it, call upon our friend Mr. ChatGPT or one of his colleagues.

Our pre-commit process
exclude: '(_v1|vendor|larkparse|jac/examples|tests|support|setup.py|jac-mtllm|langserve/tests|pygame_mock)'
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
      - id: check-yaml
        args: [--allow-multiple-documents]
      - id: check-json
      - id: trailing-whitespace
  - repo: https://github.com/psf/black
    rev: 24.8.0
    hooks:
      - id: black
  - repo: https://github.com/PyCQA/flake8
    rev: 7.2.0
    hooks:
      - id: flake8
        args: ["--config=.flake8"]
        additional_dependencies:
          [
            pep8-naming,
            flake8_import_order,
            flake8_docstrings,
            flake8_comprehensions,
            flake8_bugbear,
            flake8_annotations,
            flake8_simplify,
          ]
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.15.0
    hooks:
      - id: mypy
        args:
          - --follow-imports=silent
          - --ignore-missing-imports
          - --install-types
          - --non-interactive
        additional_dependencies: [types-PyYAML]

This is how we run checks on demand.

pre-commit run --all-files

This is how we run our tests.

pytest -n 30 jac
pytest jac-splice-orc
pytest jac-cloud

Run docs site locally#

This is how we run the docs

cd jac/docs
pip install -e .
mkdocs serve

This is how we kill the docs if it dies for some reason

lsof -i :8000 -t | xargs -r kill -9

Build VSCode Extention#

cd jac/support/vscode_ext/jac
npm install
npm install -g @vscode/vsce
vsce package
# code --install-extension jaclang-*.vsix
cursor --install-extension jaclang-*.vsix
cd -