Sha256: 32840749807d7ce459ef9ae1a83ff915778e15e04f13a1800fd2fe86c891340d

Contents?: true

Size: 460 Bytes

Versions: 23

Compression:

Stored size: 460 Bytes

Contents

require 'pre-commit/checks/grep'

module PreCommit
  module Checks
    class RubySymbolHashrockets < Grep

      def files_filter(staged_files)
        staged_files.grep(/\.rb$/)
      end

      def message
        "detected :symbol => value hashrocket:"
      end

      def pattern
        '[^:](:{1}(?:\$|@|@@|[_A-Za-z])?\w*[=!?]?\s*=>\s*)'
      end

      def self.description
        "Finds ruby 1.8 '=>' hash definitions."
      end

    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pre-commit-0.40.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.39.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.38.1 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.38.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.37.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.36.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.35.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.34.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.33.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.32.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.31.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.30.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.29.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.28.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.27.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.26.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.25.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.24.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.23.0 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb
pre-commit-0.22.1 lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb