pre-commit 0.27.0 → 0.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b71bf7fef97fbbe46f7ce5d530295579db2c825
4
- data.tar.gz: 1a7846252f99ef257f3b5e8e7e0355b392e221d8
3
+ metadata.gz: cea414da9d7e68773da0d80aac6609b9b47dcb01
4
+ data.tar.gz: 558a923a8436226ba568cfce1cd514364f9c06b4
5
5
  SHA512:
6
- metadata.gz: dc98b3bcc180f96d98d941e7a3429d0678b33101ac21157b0ede2173df8b72807acbadb4473173c0e11b7af36e2ddca13b453275ae96c6c3f6b4d6a314563e1f
7
- data.tar.gz: a38b6635bd2c57783d7e13b7bdaf0dd6a7f304fad1cf09a0039219c59c08b932e0d72db3bf78b74998b7b4fc78144240c4dda558cdf302fc8bc495abaf51bcf3
6
+ metadata.gz: 45409551f55c20508d783613d448b10475cd382d734ac96b6be2345ead838ca51fd4b7fdfe58e41dc186ef146f8fcf95ad42b4344caf6ee107c8c9954f4a3812
7
+ data.tar.gz: 162042b8dcb4a17262d20585b0c1783549bb53a9bde58ebf881f6861ba7010cd4ff7280a23c6fdb899f033cf8e0cfd10003e64322a638af84a77bd2daca44290
data/README.md CHANGED
@@ -20,6 +20,23 @@ Use the pre-commit command to generate a stub pre-commit hook
20
20
 
21
21
  This creates a .git/hooks/pre-commit script which will check your git config and run checks that are enabled.
22
22
 
23
+ ### Bundler
24
+
25
+ If you want to use Bundler to specify a version of RuboCop, add the following to `Gemfile`:
26
+
27
+ ```ruby
28
+ group :development do
29
+ gem "pre-commit", require: false
30
+ gem "rubocop", require: false
31
+ end
32
+ ```
33
+
34
+ And run the following to run `pre-commit` via Bundler:
35
+
36
+ ```
37
+ $ git config pre-commit.ruby "bundle exec ruby"
38
+ ```
39
+
23
40
  ### RVM
24
41
 
25
42
  If you are using rvm you need to install pre-commit into the ```default``` gemset, because it does not use the ```current``` environment
@@ -128,4 +145,4 @@ the list of git files to check with:
128
145
  3. `.pre_commit.ignore` - `pre-commit` specific list can be shared,
129
146
  [Allowed filters](http://ruby-doc.org/core-2.1.3/File.html#method-c-fnmatch)
130
147
 
131
- ## [Contributing](CONTRIBUTING.md)
148
+ ## [Contributing](.github/CONTRIBUTING.md)
@@ -33,7 +33,10 @@ 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
- s = (File.read(file, File.stat(file).blksize) || "").split(//)
36
+ bytes = File.stat(file).blksize
37
+ bytes = 4096 if bytes > 4096
38
+ s = (File.read(file, bytes) || "")
39
+ s = s.encode('US-ASCII', :undef => :replace).split(//)
37
40
  ((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
38
41
  end
39
42
 
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.27.0
4
+ version: 0.28.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-02-22 00:00:00.000000000 Z
11
+ date: 2016-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pluginator
@@ -24,34 +24,6 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.1'
27
- - !ruby/object:Gem::Dependency
28
- name: guard
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
41
- - !ruby/object:Gem::Dependency
42
- name: guard-minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '2.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '2.0'
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: minitest
57
29
  requirement: !ruby/object:Gem::Requirement