overcommit 0.37.0 → 0.38.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: eeddd35416c0acbfbcd95473bf9026cce4f3bf5e
4
- data.tar.gz: 9f805e9ee12b8db38da383c162c61f989f8d9ab1
3
+ metadata.gz: 6acb06db375fab15a3e54993b9dce2027bb50a4e
4
+ data.tar.gz: 4738cd572e644f626e42100ff6e147e2d2f217fb
5
5
  SHA512:
6
- metadata.gz: 78894882777c8c82ddf27f57f3da0a502cbf7adc0360004d126b438110c974792011543cbcc4d7251561d595199d23043c230db5a2c45e2654abb51e076da371
7
- data.tar.gz: 22ae853f2b0ee843890098c5364d2f30fe25e9abe4df61e9c011acbec4ace2c034673c193c55b8d3c812bfb29f1b85e658d152f5b489e69f86d5e282a4b8adda
6
+ metadata.gz: 18b93d2fca87325466f71ba3109852734549bf4f5126b430fa2d8a01cac5ed0b7b7c47e22cea709fc5cc80c2843ce86fcf2cfbc29ecca42b5a01546827493a37
7
+ data.tar.gz: 9ceca9e9ae9e08ac83fcd9f50e869c6549f67468643bfbfdaec6ff82575c47d8caba9f99bff5a96a8146cd981a2df9cbc7e22192d4e5f3eb573fe8ce62103a27
@@ -114,12 +114,6 @@ CommitMsg:
114
114
  enabled: true
115
115
  description: 'Check for trailing periods in subject'
116
116
 
117
- Commitplease:
118
- enabled: false
119
- description: 'Analyze with Commitplease'
120
- required_executable: './node_modules/.bin/commitplease'
121
- install_command: 'npm install --save-dev commitplease'
122
-
123
117
  # Hooks that are run after `git commit` is executed, before the commit message
124
118
  # editor is displayed. These hooks are ideal for syntax checkers, linters, and
125
119
  # other checks that you want to run before you allow a commit object to be
@@ -464,6 +458,16 @@ PreCommit:
464
458
  install_command: 'pip install flake8'
465
459
  include: '**/*.py'
466
460
 
461
+ RakeTarget:
462
+ enabled: false
463
+ description: 'Run rake targets'
464
+ # targets:
465
+ # - 'lint'
466
+ # - 'validate'
467
+ # - '...'
468
+ required_executable: 'rake'
469
+ install_command: 'gem install rake'
470
+
467
471
  RailsBestPractices:
468
472
  enabled: false
469
473
  description: 'Analyze with RailsBestPractices'
@@ -535,7 +539,7 @@ PreCommit:
535
539
  required_library: 'json'
536
540
  required_executable: 'scss-lint'
537
541
  flags: ['--format', 'JSON']
538
- install_command: 'gem install scss-lint'
542
+ install_command: 'gem install scss_lint'
539
543
  include: '**/*.scss'
540
544
 
541
545
  SemiStandard:
@@ -674,6 +678,7 @@ PostCheckout:
674
678
  ALL:
675
679
  required: false
676
680
  quiet: false
681
+ skip_file_checkout: true
677
682
 
678
683
  BowerInstall:
679
684
  enabled: false
@@ -746,6 +751,13 @@ PostCommit:
746
751
  - 'Gemfile.lock'
747
752
  - '*.gemspec'
748
753
 
754
+ Commitplease:
755
+ enabled: false
756
+ description: 'Analyze with Commitplease'
757
+ required_executable: './node_modules/.bin/commitplease'
758
+ install_command: 'npm install --save-dev commitplease'
759
+ flags: ['-1']
760
+
749
761
  GitGuilt:
750
762
  enabled: false
751
763
  description: 'Calculate changes in blame since last commit'
@@ -888,11 +900,27 @@ PrePush:
888
900
  destructive_only: true
889
901
  branches: ['master']
890
902
 
903
+ Pytest:
904
+ enabled: false
905
+ description: 'Run pytest test suite'
906
+ required_executable: 'pytest'
907
+ install_command: 'pip install -U pytest'
908
+
891
909
  RSpec:
892
910
  enabled: false
893
911
  description: 'Run RSpec test suite'
894
912
  required_executable: 'rspec'
895
913
 
914
+ RakeTarget:
915
+ enabled: false
916
+ description: 'Run rake targets'
917
+ # targets:
918
+ # - 'lint'
919
+ # - 'validate'
920
+ # - '...'
921
+ required_executable: 'rake'
922
+ install_command: 'gem install rake'
923
+
896
924
  Minitest:
897
925
  enabled: false
898
926
  description: 'Run Minitest test suite'
@@ -7,5 +7,14 @@ module Overcommit::Hook::PostCheckout
7
7
 
8
8
  def_delegators :@context,
9
9
  :previous_head, :new_head, :branch_checkout?, :file_checkout?
10
+
11
+ def skip_file_checkout?
12
+ @config['skip_file_checkout'] != false
13
+ end
14
+
15
+ def enabled?
16
+ return false if file_checkout? && skip_file_checkout?
17
+ super
18
+ end
10
19
  end
11
20
  end
@@ -1,4 +1,4 @@
1
- module Overcommit::Hook::CommitMsg
1
+ module Overcommit::Hook::PostCommit
2
2
  # Check that a commit message conforms to a certain style
3
3
  #
4
4
  # @see https://www.npmjs.com/package/commitplease
