pre-commit 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +2 -3
  3. data/bin/pre-commit +1 -2
  4. data/lib/pre-commit/checks/ci_check.rb +3 -42
  5. data/lib/pre-commit/checks/closure_check.rb +13 -0
  6. data/lib/pre-commit/checks/console_log_check.rb +11 -0
  7. data/lib/pre-commit/checks/debugger_check.rb +5 -42
  8. data/lib/pre-commit/checks/gemfile_path_check.rb +12 -0
  9. data/lib/pre-commit/checks/js_check.rb +10 -36
  10. data/lib/pre-commit/checks/jshint_check.rb +9 -18
  11. data/lib/pre-commit/checks/jslint_check.rb +4 -21
  12. data/lib/pre-commit/checks/local_check.rb +4 -21
  13. data/lib/pre-commit/checks/merge_conflict_check.rb +10 -0
  14. data/lib/pre-commit/checks/migration_check.rb +5 -32
  15. data/lib/pre-commit/checks/nb_space_check.rb +21 -0
  16. data/lib/pre-commit/checks/php_check.rb +9 -57
  17. data/lib/pre-commit/checks/pry_check.rb +5 -42
  18. data/lib/pre-commit/checks/rspec_focus_check.rb +6 -49
  19. data/lib/pre-commit/checks/rubocop_check.rb +17 -34
  20. data/lib/pre-commit/checks/ruby_symbol_hashrockets.rb +5 -46
  21. data/lib/pre-commit/checks/tabs_check.rb +12 -0
  22. data/lib/pre-commit/checks/whitespace_check.rb +16 -0
  23. data/lib/pre-commit/checks.rb +39 -41
  24. data/lib/pre-commit/cli.rb +1 -28
  25. data/lib/{support → pre-commit/support}/closure/compiler.jar +0 -0
  26. data/lib/{support → pre-commit/support}/jshint/jshint.js +0 -0
  27. data/lib/{support → pre-commit/support}/jslint/lint.js +0 -0
  28. data/{templates → lib/pre-commit/support/templates}/pre-commit-hook +0 -0
  29. data/lib/pre-commit/utils.rb +9 -12
  30. metadata +20 -24
  31. data/lib/pre-commit/base.rb +0 -7
  32. data/lib/pre-commit/checks/console_log.rb +0 -43
  33. data/lib/pre-commit/checks/merge_conflict.rb +0 -34
  34. data/lib/pre-commit/checks/tabs.rb +0 -54
  35. data/lib/support/all.rb +0 -2
  36. data/lib/support/closure/closure_checker.rb +0 -10
  37. data/lib/support/whitespace/whitespace +0 -46
  38. data/lib/support/whitespace/whitespace_checker.rb +0 -9
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6287e78942b84e9f14387a16d0995edbd49e6818
4
+ data.tar.gz: 86896dde7b2c8297c94daf14597c3f0e318cf413
5
+ SHA512:
6
+ metadata.gz: 21d22b4b4cb415f30d4b47342e82c406acc47de83759d7b3afa66770824639baf5102025e9a0a2f50bfa6ac63028b618cd21361a8af416217a38514002af711b
7
+ data.tar.gz: 813cd48195f51c2b7d5048aadebb55d478933f2984e5b0398b70a0bc5dee9618b889217814cef621a112694c4fd27b91ffad5a89e5e36abcb3841dae5a31df7b
data/README.md CHANGED
@@ -26,8 +26,7 @@ These are the available checks:
26
26
  * pry
27
27
  * tabs
28
28
  * jshint
29
- * js\_lint\_all (Runs JSLint on all staged JS files)
30
- * js\_lint\_new (Runs JSLint on all new staged JS files)
29
+ * js_lint
31
30
  * closure\_syntax\_check
32
31
  * php (Runs php -l on all staged files)
33
32
  * rspec_focus (Will check if you are about to check in a :focus in a spec file)
@@ -36,7 +35,7 @@ These are the available checks:
36
35
  * merge_conflict (Will check if you are about to check in a merge conflict)
37
36
  * migrations (Will make sure you check in the proper files after creating a Rails migration)
38
37
  * ci (Will run the `pre_commit:ci` rake task and pass or fail accordingly)
