class HamlLint::Linter::RubyComments

Checks for Ruby comments that can be written as HAML comments.

Public Instance Methods

visit_silent_script(node) click to toggle source
# File lib/haml_lint/linter/ruby_comments.rb, line 7
def visit_silent_script(node)
  if code_comment?(node)
    record_lint(node, 'Use `-#` for comments instead of `- #`')
  end
end

Private Instance Methods

code_comment?(node) click to toggle source
# File lib/haml_lint/linter/ruby_comments.rb, line 15
def code_comment?(node)
  node.script =~ /\A\s+#/
end