pre-commit 0.30.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pre-commit/utils/staged_files.rb +1 -1
- data/templates/hooks/sourcetree +35 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bba2bcd3f59171ba7a49e0143845708685529a1
|
4
|
+
data.tar.gz: 43aab8349d12ce75ee40b2f4730b2d492afeb9a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb0212364f808c719a26a08e5b156e4424934b4323fa0a567dfa8a11ee177adf455a938d2e6675bb0d5034b78f91908c82a39e1ecc97ddb68daed948a7e82077
|
7
|
+
data.tar.gz: c2d13e4479211b54da594bdb6e2168c4ae7ac82ffe9663a1a3aa092ca3f4cfdbf27853bd544678479d222339ead662b9f21542912b3f1030c8a1d524865ac2b1
|
@@ -33,7 +33,7 @@ module PreCommit
|
|
33
33
|
private
|
34
34
|
# from https://github.com/djberg96/ptools/blob/master/lib/ptools.rb#L90
|
35
35
|
def binary?(file)
|
36
|
-
bytes = File.stat(file).blksize
|
36
|
+
bytes = File.stat(file).blksize.to_i
|
37
37
|
bytes = 4096 if bytes > 4096
|
38
38
|
s = (File.read(file, bytes) || "")
|
39
39
|
s = s.encode('US-ASCII', :undef => :replace).split(//)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/usr/bin/env sh
|
2
|
+
|
3
|
+
# This hook can be used with SourceTree.
|
4
|
+
# This hook will attempt to setup your environment before running checks.
|
5
|
+
#
|
6
|
+
# If you would like `pre-commit` to get out of your way and you are comfortable
|
7
|
+
# setting up your own environment, you can install the simple hook using:
|
8
|
+
#
|
9
|
+
# pre-commit install --simple
|
10
|
+
#
|
11
|
+
|
12
|
+
# This is a work-around to get GitHub for Mac to be able to run `node` commands
|
13
|
+
# https://stackoverflow.com/questions/12881975/git-pre-commit-hook-failing-in-github-for-mac-works-on-command-line
|
14
|
+
PATH=$PATH:/usr/local/bin:/usr/local/sbin
|
15
|
+
|
16
|
+
RVM_PATH=$HOME/.rvm/bin
|
17
|
+
if [ -d "$RVM_PATH" ] && [[ ! $PATH =~ (^|:)$RVM_PATH(:|$) ]]; then
|
18
|
+
PATH+=:$RVM_PATH
|
19
|
+
fi
|
20
|
+
|
21
|
+
export LC_CTYPE="en_US.UTF-8"
|
22
|
+
export rvm_silence_path_mismatch_check_flag=1
|
23
|
+
|
24
|
+
rvm default do bundle exec ruby -rrubygems -e '
|
25
|
+
begin
|
26
|
+
require "pre-commit"
|
27
|
+
true
|
28
|
+
rescue LoadError => e
|
29
|
+
$stderr.puts <<-MESSAGE
|
30
|
+
pre-commit: WARNING: Skipping checks because: #{e}
|
31
|
+
pre-commit: Did you set your Ruby version?
|
32
|
+
MESSAGE
|
33
|
+
false
|
34
|
+
end and PreCommit.run
|
35
|
+
'
|
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.31.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: 2016-
|
11
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pluginator
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- templates/hooks/automatic
|
162
162
|
- templates/hooks/manual
|
163
163
|
- templates/hooks/simple
|
164
|
+
- templates/hooks/sourcetree
|
164
165
|
homepage: http://github.com/jish/pre-commit
|
165
166
|
licenses:
|
166
167
|
- Apache 2.0
|
@@ -183,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
184
|
version: '0'
|
184
185
|
requirements: []
|
185
186
|
rubyforge_project:
|
186
|
-
rubygems_version: 2.5.
|
187
|
+
rubygems_version: 2.5.2
|
187
188
|
signing_key:
|
188
189
|
specification_version: 3
|
189
190
|
summary: A slightly better git pre-commit hook
|