39
- * rubocop\_new and rubocop\_all (Check ruby code style using the rubocop gem. Rubocop must be installed)
38
+ * rubocop (Check ruby code style using the rubocop gem. Rubocop must be installed)
40
39
 
41
40
  To configure which checks you would like to run, simply set the `pre-commit.checks` git configuration setting.
42
41
 
data/bin/pre-commit CHANGED
@@ -12,8 +12,7 @@ if !File.exists?(".git")
12
12
  exit(1)
13
13
  end
14
14
 
15
- cli = PreCommit::Cli.new
16
- cli.install
15
+ PreCommit::Cli.new.install
17
16
 
18
17
  puts "Installed hook: #{PreCommit::Cli::PRE_COMMIT_HOOK_PATH}"
19
18
  puts
@@ -1,49 +1,10 @@
1
1
  module PreCommit
2
2
  class CiCheck
3
-
4
3
  CI_TASK_NAME = 'pre_commit:ci'
5
4
 
6
- def call
7
- if rakefile_present? && has_ci_task?
8
- run
9
- else
10
- $stderr.puts "pre-commit: skipping ci check. The `#{CI_TASK_NAME}` task is not defined."
11
-
12
- # pretend the check passed and move on
13
- true
14
- end
15
- end
16
-
17
- def run
18
- if tests_passed?
19
- true
20
- else
21
- $stderr.puts 'pre-commit: your test suite has failed'
22
- $stderr.puts "for the full output run `#{CI_TASK_NAME}`"
23
- $stderr.puts
24
-
25
- false
26
- end
27
- end
28
-
29
- def tests_passed?
30
- system("rake #{CI_TASK_NAME} --silent")
31
- end
32
-
33
- def rakefile_present?
34
- ['rakefile', 'Rakefile', 'rakefile.rb', 'Rakefile.rb'].any? do |file|
35
- File.exist?(file)
36
- end
5
+ def self.call(_)
6
+ return if system("rake #{CI_TASK_NAME} --silent")
7
+ "your test suite has failed, for the full output run `#{CI_TASK_NAME}`"
37
8
  end
38
-
39
- def has_ci_task?
40
- require 'rake'
41
- Rake.application.init
42
- Rake.application.load_rakefile
43
- Rake::Task.task_defined?(CI_TASK_NAME)
44
- rescue LoadError
45
- $stderr.puts 'pre-commit: rake not found, skipping ci check'
46
- end
47
-
48
9
  end
49
10
  end
@@ -0,0 +1,13 @@
1
+ module PreCommit
2
+ class ClosureCheck
3
+ CLOSURE_PATH = File.expand_path("../../support/closure/compiler.jar", __FILE__)
4
+
5
+ def self.call(staged_files)
6
+ return if staged_files.empty?
7
+ js_args = staged_files.map {|arg| "--js #{arg}"}.join(' ')
8
+ errors = `java -jar #{CLOSURE_PATH} #{js_args} --js_output_file /tmp/jammit.js 2>&1`.strip
9
+ return if errors.empty?
10
+ errors
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ module PreCommit
2
+ class ConsoleLogCheck
3
+ def self.call(staged_files)
4
+ staged_files.reject! { |f| File.extname(f) != ".js" }
5
+ return if staged_files.empty?
6
+ errors = `#{Utils.grep} -e "console\\.log" #{staged_files.join(" ")} | grep -v \/\/`.strip
7
+ return unless $?.success?
8
+ "console.log found:\n#{errors}"
9
+ end
10
+ end
11
+ end
@@ -1,47 +1,10 @@
1
1
  module PreCommit
2
2
  class DebuggerCheck
3
-
4
- attr_accessor :staged_files, :error_message, :grep_command
5
-
6
- def self.call(quiet=false)
7
- dirs = ['app/', 'lib/', 'script/', 'vendor/', 'test/'].reject {|d| !File.exists?(d)}
8
- check = new
9
- check.staged_files = Utils.staged_files(*dirs)
10
-
11
- result = check.run
12
- if !quiet && !result
13
- $stderr.puts check.error_message
14
- $stderr.puts
15
- check.print_dash_n_reminder
16
- end
17
- result
3
+ def self.call(staged_files)
4
+ return if staged_files.empty?
5
+ errors = `#{Utils.grep} debugger #{staged_files.join(" ")}`.strip
6
+ return unless $?.success?
7
+ "debugger statement(s) found:\n#{errors}"
18
8
  end
