Skip to content

Commit

Permalink
Makefile: 'make fmtchk' prints incorrect output
Browse files Browse the repository at this point in the history
This should be clearer to the end user about where the problem is.
  • Loading branch information
kevinburkesegment committed Feb 27, 2024
1 parent ec33c71 commit f49e16b
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 10 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ generate:

.PHONY: fmtcheck
fmtchk:
go run github.com/kevinburke/differ@latest gofmt -l .
@OUTPUT=$$(gofmt -l . | grep -v vendor/); \
if [ -n "$$OUTPUT" ]; then \
echo "Some files were not gofmtted:\\n$$OUTPUT"; \
exit 1; \
fi

.PHONY: fmtfix
fmtfix:
Expand Down
3 changes: 2 additions & 1 deletion pkg/event/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package event

// entry represents a single row in the changelog
// e.g.
// {"seq":1,"family":"fam","table":"foo","key":[{"name":"id","type":"int","value":1}]}
//
// {"seq":1,"family":"fam","table":"foo","key":[{"name":"id","type":"int","value":1}]}
type entry struct {
Seq int64 `json:"seq"`
Family string `json:"family"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/executive/executive.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func newMutationRequest(famName schema.FamilyName, req ExecutiveMutationRequest)
}

// Returns the request Values as a slice in the order specified by the
//fieldOrder param. An error will be returned if a field is missing.
// fieldOrder param. An error will be returned if a field is missing.
func (r *mutationRequest) valuesByOrder(fieldOrder []schema.FieldName) ([]interface{}, error) {
values := []interface{}{}
for _, fn := range fieldOrder {
Expand Down
2 changes: 0 additions & 2 deletions pkg/ldbwriter/ldb_writer_with_changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type LDBWriterWithChangelog struct {
Seq int64
}

//
// NOTE: How does the changelog work?
//
// This is sort of the crux of how the changelog comes together. The Reflector
Expand All @@ -33,7 +32,6 @@ type LDBWriterWithChangelog struct {
// This is pretty complex, but after enumerating about 8 different options, it
// ended up actually being the most simple. Other options involved not-so-great
// options like parsing SQL or maintaining triggers on every table.
//
func (w *LDBWriterWithChangelog) ApplyDMLStatement(ctx context.Context, statement schema.DMLStatement) error {
err := w.LdbWriter.ApplyDMLStatement(ctx, statement)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/unsafe/unsafe_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !race
// +build !race

package unsafe
Expand Down
9 changes: 4 additions & 5 deletions pkg/utils/interface_slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import "reflect"
//
// - Returns empty slice if no args are passed
//
// - For a single argument which is of a slice type, the slice
// is converted and returned.
// - For a single argument which is of a slice type, the slice
// is converted and returned.
//
// - For a single argument which is not a slice type, the value is
// returned within a single-element slice.
// - For a single argument which is not a slice type, the value is
// returned within a single-element slice.
//
// - For multiple arguments, returns a slice with all the args
//
func InterfaceSlice(any ...interface{}) []interface{} {
if len(any) == 0 {
return []interface{}{}
Expand Down
1 change: 1 addition & 0 deletions pkg/version/version_go1_12.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.12
// +build go1.12

package version
Expand Down
1 change: 1 addition & 0 deletions tools.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build tools
// +build tools

package ctlstore
Expand Down

0 comments on commit f49e16b

Please sign in to comment.