• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uber / cadence / 018e1aa9-b112-4b5e-a137-732317ef6b1b
72%

Build:
DEFAULT BRANCH: master
Ran 07 Mar 2024 09:11PM UTC
Jobs 1
Files 670
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Mar 2024 08:45PM UTC coverage: 63.932% (-0.03%) from 63.962%
018e1aa9-b112-4b5e-a137-732317ef6b1b

push

buildkite

web-flow
Enforce leading space on comments (#5747)

# What

Changes all comments like this:
```go
//stuff
type thing struct {
  field string //comment
}
//go:embed directives are left alone
```
To this:
```go
// stuff
type thing struct {
  field string // comment
}
//go:embed directives are left alone
```
And added a fairly basic lint check to prevent them from coming back.
The lint check is imprecise and doesn't catch comments at the ends of non-blank lines of code,
but fixing that seemed like much more work than it was worth.

And, since this will likely neutralize a `//nolint` comment that wasn't doing anything anyway,
I've removed that one comment entirely to avoid being misleading.

# How

"Starts with X but not followed by Y" is famously hard for regex, so I only tried briefly with sed / perl before giving up.
So instead I just had Goland format the entire repository, and undid anything that wasn't a Go file.

Somewhat surprisingly, all it did was add these spaces.  Which is perfect.
Oddly it missed a single obvious one, but I'm willing to forgive it for that.

# Why

IDEs often do this when formatting files, which is thrashing a bit.

gofmt (and therefore goimports) in theory doesn't actually care... but despite their
protestations about not caring about comment formatting in github issues, Go's
source-printer and therefore gofmt *does* treat some comments specially, most notably
"directives" like `go:build`: https://cs.opensource.google/go/go/+/refs/tags/go1.22.1:src/go/printer/comment.go;l=15
and anything that might be a "doc comment" may get restructured too:
```diff
diff --git cmd/server/main.go cmd/server/main.go
index 6af56db58..b857f9211 100644
--- cmd/server/main.go
+++ cmd/server/main.go
@@ -35,6 +35,14 @@ import (
 )

 // main entry point for the cadence server
+//go:build
+// did you know
+//go:link
+// that go special
+//cases:things
+// that use
+//go:embed
+// specific comment struc... (continued)

22 of 46 new or added lines in 21 files covered. (47.83%)

88 existing lines in 14 files now uncovered.

93723 of 146599 relevant lines covered (63.93%)

2378.26 hits per line

Jobs
ID Job ID Ran Files Coverage
1 018e1aa9-b112-4b5e-a137-732317ef6b1b.1 07 Mar 2024 09:11PM UTC 0
63.93
Source Files on build 018e1aa9-b112-4b5e-a137-732317ef6b1b
Detailed source file information is not available for this build.
  • Back to Repo
  • 233b3ef3 on github
  • Prev Build on master (#018E1A84...)
  • Next Build on master (#018E1ACA...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc