-
-
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
[Fix #365] Mark Rails/SquishedSQLHeredocs
unsafe for autocorrection
#366
Conversation
I think this cop should be aware of false positives in SQL comment line. So I think it can be resolved safely to the issue. |
I'm not sure where would be appropriate, but I think would be helpful to mention the reason somewhere, since it's safe as long as comments aren't used. |
It is also not safe when using with postgres functions, in my example in returns error when squishing |
@tejasbubane I added a suggestion documenting the rationale for this above. 🙂 |
Is this really unsafe? I think this cop can make safety by noticing SQL comment and other suggestion. I think these false positives are essential issue in the current implementation. |
Hm. We'd need to embed knowledge about several possible SQL dialects into RuboCop and also keep that up to date? 😅 |
Ah, I see. Let's separate the two issues. First, I think that it is difficult to collect SQL dialects and embed them. So, I agree with @Drenmi's opinion :-) Second, I think SQL comment (and other SQL dialects) reported in the issue can be treated (fixes the false positive). So, I think this cop can make aware of SQL comment and provide an allow list for unknown SQL dialects. This feature will be an extension different from this PR. |
…rection Closes rubocop#365
Thanks! |
Closes #365
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).and description in grammatically correct, complete sentences.
bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.