Installation¶
Requirements¶
- Python >= 3.11
- behave-model >= 0.1.0
From PyPI¶
From source¶
git clone https://github.com/MathiasPaulenko/behave-format.git
cd behave-format
pip install -e ".[dev]"
Pre-commit hook¶
Add behave-format to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/MathiasPaulenko/behave-format
rev: v1.0.1
hooks:
- id: behave-format
Then install the hook:
Verify installation¶
Editor integration¶
VS Code¶
Add to .vscode/settings.json:
Or use a task in .vscode/tasks.json:
{
"label": "Format Feature Files",
"command": "behave-format",
"args": ["${workspaceFolder}/features/"],
"type": "shell"
}
Vim / Neovim¶
Use --stdin mode with your formatter of choice:
Any editor¶
behave-format supports --stdin mode, which reads from stdin and writes
formatted output to stdout. This works with any editor that supports
external formatters: