Augurken is a tool to format Gherkin features.
Download the latest binary for your architecture here.
Usage:
augurken [command]
Available Commands:
check Check formatting of gherkin file(s)
completion Generate the autocompletion script for the specified shell
format Format gherkin file(s)
help Help about any command
Flags:
-h, --help help for augurken
-i, --indent int set the indentation for Gherkin features (default 2)
-v, --version version for augurken
Use "augurken [command] --help" for more information about a command.
Format a feature file
$ augurken format /path/to/filename.feature
Format a folder with features
$ augurken format /path/to/features
Format a feature file with indent. Augurken uses space as indent
$ augurken format -i 2 /path/to/filename.feature
UTF-8
encoded files, it will detect and convert automatically files that are not encoded in this charset.
- Format Gherkin features
- Format JSON in step doc string
- Scenario Outline. Recognize and compact JSON inside table
{
...
"key": <value>,
...
}
{
...
"key1": <value1>,
<placeholder1>,
<placeholder2>,
...
}
[
...
<value1>,
<value2>,
"value3",
...
]
Examples like
Feature: The feature
Scenario Outline: Compact json
Given I load data:
"""
<data>
"""
Examples:
| data |
| {"key1": "value2", "key2": "value2"} |
| [1, 2, 3] |
become
Feature: The feature
Scenario Outline: Compact json
Given I load data:
"""
<data>
"""
Examples:
| data |
| {"key1":"value2","key2":"value2"} |
| [1,2,3] |
If you want to add a new feature, open an issue with proposal
Thanks antham for the idea and some functions. Also, some functions got from here and official Go encoding library