Skip to content

Formatter for CockroachDB's additions to the Go style guide.

License

Notifications You must be signed in to change notification settings

cameronnunez/crlfmt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crlfmt

crlfmt is a gofmt-style linter for Go code that enforces the CockroachDB Style Guide found here.

Usage

$ go install github.com/cockroachdb/crlfmt
$ crlfmt [flags] <file path>

Flags:
  -diff             print diffs (default true)
  -fast             skip running goimports and simplify
  -groupimports     group imports by type (default true)
  -ignore <string>  regex matching files to skip
  -tab <int>        tab width for column calculations (default 2)
  -w                overwrite modified files
  -wrap <int>       column to wrap at (default 100)

Examples

If you are running crlfmt on the http://github.com/cockroachdb/cockroach codebase, you can use the following command to reformat all files in the current directory, ignoring generated code files:

$ crlfmt -w -ignore '\.(pb(\.gw)?)|(\.[eo]g)\.go|/testdata/|^sql/parser/sql\.go$|_generated\.go$' .

About

Formatter for CockroachDB's additions to the Go style guide.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%