19
-
20
- def run
21
- return true if staged_files.empty?
22
-
23
- if detected_bad_code?
24
- @error_message = "pre-commit: debugger statement(s) found:\n"
25
- @error_message += instances_of_debugger_violations
26
- false
27
- else
28
- true
29
- end
30
- end
31
-
32
- def detected_bad_code?
33
- !system("git diff --cached -Sdebugger --quiet --exit-code")
34
- end
35
-
36
- def instances_of_debugger_violations
37
- cmd = grep_command || "git grep"
38
- `#{cmd} -nH debugger #{staged_files}`
39
- end
40
-
41
- def print_dash_n_reminder
42
- $stderr.puts 'You can bypass this check using `git commit -n`'
43
- $stderr.puts
44
- end
45
-
46
9
  end
47
10
  end
@@ -0,0 +1,12 @@
1
+ require 'pre-commit/utils'
2
+
3
+ module PreCommit
4
+ class GemfilePathCheck
5
+ def self.call(staged_files)
6
+ return unless staged_files.include?("Gemfile")
7
+ errors = `#{Utils.grep} 'path:|:path\\s*=>' Gemfile`.strip
8
+ return unless $?.success?
9
+ "local path found in Gemfile:\n#{errors}"
10
+ end
11
+ end
12
+ end
@@ -1,61 +1,35 @@
1
- require 'pre-commit/base'
2
1
  require 'pre-commit/utils'
3
2
  require 'execjs'
4
3
 
5
4
  module PreCommit
6
5
  class JsCheck
6
+ def self.call(staged_files)
7
+ staged_files = staged_files.select { |f| File.extname(f) == ".js" }
8
+ return if staged_files.empty?
7
9
 
8
- def call
9
- js_files = reject_non_js(files_to_check)
10
- if should_run?(js_files)
11
- run(js_files)
12
- else
13
- # pretend the check passed and move on
14
- true
15
- end
16
- end
17
-
18
- def run(js_files)
19
10
  errors = []
20
-
21
- js_files.each do |file|
11
+ staged_files.each do |file|
22
12
  error_list = Array(run_check(file))
23
13
  error_list.each { |error_object| errors << display_error(error_object, file) }
24
14
  end
25
15
 
26
- if errors.empty?
27
- true
28
- else
29
- $stderr.puts errors.join("\n")
30
- $stderr.puts
31
- $stderr.puts 'pre-commit: You can bypass this check using `git commit -n`'
32
- $stderr.puts
33
- false
34
- end
35
- end
36
-
37
- def should_run?(js_files)
38
- js_files.any?
16
+ return if errors.empty?
17
+ errors.join("\n")
39
18
  end
40
19
 
41
- def reject_non_js(staged_files)
42
- staged_files.select { |f| f =~ /\.js$/ }
43
- end
44
-
45
- def check_name
20
+ def self.check_name
46
21
  raise "Must be defined by subclass"
47
22
  end
48
23
 
49
- def linter_src
24
+ def self.linter_src
50
25
  raise "Must be defined by subclass"
51
26
  end
52
27
 
53
- def display_error(error_object, file)
28
+ def self.display_error(error_object, file)
54
29
  return "" unless error_object
55
30
 
56
31
  line = error_object['line'].to_i + 1
57
- "pre-commit: #{check_name.upcase} #{error_object['reason']}\n#{file}:#{line} #{error_object['evidence']}"
32
+ "#{error_object['reason']}\n#{file}:#{line} #{error_object['evidence']}"
58
33
  end
59
-
60
34
  end
61
35
  end
@@ -2,34 +2,25 @@ require 'pre-commit/checks/js_check'
2
2
 
3
3
  module PreCommit
4
4
  class JshintCheck < JsCheck
5
-
6
- def check_name
7
- "JSHint"
8
- end
9
-
10
- def files_to_check
11
- Utils.staged_files('.').split(" ")
12
- end
13
-
14
- def config
15
- config_file = ENV['JSHINT_CONFIG']
16
- config_file ||= File.exists?(".jshintrc") ? ".jshintrc" : nil
17
-
18
- if config_file
5
+ def self.config
6
+ if config_file = [ENV['JSHINT_CONFIG'], ".jshintrc"].compact.detect { |f| File.exist?(f) }
19
7
  ExecJS.exec("return (#{File.read(config_file)});")
