Skip to content

Commit

Permalink
More minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
acamadeo committed Nov 29, 2023
1 parent fc0804c commit 0953c5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions rules/aip0192/closed_backticks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions rules/aip0192/closed_backticks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},

Expand Down

0 comments on commit 0953c5b

Please sign in to comment.