Lint to forbid single-line comments in .squish
ed SQL heredocs
#1273
Labels
bug
Something isn't working
.squish
ed SQL heredocs
#1273
Is your feature request related to a problem? Please describe.
The Rails/SquishedSQLHeredocs lint requires SQL heredocs to be
.squish
ed, which, as the docs mention, can change the meaning of the statement, especially when it contains single-line comments. Consider the following snippet:If you're aware of this lint, you're probably writing
<<-SQL.squish
by default, and might not think about how it would affect your SQL.Describe the solution you'd like
I think there should be a lint to forbid single-line comments in squished SQL heredocs. There are three reasons why they might exist:
I assume that the biggest challenge with implementing this would be parsing the SQL, especially considering the possibility of string interpolation.
Describe alternatives you've considered
Expect users not to make this mistake.
The text was updated successfully, but these errors were encountered: