Skip to content

Commit 3a996da

Browse files
committed
fix: remove erroneous "+1"
Signed-off-by: Joseph Kato <joseph@jdkato.io>
1 parent fdaa335 commit 3a996da

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

internal/lint/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func findBestLineBySubstring(s, sub string) (int, string) {
2727
distance := strutil.Similarity(line, sub, metric)
2828
if bestMatchLine == -1 || distance < bestMatchDistance {
2929
bestMatchDistance = distance
30-
bestMatchLine = i + 1
30+
bestMatchLine = i
3131
bestMatch = line
3232
}
3333
}

testdata/features/frontmatter.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ Feature: Frontmatter
4545
test.rst:87:10:vale.Annotations:'TODO' left in text
4646
test2.md:2:8:Meta.Title:'How the SDK works' should be in title case
4747
test2.md:5:3:vale.Annotations:'TODO' left in text
48+
test3.md:2:8:Meta.Title:'castle' should be in title case
4849
"""
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: castle
3+
tags: ["castle", "gitlab", "sonarqube"]
4+
weight: 8
5+
---
6+
7+
## Intro
8+
9+
Hello guys ! I love a CASTLE.

0 commit comments

Comments
 (0)