Enforce canonical formatting with pre-commit
Install mergeway-cli and pre-commit, then add .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: mergeway-fmt
name: Canonicalize Mergeway records
entry: mergeway-cli fmt
language: system
pass_filenames: false
files: ^data/.*\.(ya?ml)$pass_filenames: false lets Mergeway derive its complete configured data set instead of receiving an arbitrary staged subset. Install and test the hook:
pre-commit install
pre-commit run mergeway-fmt --all-files
git diff --checkThe default formatter rewrites files; review and stage those changes. If a non-mutating local policy is preferred, set entry: mergeway-cli fmt --lint. See the fmt modes and CI formatting guide.