Skip to content

Commit

Permalink
fix: exiting with error if formatters fail
Browse files Browse the repository at this point in the history
Subtle bug where the formatError flag was getting reset.

Signed-off-by: Brian McGee <[email protected]>
  • Loading branch information
brianmcgee committed Nov 29, 2024
1 parent d5a39b0 commit dcb9d3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion format/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (s *scheduler) schedule(ctx context.Context, key batchKey, batch []*walk.Fi
hasErrors := len(formatErrors) > 0

// update overall error tracking
s.formatError.Store(hasErrors)
s.formatError.CompareAndSwap(false, hasErrors)

if !hasErrors {
// record that the file was formatted
Expand Down

0 comments on commit dcb9d3b

Please sign in to comment.