pre-commit 0.10.0 → 0.11.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b62fa135fe8f60b7a5eafd7ef58ef2aa9eff6f7
|
4
|
+
data.tar.gz: 0906b075207d03a6958dcbc576c3b4a5f6225990
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df2e83881c50460571ce4fc36bcff0f4e5127d94b6d3ad3e177d8369fdb642e8b990622a38bc2b0105e766921f765028785a9129f894f763006829b2714e5215
|
7
|
+
data.tar.gz: 41b5486ceaf50650db83d3560ce6cab407d69449ddee3d175d6ea11af2d216d6e96a9eb58e3f86972bcecc7ee4b68e21bd9329f78bda65ffd15a5c09f8954352
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module PreCommit
|
2
2
|
class WhiteSpaceCheck
|
3
3
|
def self.call(_)
|
4
|
-
errors = `git diff-index --check --cached
|
4
|
+
errors = `git diff-index --check --cached HEAD -- 2>&1`
|
5
5
|
return if $?.success?
|
6
6
|
|
7
7
|
# Initial commit: diff against the empty tree object
|
8
|
-
if errors =~ /fatal: bad revision '
|
8
|
+
if errors =~ /fatal: bad revision 'HEAD'/
|
9
9
|
errors = `git diff-index --check --cached 4b825dc642cb6eb9a060e54bf8d69288fbee4904 -- 2>&1`
|
10
10
|
return if $?.success?
|
11
11
|
end
|
@@ -1,18 +1,23 @@
|
|
1
|
-
#!/usr/bin/env
|
1
|
+
#!/usr/bin/env sh
|
2
2
|
|
3
|
-
|
3
|
+
cmd=`git config pre-commit.ruby 2>/dev/null`
|
4
|
+
if test -n "${cmd}"
|
5
|
+
then true
|
6
|
+
elif which rvm > /dev/null
|
7
|
+
then cmd="rvm default do ruby"
|
8
|
+
elif which rbenv > /dev/null
|
9
|
+
then cmd="rbenv exec ruby"
|
10
|
+
else cmd="ruby"
|
11
|
+
fi
|
4
12
|
|
5
|
-
|
6
|
-
"rvm default do ruby"
|
7
|
-
elsif system("which rbenv > /dev/null")
|
8
|
-
"rbenv exec ruby"
|
9
|
-
else
|
10
|
-
"ruby"
|
11
|
-
end
|
13
|
+
export rvm_silence_path_mismatch_check_flag=1
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
${cmd} -rrubygems -e '
|
16
|
+
begin
|
17
|
+
require "pre-commit"
|
18
|
+
true
|
19
|
+
rescue LoadError
|
20
|
+
$stderr.puts "pre-commit: WARNING: Skipping checks because the pre-commit gem is not installed. (Did you change your Ruby version?)"
|
21
|
+
false
|
22
|
+
end and PreCommit.run
|
23
|
+
'
|
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.
|
4
|
+
version: 0.11.0
|
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-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -83,9 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.
|
86
|
+
rubygems_version: 2.1.1
|
87
87
|
signing_key:
|
88
88
|
specification_version: 3
|
89
89
|
summary: A slightly better git pre-commit hook
|
90
90
|
test_files: []
|
91
|
-
has_rdoc:
|