Skip to content

Commit

Permalink
fix: tweak warnings about mismatched attributes (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia authored Jan 24, 2025
1 parent bf9b6dc commit 50410b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/api/cloudflare_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func hintRecordPermission(ppfmt pp.PP, err error) {

func hintMismatchedTTL(ppfmt pp.PP, ipNet ipnet.Type, domain domain.Domain, id ID, current, expected TTL) {
ppfmt.Noticef(pp.EmojiUserWarning,
"The TTL for the %s record of %s (ID: %s) is %s. However, its TTL is expected to be %s. You can either change the TTL to %s in the Cloudflare dashboard at https://dash.cloudflare.com or change the expected TTL with TTL=%d.", //nolint:lll
"The TTL for the %s record of %s (ID: %s) is %s. However, it is expected to be %s. You can either change the TTL to %s in the Cloudflare dashboard at https://dash.cloudflare.com or change the expected TTL with TTL=%d.", //nolint:lll
ipNet.RecordType(), domain.Describe(), id,
current.Describe(), expected.Describe(), expected.Describe(), current.Int(),
)
Expand All @@ -51,7 +51,7 @@ func hintMismatchedProxied(ppfmt pp.PP, ipNet ipnet.Type, domain domain.Domain,

func hintMismatchedComment(ppfmt pp.PP, ipNet ipnet.Type, domain domain.Domain, id ID, current, expected string) {
ppfmt.Noticef(pp.EmojiUserWarning,
`The comment for %s record of %s (ID: %s) is %s. However, its comment is expected to be %s. You can either change the comment in the Cloudflare dashboard at https://dash.cloudflare.com or change the value of RECORD_COMMENT to match the current comment.`, //nolint:lll
`The comment for %s record of %s (ID: %s) is %s. However, it is expected to be %s. You can either change the comment in the Cloudflare dashboard at https://dash.cloudflare.com or change the value of RECORD_COMMENT to match the current comment.`, //nolint:lll
ipNet.RecordType(), domain.Describe(), id, DescribeFreeFormString(current), DescribeFreeFormString(expected),
)
}
Expand Down
8 changes: 4 additions & 4 deletions internal/api/cloudflare_records_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ func TestListRecords(t *testing.T) {
true,
func(ppfmt *mocks.MockPP) {
ppfmt.EXPECT().Noticef(pp.EmojiUserWarning,
"The TTL for the %s record of %s (ID: %s) is %s. However, its TTL is expected to be %s. You can either change the TTL to %s in the Cloudflare dashboard at https://dash.cloudflare.com or change the expected TTL with TTL=%d.",
"The TTL for the %s record of %s (ID: %s) is %s. However, it is expected to be %s. You can either change the TTL to %s in the Cloudflare dashboard at https://dash.cloudflare.com or change the expected TTL with TTL=%d.",
"AAAA", "sub.test.org", api.ID("record1"),
"1 (auto)", "100", "100", 1,
)
Expand All @@ -464,7 +464,7 @@ func TestListRecords(t *testing.T) {
"not proxied (DNS only)", "", "proxied",
)
ppfmt.EXPECT().Noticef(pp.EmojiUserWarning,
`The comment for %s record of %s (ID: %s) is %s. However, its comment is expected to be %s. You can either change the comment in the Cloudflare dashboard at https://dash.cloudflare.com or change the value of RECORD_COMMENT to match the current comment.`,
`The comment for %s record of %s (ID: %s) is %s. However, it is expected to be %s. You can either change the comment in the Cloudflare dashboard at https://dash.cloudflare.com or change the value of RECORD_COMMENT to match the current comment.`,
"AAAA", "sub.test.org", api.ID("record1"),
"empty", `"hello"`,
)
Expand Down Expand Up @@ -721,7 +721,7 @@ func TestUpdateRecord(t *testing.T) {
true,
func(ppfmt *mocks.MockPP) {
ppfmt.EXPECT().Noticef(pp.EmojiUserWarning,
"The TTL for the %s record of %s (ID: %s) is %s. However, its TTL is expected to be %s. You can either change the TTL to %s in the Cloudflare dashboard at https://dash.cloudflare.com or change the expected TTL with TTL=%d.",
"The TTL for the %s record of %s (ID: %s) is %s. However, it is expected to be %s. You can either change the TTL to %s in the Cloudflare dashboard at https://dash.cloudflare.com or change the expected TTL with TTL=%d.",
"AAAA", "sub.test.org", api.ID("record1"),
"1 (auto)", "200", "200", 1,
)
Expand All @@ -731,7 +731,7 @@ func TestUpdateRecord(t *testing.T) {
"not proxied (DNS only)", "", "proxied",
)
ppfmt.EXPECT().Noticef(pp.EmojiUserWarning,
`The comment for %s record of %s (ID: %s) is %s. However, its comment is expected to be %s. You can either change the comment in the Cloudflare dashboard at https://dash.cloudflare.com or change the value of RECORD_COMMENT to match the current comment.`,
`The comment for %s record of %s (ID: %s) is %s. However, it is expected to be %s. You can either change the comment in the Cloudflare dashboard at https://dash.cloudflare.com or change the value of RECORD_COMMENT to match the current comment.`,
"AAAA", "sub.test.org", api.ID("record1"),
"empty", `"hello"`,
)
Expand Down

0 comments on commit 50410b8

Please sign in to comment.