Skip to content

Commit

Permalink
style: remove all periods from error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Aug 11, 2022
1 parent 95c8f5b commit a7d0ac4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions internal/monitor/healthchecks.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func SetHealthChecksMaxRetries(maxRetries int) HealthChecksOption {
func NewHealthChecks(ppfmt pp.PP, rawURL string, os ...HealthChecksOption) (Monitor, bool) {
url, err := url.Parse(rawURL)
if err != nil {
ppfmt.Errorf(pp.EmojiUserError, "Failed to parse the Healthchecks.io URL (redacted).")
ppfmt.Errorf(pp.EmojiUserError, "Failed to parse the Healthchecks.io URL (redacted)")
return nil, false
}

Expand Down Expand Up @@ -134,13 +134,13 @@ func (h *HealthChecks) ping(ctx context.Context, ppfmt pp.PP, endpoint string) b
return false
}

ppfmt.Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io.", endpointDescription)
ppfmt.Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io", endpointDescription)
return true
}

ppfmt.Warningf(
pp.EmojiError,
"Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io in %d time(s).",
"Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io in %d time(s)",
endpointDescription, h.MaxRetries)
return false
}
Expand All @@ -159,7 +159,7 @@ func (h *HealthChecks) Failure(ctx context.Context, ppfmt pp.PP) bool {

func (h *HealthChecks) ExitStatus(ctx context.Context, ppfmt pp.PP, code int) bool {
if code < 0 || code > 255 {
ppfmt.Errorf(pp.EmojiImpossible, "Exit code (%i) not within the range 0-255.", code)
ppfmt.Errorf(pp.EmojiImpossible, "Exit code (%i) not within the range 0-255", code)
return false
}

Expand Down
16 changes: 8 additions & 8 deletions internal/monitor/healthchecks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestNewHealthChecksFail2(t *testing.T) {

mockCtrl := gomock.NewController(t)
mockPP := mocks.NewMockPP(mockCtrl)
mockPP.EXPECT().Errorf(pp.EmojiUserError, "Failed to parse the Healthchecks.io URL (redacted).")
mockPP.EXPECT().Errorf(pp.EmojiUserError, "Failed to parse the Healthchecks.io URL (redacted)")
_, ok := monitor.NewHealthChecks(mockPP, "://#?")
require.False(t, ok)
}
Expand Down Expand Up @@ -125,7 +125,7 @@ func TestEndPoints(t *testing.T) {
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io: %v", `default (root)`, gomock.Any()), //nolint:lll
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io.", `default (root)`), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io", `default (root)`), //nolint:lll
)
},
},
Expand Down Expand Up @@ -161,7 +161,7 @@ func TestEndPoints(t *testing.T) {
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io: %v", `default (root)`, gomock.Any()), //nolint:lll
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io in %d time(s).", `default (root)`, 3), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io in %d time(s)", `default (root)`, 3), //nolint:lll
)
},
},
Expand All @@ -178,7 +178,7 @@ func TestEndPoints(t *testing.T) {
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io: %v", `"/start"`, gomock.Any()), //nolint:lll
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io.", `"/start"`), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io", `"/start"`), //nolint:lll
)
},
},
Expand All @@ -195,7 +195,7 @@ func TestEndPoints(t *testing.T) {
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io: %v", `"/fail"`, gomock.Any()), //nolint:lll
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io.", `"/fail"`), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io", `"/fail"`), //nolint:lll
)
},
},
Expand All @@ -212,7 +212,7 @@ func TestEndPoints(t *testing.T) {
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io: %v", `"/0"`, gomock.Any()), //nolint:lll
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io.", `"/0"`), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io", `"/0"`), //nolint:lll
)
},
},
Expand All @@ -229,7 +229,7 @@ func TestEndPoints(t *testing.T) {
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Warningf(pp.EmojiError, "Failed to send HTTP(S) request to the %s endpoint of Healthchecks.io: %v", `"/1"`, gomock.Any()), //nolint:lll
m.EXPECT().Infof(pp.EmojiRepeatOnce, "Trying again . . ."), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io.", `"/1"`), //nolint:lll
m.EXPECT().Infof(pp.EmojiNotification, "Successfully pinged the %s endpoint of Healthchecks.io", `"/1"`), //nolint:lll
)
},
},
Expand All @@ -241,7 +241,7 @@ func TestEndPoints(t *testing.T) {
nil,
false, false,
func(m *mocks.MockPP) {
m.EXPECT().Errorf(pp.EmojiImpossible, "Exit code (%i) not within the range 0-255.", -1)
m.EXPECT().Errorf(pp.EmojiImpossible, "Exit code (%i) not within the range 0-255", -1)
},
},
} {
Expand Down
6 changes: 3 additions & 3 deletions internal/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func detectIP(ctx context.Context, ppfmt pp.PP, c *config.Config, ipNet ipnet.Ty
MessageShouldDisplay[ipNet] = false
switch ipNet {
case ipnet.IP6:
ppfmt.Infof(pp.EmojiConfig, "If you are using Docker, Kubernetes, or other frameworks, IPv6 networks often require additional setups.") //nolint:lll
ppfmt.Infof(pp.EmojiConfig, "Read more about IPv6 networks in the README at https://github.com/favonia/cloudflare-ddns") //nolint:lll
ppfmt.Infof(pp.EmojiConfig, "If your network does not support IPv6, you can disable IPv6 with IP6_PROVIDER=none") //nolint:lll
ppfmt.Infof(pp.EmojiConfig, "If you are using Docker, Kubernetes, or other frameworks, IPv6 networks often require additional setups") //nolint:lll
ppfmt.Infof(pp.EmojiConfig, "Read more about IPv6 networks in the README at https://github.com/favonia/cloudflare-ddns") //nolint:lll
ppfmt.Infof(pp.EmojiConfig, "If your network does not support IPv6, you can disable IPv6 with IP6_PROVIDER=none") //nolint:lll
case ipnet.IP4:
ppfmt.Infof(pp.EmojiConfig, "If your network does not support IPv4, you can disable IPv4 with IP4_PROVIDER=none") //nolint:lll
}
Expand Down
12 changes: 6 additions & 6 deletions internal/updater/updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ func TestUpdateIPs(t *testing.T) {
gomock.InOrder(
m.EXPECT().Infof(pp.EmojiInternet, "Detected the %s address: %v", "IPv4", ip4),
m.EXPECT().Errorf(pp.EmojiError, "Failed to detect the %s address", "IPv6"),
m.EXPECT().Infof(pp.EmojiConfig, "If you are using Docker, Kubernetes, or other frameworks, IPv6 networks often require additional setups."), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "Read more about IPv6 networks in the README at https://github.com/favonia/cloudflare-ddns"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "If your network does not support IPv6, you can disable IPv6 with IP6_PROVIDER=none"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "If you are using Docker, Kubernetes, or other frameworks, IPv6 networks often require additional setups"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "Read more about IPv6 networks in the README at https://github.com/favonia/cloudflare-ddns"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "If your network does not support IPv6, you can disable IPv6 with IP6_PROVIDER=none"), //nolint:lll
)
},
mockmap{
Expand Down Expand Up @@ -188,9 +188,9 @@ func TestUpdateIPs(t *testing.T) {
m.EXPECT().Errorf(pp.EmojiError, "Failed to detect the %s address", "IPv4"),
m.EXPECT().Infof(pp.EmojiConfig, "If your network does not support IPv4, you can disable IPv4 with IP4_PROVIDER=none"), //nolint:lll
m.EXPECT().Errorf(pp.EmojiError, "Failed to detect the %s address", "IPv6"),
m.EXPECT().Infof(pp.EmojiConfig, "If you are using Docker, Kubernetes, or other frameworks, IPv6 networks often require additional setups."), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "Read more about IPv6 networks in the README at https://github.com/favonia/cloudflare-ddns"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "If your network does not support IPv6, you can disable IPv6 with IP6_PROVIDER=none"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "If you are using Docker, Kubernetes, or other frameworks, IPv6 networks often require additional setups"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "Read more about IPv6 networks in the README at https://github.com/favonia/cloudflare-ddns"), //nolint:lll
m.EXPECT().Infof(pp.EmojiConfig, "If your network does not support IPv6, you can disable IPv6 with IP6_PROVIDER=none"), //nolint:lll
)
},
mockmap{
Expand Down

0 comments on commit a7d0ac4

Please sign in to comment.