Skip to content

wangkuiyi/goyaccfmt

Repository files navigation

goyaccfmt

Build Status Go Report

goyaccfmt auto reformats goyacc source code by calling gofmt.

The following command reformats a source file a.y and outputs to stdout.

goyaccfmt a.y

For inline reformat, please use option -w.

goyaccfmt -w a.y

To the right is the difference before and after auto reformatting the grammar rule file of SQLFlow.

Usage

  • To beautify one or more files and write to stdout:

    goyaccfmt a.yaml b.yaml c.yaml
  • To beautify one or more files in the replace mode:

    goyaccfmt -w a.yaml b.yaml c.yaml
  • To beautify stdin and write to stdout:

    cat a.yaml | goyaccfmt
  • To beautify stdin and write to a file:

    cat a.yaml | goyaccfmt > b.yaml