-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Can't use EOF heredoc #5403
Comments
It looks like it is trying to disallow "END" and "EO[A-Z]" like the message says. I found "EOF" in an AllowedAcronyms list, but I think that list applies only to |
The rule doesn't allow anything starting with
|
This would block all 3-char delimiters starting with |
[Fix rubocop#5403] consolidating the patterns into one regexp
Created #5712 to fix this. Tests passed, also works fine in my local |
If you want to use |
Ok, so it isn't related to the acronyms list, they just reside next to each other because they belong to the same category. Ok, I'll change the code accordingly. However, the current implementation doesn't allow to have any delimiter starting or even containing |
The rationale is it's an "empty" delimiter, which doesn't help provide context for what the contents of the string is. Compare: foo = <<-EOF
...
EOF to: foo = <<-SQL
...
SQL or:
In both the latter cases, you get an idea of what this string is, even without looking at the content or the variable name. In the case of |
The problem with the current definition is, that it even faults something like this just because it contains the banned pattern:
as well as
My change would limit it to just ban a solely used |
I've changed the pattern to include |
Oh. Yes. This is definitely not intended. Good catch! 🙂 |
Thx for the merge, couldn't get back to it earlier. |
In the docs it says:
But in the AllowedAcronyms' table, it says that EOF is allowed, but in fact, it isn't. When I try to use EOF, it says:
But I am not sure if I misunderstood it.
The text was updated successfully, but these errors were encountered: