-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails/SquishedSQLHeredocs not safe for autocorrect #365
Labels
enhancement
New feature or request
Comments
tejasbubane
added a commit
to tejasbubane/rubocop-rails
that referenced
this issue
Sep 30, 2020
…rection Closes rubocop#365
9 tasks
tejasbubane
added a commit
to tejasbubane/rubocop-rails
that referenced
this issue
Nov 23, 2020
…rection Closes rubocop#365
tejasbubane
added a commit
to tejasbubane/rubocop-rails
that referenced
this issue
Nov 23, 2020
…rection Closes rubocop#365
tejasbubane
added a commit
to tejasbubane/rubocop-rails
that referenced
this issue
Nov 23, 2020
…rection Closes rubocop#365
tejasbubane
added a commit
to tejasbubane/rubocop-rails
that referenced
this issue
Nov 24, 2020
…rection Closes rubocop#365
koic
added a commit
that referenced
this issue
Nov 24, 2020
[Fix #365] Mark `Rails/SquishedSQLHeredocs` unsafe for autocorrection
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is currently unsafe for
rubocop -a
to add.squish
on SQL heredocs. SQL codein Postgresql breaks when those containing new line comments are squished.
Current code for squishing doesn't address
--
-type comments:Expected behavior
When a SQL string has a comment,
.squish
is not appropriate:For example, when we have some code like so:
rubocop -a
should not add.squish
:Actual behavior
rubocop -a
adds a.squish
for SQL with comments:Squishing of comments starting with
--
leads to Postgresql complaining. See article on Postgresql about how comments starting with--
should have a line break after it:Steps to reproduce the problem
Put this in
reproduce_squish_issue.rb
:Then run
rubocop -a --only Rails/SquishedSQLHeredocs reproduce_squish_issue.rb
RuboCop version
The text was updated successfully, but these errors were encountered: