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

Improve comment syntax suggestions #324

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

sambostock
Copy link
Contributor

This adds handling for <%- #, and clarifies that <%#= is just a comment starting with =, as opposed to some special construct.

Original Replacement Notes
<% # <%#
<%= # <%# If the = was there unintentionally, it can be removed.
<%= # <%#= If temporarily commenting out the line, with the intent of restoring it.
<%- # <%-# - affect whitespace, so we it should be kept, even if this is a comment.

This adds handling for `<%- #`, and clarifies that `<%#=` is just a
comment starting with `=`, as opposed to some special construct.
end

it "reports the suggested fixes" do
expect(subject.first.message).to(include("Bad ERB comment syntax. Should be <%# without a space between."))
expect(subject.last.message).to(include("Bad ERB comment syntax. Should be <%#= without a space between."))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I almost switched this to <%#, but I realized one might just be trying to temporarily comment something out.

 blah blah
-<%= debugging_something %>
+<%#= debugging_something %>
 blah

@sambostock sambostock marked this pull request as draft June 22, 2023 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant