Sha256: f1a85288dece2bff68e2538b9f1f2504958fa55fee1343e46e1a2148e3124056
Contents?: true
Size: 594 Bytes
Versions: 11
Compression:
Stored size: 594 Bytes
Contents
# frozen_string_literal: true module SlimLint # Searches for control statements with only comments. class Linter::CommentControlStatement < Linter include LinterRegistry on [:slim, :control] do |sexp| _, _, code = sexp next unless code[/\A\s*#/] comment = code[/\A\s*#(.*\z)/, 1] next if comment =~ /^\s*rubocop:\w+/ next if comment =~ /^\s*Template Dependency:/ report_lint(sexp, "Slim code comments (`/#{comment}`) are preferred over " \ "control statement comments (`-##{comment}`)") end end end
Version data entries
11 entries across 11 versions & 1 rubygems