20
8
  else
21
9
  {}
22
10
  end
23
11
  end
24
12
 
25
- def run_check(file)
13
+ def self.check_name
14
+ "JSHint"
15
+ end
16
+
17
+ def self.run_check(file)
26
18
  context = ExecJS.compile(File.read(linter_src))
27
19
  context.call('JSHINT', File.read(file), config)
28
20
  end
29
21
 
30
- def linter_src
31
- File.join(PreCommit.root, 'lib', 'support', 'jshint', 'jshint.js')
22
+ def self.linter_src
23
+ File.expand_path("../../support/jshint/jshint.js", __FILE__)
32
24
  end
33
-
34
25
  end
35
26
  end
@@ -2,27 +2,11 @@ require 'pre-commit/checks/js_check'
2
2
 
3
3
  module PreCommit
4
4
  class JslintCheck < JsCheck
5
-
6
- attr_accessor :type
7
-
8
- def check_name
5
+ def self.check_name
9
6
  "JSLint"
10
7
  end
11
8
 
12
- def initialize(type = :all)
13
- @type = type
14
- end
15
-
16
- def files_to_check
17
- case @type
18
- when :new
19
- Utils.new_files('.').split(" ")
20
- else
21
- Utils.staged_files('.').split(" ")
22
- end
23
- end
24
-
25
- def run_check(file)
9
+ def self.run_check(file)
26
10
  context = ExecJS.compile(File.read(linter_src))
27
11
  if !(context.call('JSLINT', File.read(file)))
28
12
  context.exec('return JSLINT.errors;')
@@ -31,9 +15,8 @@ module PreCommit
31
15
  end
32
16
  end
33
17
 
34
- def linter_src
35
- File.join(PreCommit.root, 'lib', 'support', 'jslint', 'lint.js')
18
+ def self.linter_src
19
+ File.expand_path("../../support/jslint/lint.js", __FILE__)
36
20
  end
37
-
38
21
  end
39
22
  end
@@ -1,28 +1,11 @@
1
- require 'pre-commit/utils'
2
-
3
1
  module PreCommit
4
2
  class LocalCheck
5
-
6
3
  DEFAULT_LOCATION = "config/pre-commit.rb"
7
- attr_accessor :error_message
8
4
 
9
- def self.call(quiet=false)
10
- check = new
11
- result = check.run(DEFAULT_LOCATION, Utils.staged_files("."))
12
- puts check.error_message if !result && !quiet
13
- result
5
+ def self.call(staged_files, script=DEFAULT_LOCATION)
6
+ return unless File.exist?(script)
7
+ output = `ruby #{script} #{staged_files.join(" ")} 2>&1`
8
+ "#{script} failed:\n#{output}" unless $?.success?
14
9
  end
15
-
16
- def run(file, staged_files)
17
- return true unless File.exist?(file)
18
- output = `ruby #{file} #{staged_files} 2>&1`
19
- if $?.success?
20
- true
21
- else
22
- self.error_message = "#{file} failed:\n#{output}"
23
- false
24
- end
25
- end
26
-
27
10
  end
28
11
  end
@@ -0,0 +1,10 @@
1
+ module PreCommit
2
+ class MergeConflictCheck
3
+ def self.call(staged_files)
4
+ return if staged_files.empty?
5
+ errors = `#{Utils.grep} '<<<<<<<' #{staged_files.join(" ")}`.strip
6
+ return unless $?.success?
7
+ "detected a merge conflict\n#{errors}"
8
+ end
9
+ end
10
+ end
@@ -1,39 +1,21 @@
1
1
  module PreCommit
2
2
  class MigrationCheck
3
-
4
- attr_accessor :error_message
5
-
6
- def call
7
- staged_files = load_staged_files
8
- run(staged_files)
9
-
10
- if !passed? && error_message
11
- $stderr.puts "pre-commit: #{error_message}"
12
- end
13
-
14
- passed?
15
- end
16
-
17
- def run(staged_files)
3
+ def self.call(staged_files)
18
4
  migration_present = migration_file_present?(staged_files)
