diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2019-10-16 17:54:40 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2019-10-16 17:54:40 +0300 |
commit | 31c6e181db1bb1d6d50124dcb8abfae6fb7a8d6e (patch) | |
tree | 2a6e178b468fb68b7dac279f1aec6859fbd80d9f /_support/makegen.go | |
parent | 427e0f5aa924bc310173a19cdda5b52b94b38283 (diff) |
Add go brace whitespace formatter
Diffstat (limited to '_support/makegen.go')
-rw-r--r-- | _support/makegen.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/_support/makegen.go b/_support/makegen.go index 3a076317a..6849464f4 100644 --- a/_support/makegen.go +++ b/_support/makegen.go @@ -72,6 +72,7 @@ func (gm *gitalyMake) BuildDir() string { func (gm *gitalyMake) Pkg() string { return "gitlab.com/gitlab-org/gitaly" } func (gm *gitalyMake) GoImports() string { return "bin/goimports" } +func (gm *gitalyMake) BraceFmt() string { return filepath.Join(gm.BuildDir(), "bin/bracefmt") } func (gm *gitalyMake) GoCovMerge() string { return "bin/gocovmerge" } func (gm *gitalyMake) GoLint() string { return "bin/golint" } func (gm *gitalyMake) GoVendor() string { return "bin/govendor" } @@ -249,7 +250,7 @@ func (gm *gitalyMake) GoFiles() []string { } } - if !info.IsDir() && strings.HasSuffix(path, ".go") { + if !info.IsDir() && strings.HasSuffix(path, ".go") && !strings.HasSuffix(path, ".pb.go") { rel, err := filepath.Rel(root, path) if err != nil { return err @@ -309,6 +310,10 @@ func (gm *gitalyMake) ProtoCSHA256() string { return protoCDownload[runtime.GOOS+"/"+runtime.GOARCH].sha256 } +func (gm *gitalyMake) MakeFormatCheck() string { + return `awk '{ print } END { if(NR>0) { print "Formatting error, run make format"; exit(1) } }'` +} + var templateText = func() string { contents, err := ioutil.ReadFile("../_support/Makefile.template") if err != nil { |