You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(positions): remaining column inconsistencies after #797 #830
pkg/sql/tokenizer/tokenizer.go, readQuotedIdentifierSlow (~line 1318): the newline-terminated quoted identifier error builds its models.Location from the rune-based internal Position.Column instead of t.toSQLPosition(startPos) (byte-based). This contradicts the models.Location doc, which specifies byte columns.
The EOF branch already uses t.toSQLPosition(startPos).
Repro: x\t/* c */ é\t"ab\nc" reports column 13, but the opening quote is at byte column 14.
The same pattern exists in the unused StringLiteralReader (string_literal.go).
Fix:
Use t.toSQLPosition(startPos) in the newline branch, matching the EOF branch.
Apply the same fix in string_literal.go.
Add a multi-byte regression test that asserts the byte column.
2. L006 column alignment reports the wrong column
pkg/linter/rules/style/column_alignment.go: getIndentSize counts a tab as 4 columns and the rule reports Location.Column = indent+1. The reported column should be a byte offset.
Fix:
Keep tab = 4 when comparing indentation widths.
Report the byte offset of the first non-whitespace character, plus 1, as Location.Column.
Cross-reference: #827 (fix(tokenizer): point unterminated-literal errors at the opener...) already implements item 1 here. Its diff switches the readQuotedIdentifierSlow newline branch to t.toSQLPosition(startPos), moves string_literal.go onto the same byte-column rule, and adds multibyte/tab regression cases. It is currently conflicting with main and needs a rebase.
Not covered by #827: item 2 (L006 getIndentSize / reported column in pkg/linter/rules/style/column_alignment.go) and item 3 (the TestTokenPositions_CommentsKeepOwnPositions assertion). Item 3 is a small tokenizer-test change that #827 could absorb; item 2 can stay here. Suggest keeping this issue open for 2 (and 3 if #827 does not take it) once #827 merges.
Activity
ajitpratap0 commentedon Oct 21, 2026
Cross-reference: #827 (fix(tokenizer): point unterminated-literal errors at the opener...) already implements item 1 here. Its diff switches the
readQuotedIdentifierSlownewline branch tot.toSQLPosition(startPos), movesstring_literal.goonto the same byte-column rule, and adds multibyte/tab regression cases. It is currently conflicting with main and needs a rebase.Not covered by #827: item 2 (L006
getIndentSize/ reported column in pkg/linter/rules/style/column_alignment.go) and item 3 (theTestTokenPositions_CommentsKeepOwnPositionsassertion). Item 3 is a small tokenizer-test change that #827 could absorb; item 2 can stay here. Suggest keeping this issue open for 2 (and 3 if #827 does not take it) once #827 merges.fix(linter): report L006 column as a byte offset; tighten comment spa…