Sha256: 2ec7c7dbc4da81953542dfac7865c4c78487c1f7dda0fc96aa735e49cead85a4
Contents?: true
Size: 785 Bytes
Versions: 74
Compression:
Stored size: 785 Bytes
Contents
# frozen_string_literal: true module RuboCop module Cop module Style # This cop checks for trailing inline comments. # # @example # # # good # foo.each do |f| # # Standalone comment # f.bar # end # # # bad # foo.each do |f| # f.bar # Trailing inline comment # end class InlineComment < Base MSG = 'Avoid trailing inline comments.' def on_new_investigation processed_source.comments.each do |comment| next if comment_line?(processed_source[comment.loc.line - 1]) || comment.text.match?(/\A# rubocop:(enable|disable)/) add_offense(comment) end end end end end end
Version data entries
74 entries across 74 versions & 8 rubygems