Formatter for Gherkin language
Project description
Reformat-gherkin
Table of Contents
About
This tool is a formatter for Gherkin files. It ensures consistent look regardless of the project and authors.
reformat-gherkin
can be used either as a command-line tool, or a pre-commit
hook.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
Installing
-
Clone this repository
git clone https://github.com/ducminh-phan/reformat-gherkin.git
-
Install dependencies
poetry install
Usage
Usage: reformat-gherkin [OPTIONS] [SRC]...
Reformat the given Gherkin files and all files in the given directories
recursively.
Options:
--check Don't write the files back, just return the
status. Return code 0 means nothing would
change. Return code 1 means some files would
be reformatted. Return code 123 means there
was an internal error.
-a, --alignment [left|right] Specify the alignment of step keywords (Given,
When, Then,...). If specified, all statements
after step keywords are left-aligned, spaces
are inserted before/after the keywords to
right/left align them. By default, step
keywords are left-aligned, and there is a
single space between the step keyword and the
statement.
--fast / --safe If --fast given, skip the sanity checks of
file contents. [default: --safe]
--version Show the version and exit.
--help Show this message and exit.
Pre-commit hook
Once you have installed pre-commit, add this to the .pre-commit-config.yaml
in your repository:
repos:
- repo: https://github.com/ducminh-phan/reformat-gherkin
rev: stable
hooks:
- id: reformat-gherkin
Then run pre-commit install
and you're ready to go.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
reformat-gherkin-0.2.3.tar.gz
(15.0 kB
view hashes)
Built Distribution
Close
Hashes for reformat_gherkin-0.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 568097491597fbd370c20c38873552e05219ee35663d2f48dc05a6921459b68d |
|
MD5 | 41858d60ded7153d538ae8464f8b58f0 |
|
BLAKE2b-256 | a4bfa6451c971bdfcb1bdb255773d06c735be25fb3e9a2cad58120673110f064 |