mirror of
https://github.com/james-m-jordan/morphik-core.git
synced 2025-05-09 19:32:38 +00:00
Development Scripts
This directory contains various utility scripts for development.
Code Formatting
The project uses the following tools for code formatting:
isort
- Sorts imports alphabetically and automatically separates them into sectionsblack
- Code formatter that enforces a consistent styleruff
- Fast Python linter with auto-fixes
Automatic Formatting with Git Pre-commit Hook
The project has a Git pre-commit hook that automatically formats staged Python files in the following order:
isort
black
(with line length set to 120)ruff check --fix
The pre-commit hook is already installed and should run automatically when you commit changes.
Manual Formatting
To manually format all Python files in the project, run:
./scripts/format.sh
This script runs the same tools in the same order as the pre-commit hook, but on all Python files in the project.
Configuration
The tools are configured in the pyproject.toml
file at the root of the project. This ensures consistent formatting regardless of how the tools are invoked.