pre-commit 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,7 +65,7 @@ class PreCommit
65
65
  checks_to_run = `git config pre-commit.checks`.chomp.split(/,\s*/).map(&:to_sym)
66
66
 
67
67
  if checks_to_run.empty?
68
- Checks.values_at(:white_space, :console_log, :debugger, :tabs, :closure_syntax_check, :js_lint_new)
68
+ Checks.values_at(:white_space, :console_log, :debugger, :tabs, :js_lint_new)
69
69
  else
70
70
  Checks.values_at(*checks_to_run)
71
71
  end.compact
@@ -25,11 +25,11 @@ class ConsoleLog
25
25
  end
26
26
 
27
27
  def detected_bad_code?
28
- system("grep -q 'console.log' #{staged_files}")
28
+ system("grep -qe \"console\\.log\" #{staged_files}")
29
29
  end
30
30
 
31
31
  def instances_of_console_log_violations
32
- `grep -nH 'console.log' #{staged_files}`
32
+ `grep -nHe \"console\\.log\" #{staged_files}`
33
33
  end
34
34
 
35
35
  end
@@ -13,7 +13,10 @@ class Tabs
13
13
  end
14
14
 
15
15
  def run
16
- return unless staged_files.size > 0
16
+ # There is nothing to check
17
+ if staged_files.empty?
18
+ return true
19
+ end
17
20
 
18
21
  if detected_bad_code?
19
22
  @error_message = "pre-commit: detected tab before initial space:\n"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Shajith Chacko, Josh Lubaway
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-14 00:00:00 -08:00
17
+ date: 2011-02-28 00:00:00 -08:00
18
18
  default_executable: pre-commit
19
19
  dependencies: []
20
20