@@ -0,0 +1,10 @@
1
+ require 'overcommit/hook/shared/rake_target'
2
+
3
+ module Overcommit::Hook::PreCommit
4
+ # Runs rake targets
5
+ #
6
+ # @see {Overcommit::Hook::Shared::RakeTarget}
7
+ class RakeTarget < Base
8
+ include Overcommit::Hook::Shared::RakeTarget
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ module Overcommit::Hook::PrePush
2
+ # Runs `pytest` test suite before push
3
+ #
4
+ # @see https://github.com/pytest-dev/pytest
5
+ class Pytest < Base
6
+ def run
7
+ result = execute(command)
8
+ return :pass if result.success?
9
+
10
+ output = result.stdout + result.stderr
11
+ [:fail, output]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ require 'overcommit/hook/shared/rake_target'
2
+
3
+ module Overcommit::Hook::PrePush
4
+ # Runs rake targets
5
+ #
6
+ # @see {Overcommit::Hook::Shared::RakeTarget}
7
+ class RakeTarget < Base
8
+ include Overcommit::Hook::Shared::RakeTarget
9
+ end
10
+ end
@@ -0,0 +1,24 @@
1
+ module Overcommit::Hook::Shared
2
+ # runs specified rake targets. It fails on the first non-
3
+ # successfull exit.
4
+ #
5
+ module RakeTarget
6
+ def run
7
+ targets = config['targets']
8
+
9
+ if Array(targets).empty?
10
+ raise 'RakeTarget: targets parameter is empty. Add at least one task to ' \
11
+ 'the targets parameter. Valid: Array of target names or String of ' \
12
+ 'target names'
13
+ end
14
+
15
+ targets.each do |task|
16
+ result = execute(command + [task])
17
+ unless result.success?
18
+ return :fail, "Rake target #{task}:\n#{result.stdout}"
19
+ end
20
+ end
21
+ :pass
22
+ end
23
+ end
24
+ end
@@ -17,7 +17,7 @@ module Overcommit::HookContext
17
17
  end
18
18
  end
19
19
 
20
- PushedRef = Struct.new(:local_ref, :local_sha1, :remote_ref, :remote_sha1) do
20
+ PushedRef = Struct.new(:local_ref, :local_sha1, :remote_ref, :remote_sha1) do # rubocop:disable Metrics/BlockLength, Metrics/LineLength
21
21
  def forced?
22
22
  !(created? || deleted? || overwritten_commits.empty?)
23
23
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module Overcommit
5
- VERSION = '0.37.0'.freeze
5
+ VERSION = '0.38.0'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: overcommit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.37.0
4
+ version: 0.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brigade Engineering
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-14 00:00:00.000000000 Z
12
+ date: 2017-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: childprocess
@@ -65,7 +65,6 @@ files:
65
65
  - lib/overcommit/hook/base.rb
66
66
  - lib/overcommit/hook/commit_msg/base.rb
67
67
  - lib/overcommit/hook/commit_msg/capitalized_subject.rb
68
- - lib/overcommit/hook/commit_msg/commitplease.rb
69
68
  - lib/overcommit/hook/commit_msg/empty_message.rb
70
69
  - lib/overcommit/hook/commit_msg/gerrit_change_id.rb
71
70
  - lib/overcommit/hook/commit_msg/hard_tabs.rb
@@ -84,6 +83,7 @@ files:
84
83
  - lib/overcommit/hook/post_commit/base.rb
85
84
  - lib/overcommit/hook/post_commit/bower_install.rb
86
85
  - lib/overcommit/hook/post_commit/bundle_install.rb
86
+ - lib/overcommit/hook/post_commit/commitplease.rb
87
87
  - lib/overcommit/hook/post_commit/git_guilt.rb
88
88
  - lib/overcommit/hook/post_commit/index_tags.rb
89
89
  - lib/overcommit/hook/post_commit/npm_install.rb
@@ -148,6 +148,7 @@ files:
148
148
  - lib/overcommit/hook/pre_commit/python_flake8.rb
149
149
  - lib/overcommit/hook/pre_commit/rails_best_practices.rb
150
150
  - lib/overcommit/hook/pre_commit/rails_schema_up_to_date.rb
151
+ - lib/overcommit/hook/pre_commit/rake_target.rb
151
152
  - lib/overcommit/hook/pre_commit/reek.rb
152
153
  - lib/overcommit/hook/pre_commit/rubo_cop.rb
153
154
  - lib/overcommit/hook/pre_commit/ruby_lint.rb
@@ -173,7 +174,9 @@ files:
173
174
  - lib/overcommit/hook/pre_push/brakeman.rb
174
175
  - lib/overcommit/hook/pre_push/minitest.rb
175
176
  - lib/overcommit/hook/pre_push/protected_branches.rb
177
+ - lib/overcommit/hook/pre_push/pytest.rb
176
178
  - lib/overcommit/hook/pre_push/r_spec.rb
179
+ - lib/overcommit/hook/pre_push/rake_target.rb
177
180
  - lib/overcommit/hook/pre_push/test_unit.rb
178
181
  - lib/overcommit/hook/pre_rebase/base.rb
179
182
  - lib/overcommit/hook/pre_rebase/merged_commits.rb
@@ -181,6 +184,7 @@ files:
181
184
  - lib/overcommit/hook/shared/bundle_install.rb
182
185
  - lib/overcommit/hook/shared/index_tags.rb
183
186
  - lib/overcommit/hook/shared/npm_install.rb
187
+ - lib/overcommit/hook/shared/rake_target.rb
184
188
  - lib/overcommit/hook/shared/submodule_status.rb
185
189
  - lib/overcommit/hook_context.rb
186
190
  - lib/overcommit/hook_context/base.rb
@@ -240,8 +244,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
244
  version: '0'
241
245
  requirements: []
242
246
  rubyforge_project:
243
- rubygems_version: 2.5.1
247
+ rubygems_version: 2.4.5.1
244
248
  signing_key:
245
249
  specification_version: 4
246
250
  summary: Git hook manager
247
251
  test_files: []
252
+ has_rdoc: