Sha256: 04c83923d4ffef4e7f192eb4084dda86a6e293369be2a3860ddabbc34e77662b

Contents?: true

Size: 400 Bytes

Versions: 12

Compression:

Stored size: 400 Bytes

Contents

# encoding: utf-8

module Rubocop
  module Cop
    class AvoidPerlBackrefs < Cop
      def inspect(file, source, tokens, sexp)
        each(:@backref, sexp) do |s|
          backref = s[1]
          lineno = s[2].lineno

          add_offence(
            :convention,
            lineno,
            "Prefer the use of MatchData over #{backref}."
          )
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rubocop-0.7.2 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.7.1 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.7.0 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.6.1 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.6.0 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.5.0 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.4.6 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.4.5 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.4.4 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.4.3 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.4.2 lib/rubocop/cop/avoid_perl_backrefs.rb
rubocop-0.4.1 lib/rubocop/cop/avoid_perl_backrefs.rb