sql-lint icon indicating copy to clipboard operation
sql-lint copied to clipboard

Semicolon in string breaks linter

Open JoshMayberry opened this issue 4 years ago • 2 comments

If I have a ';' as part of a string, errors will be displayed when there is none.

For example, a file with the following contents: SELECT if (true, ";", 1) as test throws the following error: [sql-lint: unmatched-parentheses] Unmatched parentheses.

JoshMayberry avatar Jan 06 '21 16:01 JoshMayberry

Hey @JoshMayberry,

Thanks for the report, I'll look into this soon

joereynolds avatar Mar 20 '21 13:03 joereynolds

Just as an update/personal ramble to myself, I think I know of an easy quick way to fix this.

Scan backwards from the end of the string and look for the first semicolon instead of doing what we do now. I think the offending code is src/reader/reader.ts::37

joereynolds avatar Jun 24 '22 07:06 joereynolds