1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2026-01-18 11:11:08 +00:00
alejandra/integrations/pre-commit/README.md
2024-11-03 19:52:05 -07:00

25 lines
715 B
Markdown

# Pre-Commit integration
In order to use Alejandra with
[Pre-Commit](https://pre-commit.com/)
just create a file named `.pre-commit-config.yaml`
with contents:
```yaml
repos:
- repo: https://github.com/kamadorueda/alejandra
rev: 3.1.0
# Choose either the 'alejandra' or 'alejandra-system' hook
# depending on what pre-requisites you have:
hooks:
# No prerequisites
- id: alejandra
# Requires Nix to be previously installed in the system
- id: alejandra-nix
# Requires Alejandra to be previously installed in the system
- id: alejandra-system
```
To use the latest hook, run `pre-commit autoupdate --freeze --repo=https://github.com/kamadorueda/alejandra`.