git-hook 0.1.9 → 0.2.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 +4 -4
- data/README.md +4 -0
- data/lib/githook/tasks/1-pre-commit.rake +3 -1
- data/lib/githook/version.rb +1 -1
- 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: 696260b5df6ded43b0b193245b76f1fa6f30fa28
|
4
|
+
data.tar.gz: 0ce5b012e657302cdad561e7f965066fadd077c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bdc39de1878d847b65a22b0606b44bf3528e595d77866521a865be443977208cfd1a5903e00265ca09848bf0431930d10b801a72d832701766c9d8dde88fd77
|
7
|
+
data.tar.gz: bf34d913f1ebf72e071d1403fd40cb653fe28e1ec56e55bc50fd836acfc40feeae3d7598022bdf5f506a43d9930733c94e0f748a03fbb4d5a3bdcfbc1cfc69f8
|
data/README.md
CHANGED
@@ -247,6 +247,10 @@ Demo:
|
|
247
247
|
|
248
248
|
## Releases
|
249
249
|
|
250
|
+
### 0.2.0
|
251
|
+
|
252
|
+
1. Fix bug that rubocop will check all files if has no changed ruby file
|
253
|
+
|
250
254
|
### 0.1.9
|
251
255
|
|
252
256
|
1. Add a `changed_files` util method to get the added or modified files, to make rubocop only check changed files instead of all files.
|
@@ -2,7 +2,9 @@ namespace :pre_commit do
|
|
2
2
|
desc 'Check ruby code style by rubocop'
|
3
3
|
task :rubocop do |t|
|
4
4
|
Githook::Util.log_task(t.name)
|
5
|
-
|
5
|
+
changed_ruby_files = Githook::Util.changed_ruby_files
|
6
|
+
exit 0 if changed_ruby_files.empty?
|
7
|
+
exit 1 unless system("bundle exec rubocop #{changed_ruby_files}")
|
6
8
|
end
|
7
9
|
|
8
10
|
desc 'Test ruby code by rspec'
|
data/lib/githook/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-hook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- baurine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|