@@ -54,8 +54,10 @@ Gherkin Utils is [available on Maven Central](https://central.sonatype.com/artif
5454
5555## Command line
5656
57+ Running Gherkin Utils from the command line provides formatting and conversion features.
58+
5759``` bash
58- - > npx @cucumber/gherkin-utils format features
60+ > npx @cucumber/gherkin-utils format features
5961❌ 7 files failed to format
6062🥒 14 files left unchanged
6163🥒 25 files reformatted
@@ -102,9 +104,9 @@ This module can also be used as a library. It provides two main utilities, `pret
102104This function takes a GherkinDocument as input and returns a pretty-printed representation in Gherkin or Markdown.
103105
104106``` javascript
105- import { AstBuilder , GherkinClassicTokenMatcher ,Parser } from " @cucumber/gherkin" ;
106- import { pretty } from " @cucumber/gherkin-utils"
107- import { IdGenerator } from " @cucumber/messages"
107+ import { AstBuilder , GherkinClassicTokenMatcher , Parser } from ' @cucumber/gherkin'
108+ import { pretty } from ' @cucumber/gherkin-utils'
109+ import { IdGenerator } from ' @cucumber/messages'
108110
109111const uuidFn = IdGenerator .uuid ()
110112
@@ -126,7 +128,7 @@ Feature:
126128 Given step text
127129
128130*/
129- const formattedGherkinMarkdownFeature = pretty (gherkinDocument, " markdown" )
131+ const formattedGherkinMarkdownFeature = pretty (gherkinDocument, ' markdown' )
130132/*
131133# Feature:
132134
@@ -156,22 +158,19 @@ By default, all elements are accepted, which means that if you want to do filter
156158Here's an example:
157159
158160``` typescript
159- import { GherkinDocumentWalker , rejectAllFilters } from " @cucumber/gherkin-utils"
161+ import { GherkinDocumentWalker , rejectAllFilters } from ' @cucumber/gherkin-utils' ;
160162
161163// Only keeps scenarios which name include 'magic'
162164const filter = new GherkinDocumentWalker ({
163165 ... rejectAllFilters ,
164- ... { acceptScenario : (scenario ) => scenario .name .includes (" magic" ) },
166+ ... { acceptScenario : (scenario ) => scenario .name .includes (' magic' ) },
165167})
166168
167169// Makes a list with all the scenario names
168- const allScenarioNames: string [] = [];
169- const scenarioNameFinder = new GherkinDocumentWalker (
170- {},
171- {
172- handleScenario : (scenario ) => allScenarioNames .push (scenario .name ),
173- }
174- )
170+ const allScenarioNames: string [] = []
171+ const scenarioNameFinder = new GherkinDocumentWalker ({}, {
172+ handleScenario : (scenario ) => allScenarioNames .push (scenario .name ),
173+ })
175174```
176175
177176## Feedback
0 commit comments