19
5
  schema_change = schema_file_present?(staged_files)
20
6
 
21
7
  if migration_present && !schema_change
22
- @error_message = "It looks like you're adding a migration, but did not update the schema file"
23
- @passed = false
8
+ "It looks like you're adding a migration, but did not update the schema file"
24
9
  elsif schema_change && !migration_present
25
- @error_message = "You're trying to change the schema without adding a migration file"
26
- @passed = false
27
- else
28
- @passed = true
10
+ "You're trying to change the schema without adding a migration file"
29
11
  end
30
12
  end
31
13
 
32
- def migration_file_present?(staged_files)
14
+ def self.migration_file_present?(staged_files)
33
15
  staged_files.any? { |file| file =~ /db\/migrate\/.*\.rb/ }
34
16
  end
35
17
 
36
- def schema_file_present?(staged_files)
18
+ def self.schema_file_present?(staged_files)
37
19
  staged_files.any? do |file|
38
20
  basename = File.basename(file)
39
21
 
@@ -42,14 +24,5 @@ module PreCommit
42
24
  end
43
25
  end
44
26
  end
45
-
46
- def passed?
47
- @passed
48
- end
49
-
50
- def load_staged_files
51
- Utils.staged_files('.').split(" ")
52
- end
53
-
54
27
  end
