Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/judimator/augurken
Gherkin feature formatter
https://github.com/judimator/augurken
behat cucumber formatter gherkin
Last synced: 4 months ago
JSON representation
Gherkin feature formatter
- Host: GitHub
- URL: https://github.com/judimator/augurken
- Owner: judimator
- License: mit
- Created: 2024-05-03T19:35:34.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-17T17:50:39.000Z (9 months ago)
- Last Synced: 2024-05-17T18:54:47.580Z (9 months ago)
- Topics: behat, cucumber, formatter, gherkin
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Augurken is a tool to format [Gherkin](https://cucumber.io/docs/gherkin/reference) features.
Download the latest binary for your architecture [here](https://github.com/judimator/augurken/releases/latest).
```
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 commandFlags:
-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
```shell
$ augurken format /path/to/filename.feature
```Format a folder with features
```shell
$ augurken format /path/to/features
```Format a feature file with indent. Augurken uses **space** as indent
```shell
$ augurken format -i 2 /path/to/filename.feature
```⚠️ Augurken works only on `UTF-8` encoded files, it will detect and convert automatically files that are not encoded in this charset.
# Features
- Format Gherkin features
- Format JSON in step doc string
- Scenario Outline. Recognize and compact JSON inside table## Supported JSON format in step doc string
```json
{
...
"key": ,
...
}
``````json
{
...
"key1": ,
,
,
...
}
``````json
[
...
,
,
"value3",
...
]
```## Compact JSON inside table
Examples like
```gherkin
Feature: The featureScenario Outline: Compact json
Given I load data:
"""
"""
Examples:
| data |
| {"key1": "value2", "key2": "value2"} |
| [1, 2, 3] |
```become
```gherkin
Feature: The featureScenario Outline: Compact json
Given I load data:
"""
"""
Examples:
| data |
| {"key1":"value2","key2":"value2"} |
| [1,2,3] |
```If you want to add a new feature, open an issue with proposal
# Acknowledgements
Thanks [antham](https://github.com/antham) for the idea and some functions. Also, some functions got from [here](https://github.com/antham/ghokin) and official Go encoding [library](https://github.com/golang/go/tree/master/src/encoding/json)