pre-commit 0.9.1 → 0.9.2
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.
- checksums.yaml +4 -4
- data/lib/pre-commit/checks/debugger_check.rb +11 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ff1322d028fe5837cfde982be38e20eee79b4a0
|
4
|
+
data.tar.gz: 8e5f8efaffab2c8afb5d2fafbdfd1ef30b424569
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae50c6a33ca6bc51724fd9f04f803281832d58873d38072e2c8b4690805e6d1b4aa1ab980887d8a6e589c4dd18fa400b31320593375f057947acc30449d4abe0
|
7
|
+
data.tar.gz: b0d7901498f8aeca050530e769e5c4403678c556cd78fbab6a8a5482f3b53e4ccccaf28e6e4b228b27bfb65a3849ffe6b1660327ba19f2b5b8bd2a654cfc4c07
|
@@ -1,10 +1,19 @@
|
|
1
|
+
require 'pre-commit/utils'
|
2
|
+
|
1
3
|
module PreCommit
|
2
4
|
class DebuggerCheck
|
3
5
|
def self.call(staged_files)
|
4
|
-
|
5
|
-
|
6
|
+
files = files_to_check(staged_files)
|
7
|
+
return if files.empty?
|
8
|
+
|
9
|
+
errors = `#{Utils.grep} debugger #{files.join(" ")}`.strip
|
6
10
|
return unless $?.success?
|
11
|
+
|
7
12
|
"debugger statement(s) found:\n#{errors}"
|
8
13
|
end
|
14
|
+
|
15
|
+
def self.files_to_check(files)
|
16
|
+
files.reject { |file| File.basename(file) =~ /^Gemfile/ }
|
17
|
+
end
|
9
18
|
end
|
10
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pre-commit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shajith Chacko, Josh Lubaway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|