55
28
  end
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+ module PreCommit
3
+ class NbSpaceCheck
4
+ def self.call(staged_files)
5
+ nb_space = " "
6
+ raise "you messed that up" unless nb_space.bytes.to_a == [194, 160]
7
+
8
+ staged_files.reject! { |f| f =~ /^vendor\// || !File.read(f).include?(nb_space) }
9
+
10
+ bad = staged_files.map do |file|
11
+ content = File.read(file).lines.to_a
12
+ line_no = content.index { |l| l.include?(nb_space) }
13
+ char_no = content[line_no].index(nb_space)
14
+ [file, line_no, char_no]
15
+ end
16
+
17
+ return if bad.empty?
18
+ "Detected non-breaking space in #{bad.map { |f,l,c| "#{f}:#{l+1} character:#{c+1}" }.join(" and")}, remove it!"
19
+ end
20
+ end
21
+ end
@@ -1,73 +1,25 @@
1
- require 'pre-commit/base'
2
1
  require 'pre-commit/utils'
3
2
 
4
3
  module PreCommit
5
4
  class PhpCheck
5
+ def self.call(staged_files)
6
+ staged_files = staged_files.grep /\.(php|engine|theme|install|inc|module|test)$/
7
+ return if staged_files.empty?
6
8
 
7
- def files_to_check
8
- Utils.staged_files('.').split(" ")
9
- end
10
-
11
- def call
12
- php_files = reject_non_php(files_to_check)
13
- if should_run?(php_files)
14
- run(php_files)
15
- else
16
- # pretend the check passed and move on
17
- true
18
- end
19
- end
20
-
21
- def check_name
22
- "PHP Lint"
23
- end
24
-
25
- def run(php_files)
26
- errors = []
27
-
28
- php_files.each do |file|
29
- error = run_check(file)
30
- unless error.nil?
31
- errors << display_error(error)
32
- end
33
- end
9
+ errors = staged_files.map { |file| run_check(file) }.compact
10
+ return if errors.empty?
34
11
 
35
- if errors.empty?
36
- true
37
- else
38
- $stderr.puts errors.join("\n")
39
- $stderr.puts
40
- $stderr.puts 'pre-commit: You can bypass this check using `git commit -n`'
41
- $stderr.puts
42
- false
43
- end
12
+ errors.join("\n")
44
13
  end
45
14
 
46
- def should_run?(php_files)
47
- php_files.any?
48
- end
49
-
50
- def reject_non_php(staged_files)
51
- staged_files.select { |f| f =~ /\.(php|engine|theme|install|inc|module|test)$/ }
52
- end
53
-
54
- def run_check(file)
15
+ def self.run_check(file)
55
16
  # We force PHP to display errors otherwise they will likely end up in the
56
17
  # error_log and not in stdout.
57
- cmd = "php -d display_errors=1 -l #{file}"
58
- result = %x[ #{cmd} ]
18
+ result = `php -d display_errors=1 -l #{file}`
59
19
  # Filter out the obvious note from PHP.
60
20
  result = result.split($/).find_all {|line| line !~ /Errors/}.join($/)
61
21
  # If PHP exited non-zero then there was a parse error.
62
- if ($? != 0)
63
- result
64
- end
22
+ result.strip unless $? == 0
65
23
  end
66
-
67
- # Format an error line.
68
- def display_error(error)
69
- "pre-commit: #{check_name.upcase} #{error}"
70
- end
71
-
72
24
  end
73
25
  end
@@ -1,47 +1,10 @@
1
1
  module PreCommit
2
2
  class PryCheck
3
-
4
- attr_accessor :staged_files, :error_message, :grep_command
5
-
6
- def self.call(quiet=false)
7
- dirs = ['app/', 'lib/', 'script/', 'vendor/', 'test/'].reject {|d| !File.exists?(d)}
8
- check = new
9
- check.staged_files = Utils.staged_files(*dirs)
10
-
11
- result = check.run
12
- if !quiet && !result
13
- $stderr.puts check.error_message
14
- $stderr.puts
15
- check.print_dash_n_reminder
16
- end
17
- result
3
+ def self.call(staged_files)
4
+ return if staged_files.empty?
5
+ result = `#{Utils.grep} binding.pry #{staged_files.join(" ")}`.strip
6
+ return unless $?.success?
7
+ "binding.pry found:\n#{result}"
18
8
  end
19
-
20
- def run
21
- return true if staged_files.empty?
22
-
23
- if detected_bad_code?
24
- @error_message = "pre-commit: binding.pry statement(s) found:\n"
25
- @error_message += instances_of_pry_violations
26
- false
27
- else
28
- true
29
- end
30
- end
31
-
32
- def detected_bad_code?
33
- !system("git diff --cached -S binding.pry --quiet --exit-code")
34
- end
35
-
36
- def instances_of_pry_violations
37
- cmd = grep_command || "git grep"
38
- `#{cmd} -nH "binding\.pry" #{staged_files}`
39
- end
40
-
41
- def print_dash_n_reminder
42
- $stderr.puts 'You can bypass this check using `git commit -n`'
43
- $stderr.puts
44
- end
45
-
46
9
  end
47
10
  end
@@ -1,54 +1,11 @@
1
1
  module PreCommit
2
2
  class RSpecFocusCheck
3
-
4
- attr_accessor :staged_files, :error_message, :grep_command, :spec_files
5
-
6
- def self.call(quiet=false)
7
- dirs = ['spec/'].reject {|d| !File.exists?(d)}
8
- check = new
9
- check.staged_files = Utils.staged_files(*dirs)
10
-
11
- result = check.run
12
- if !quiet && !result
13
- $stderr.puts check.error_message
14
- $stderr.puts
15
- check.print_dash_n_reminder
16
- end
17
- result
3
+ def self.call(staged_files)
4
+ staged_files = staged_files.grep(/_spec\.rb$/)
5
+ return if staged_files.empty?
6
+ result = `#{Utils.grep} ':focus' #{staged_files.join(" ")}`.strip
7
+ return unless $?.success?
8
+ ":focus found in specs:\n#{result}"
18
9
  end
19
-
20
- def run
21
- return true if staged_files.empty?
22
-
23
- if detected_bad_code?
24
- @error_message = "pre-commit: :focus in spec(s) found:\n"
25
- @error_message += instances_of_rspec_focus_violations
26
- false
27
- else
28
- true
29
- end
30
- end
31
-
32
- def detected_bad_code?
33
- spec_files = staged_files.split(' ').select do |file|
34
- file =~ /_spec\.rb$/
35
- end
36
-
37
- return false if spec_files.empty?
38
-
39
- diff = `git diff --cached -G:focus #{spec_files.join(" ")}`
40
- !!(diff =~ /[\W\s]:focus[\W\s]/)
41
- end
42
-
43
- def instances_of_rspec_focus_violations
44
- cmd = grep_command || "git grep"
45
- `#{cmd} -nHw ':focus' #{staged_files}`
46
- end
47
-
48
- def print_dash_n_reminder
49
- $stderr.puts 'You can bypass this check using `git commit -n`'
50
- $stderr.puts
51
- end
52
-
53
10
  end
54
11
  end