gherkinfmt
is a command line tool to format .feature
files which use the Gherkin language that drives Story/Feature based Behavior Driven Development.
gherkinfmt
is written in golang and is just a frontend to the go-gherkin package which covers all the parsing and formating.
$ go install github.com/muhqu/gherkinfmt
...
$ gherkinfmt -version # verify install
Grap a binary release from the releases section.
gherkinfmt OPTIONS
Formating Options
-centersteps[=false] control step alignment
-fixands[=false] successive step keywords replaced by 'And'
-nosteps[=false] hide steps
-nocomments[=false] hide comments
-noaligncomments[=false] disable auto alignment of subsequent comments
-mincommentindent=NUM use min indent for aligned comments
IO Options
-[no]color explicitly enable/disable colors
-in PATH path to input file, defaults to stdin
-out PATH path to output file, defaults to stdout
Misc Options
-version version: ...
-help this help
$ gherkinfmt -in path/to/some.feature
$ cat path/to/some.feature | gherkinfmt -centersteps
Thanks to @peppe for the util package which is used to detect whether os.Stdout
is a Terminal or not.
Thanks to @pointlander for the incredibble peg package, providing a Parser Expression Grammar Parser Generator. go-gherkin is implemented using peg.
© 2014 by Mathias Leppich github.com/muhqu, @muhqu |
|