Skip to content
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

Add Style/HeredocInterpolationEscape #565

Open
nobodywasishere opened this issue Feb 14, 2025 · 0 comments
Open

Add Style/HeredocInterpolationEscape #565

nobodywasishere opened this issue Feb 14, 2025 · 0 comments
Labels

Comments

@nobodywasishere
Copy link
Contributor

Warn when escaping interpolation in heredocs to use the quoted heredoc form instead. This shouldn't warn when the heredoc is also interpolated.

<<-DOC
# ^^^^ error: Use `<<-`DOC`` instead of `<<-DOC` to automatically escape interpolation
Here is how you interpolate strings: "\#{thing}".
DOC

# Should be:
<<-'DOC'
Here is how you interpolate strings: "#{thing}".
DOC

(GitHub syntax highlighting for Crystal should probably also be updated to support this at some point, or just have them move to the tree sitter)

@Sija Sija added the rule label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants