Sha256: 8e47c90c5fb25e6000b2d836c8a6c15a6a3005602cc8db915a4fce1a0013b1a1

Contents?: true

Size: 464 Bytes

Versions: 4

Compression:

Stored size: 464 Bytes

Contents

require 'pre-commit/checks/grep'

module PreCommit
  module Checks
    class ConsoleLog < Grep

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

      def extra_grep
        " | grep -v \/\/"
      end

      def message
        "console.log found:\n"
      end

      def pattern
        '-e "console\\.log"'
      end

      def self.description
        "Finds javascript files with 'console.log'."
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pre-commit-0.15.0 lib/plugins/pre_commit/checks/console_log.rb
pre-commit-0.14.1 lib/plugins/pre_commit/checks/console_log.rb
pre-commit-0.14.0 lib/plugins/pre_commit/checks/console_log.rb
pre-commit-0.13.0 lib/plugins/pre_commit/checks/console_log.rb