From 0953c5b6900da750c2539586a62915e820dae672 Mon Sep 17 00:00:00 2001 From: Anthony Amadeo Date: Wed, 29 Nov 2023 14:37:52 +0000 Subject: [PATCH] More minor edits --- rules/aip0192/closed_backticks.go | 8 ++++---- rules/aip0192/closed_backticks_test.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rules/aip0192/closed_backticks.go b/rules/aip0192/closed_backticks.go index 0d0f6a564..621558f9d 100644 --- a/rules/aip0192/closed_backticks.go +++ b/rules/aip0192/closed_backticks.go @@ -70,10 +70,10 @@ var closedBackticks = &lint.DescriptorRule{ backticks = append(backticks, backtickAtIndex(line, loc[0])) } - // Compute whether the backticks are paired. + // Compute which backticks are paired. backticks = computeBacktickPairs(filterUnusableBackticks(backticks)) - // Add a problem for each backtick that is missing a pair. + // Add a problem for any backtick that is missing a pair. for _, backtick := range backticks { if backtick.pair != paired { problems = append(problems, lint.Problem{ @@ -110,7 +110,7 @@ func filterUnusableBackticks(backticks []backtick) []backtick { // Compute whether each backtick is paired with an adjacent backtick. // -// A backtick pair consists of a set of adjacent backticks, where the first is +// A backtick pair consists of two adjacent backticks, where the first is // opening and the second is closing. Each backtick can be in at most one pair. // // This fills in the `pair` field for each backtick. It assumes every backtick @@ -122,7 +122,7 @@ func computeBacktickPairs(backticks []backtick) []backtick { for i, backtick := range backticks { backtick.pair = computePairState(backtick, prevBacktickOpen) - // If this backtick got paired, mark the previous one as paired as well. + // If this backtick got paired, mark the previous one paired as well. if backtick.pair == paired { computed[i-1].pair = paired } diff --git a/rules/aip0192/closed_backticks_test.go b/rules/aip0192/closed_backticks_test.go index 4f0fa33f0..a0831b267 100644 --- a/rules/aip0192/closed_backticks_test.go +++ b/rules/aip0192/closed_backticks_test.go @@ -58,10 +58,10 @@ func TestClosedBackticks(t *testing.T) { {"MissingFrontBacktickComma", "name`, a string", testutils.Problems{{Suggestion: "`name`"}}}, {"MissingBackBacktickComma", "`name, a string", testutils.Problems{{Suggestion: "`name`"}}}, - {"ValidMultipleCodeText", "`name`: `string`", nil}, - {"MissingFrontBacktickMultipleCodeText", "name`: string`", testutils.Problems{{Suggestion: "`name`"}, {Suggestion: "`string`"}}}, - {"MissingBackBacktickMultipleCodeText", "`name: `string", testutils.Problems{{Suggestion: "`name`"}, {Suggestion: "`string`"}}}, - {"MissingFrontAndBackBacktickMultipleCodeText", "name`: `string", testutils.Problems{{Suggestion: "`name`"}, {Suggestion: "`string`"}}}, + {"ValidMultipleInlineCode", "`name`: `string`", nil}, + {"MissingFrontBacktickMultipleInlineCode", "name`: string`", testutils.Problems{{Suggestion: "`name`"}, {Suggestion: "`string`"}}}, + {"MissingBackBacktickMultipleInlineCode", "`name: `string", testutils.Problems{{Suggestion: "`name`"}, {Suggestion: "`string`"}}}, + {"MissingFrontAndBackBacktickMultipleInlineCode", "name`: `string", testutils.Problems{{Suggestion: "`name`"}, {Suggestion: "`string`"}}}, {"ValidContainsColon", "`name: string`", nil},