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/HeredocEscape #580

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nobodywasishere
Copy link
Contributor

Closes #565

@Sija Sija added the rule label Feb 20, 2025
@Sija Sija added this to the 1.7.0 milestone Feb 20, 2025
@nobodywasishere nobodywasishere marked this pull request as ready for review February 27, 2025 14:28

def test(source, node : Crystal::StringInterpolation)
return unless (code = node_source(node, source.lines)) && code.starts_with?("<<-")
# Heredocs without interpolation are always size 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment contradicts the final test case:

it "fails if an escaped heredoc doesn't contain interpolation"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That testcase is checking if you have an escaped heredoc start that's unnecessary (by not having #{} or escape sequences)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Style/HeredocInterpolationEscape
2 participants