jawshooah-overcommit 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/bin/overcommit +8 -0
  3. data/config/default.yml +275 -0
  4. data/config/starter.yml +31 -0
  5. data/lib/overcommit.rb +20 -0
  6. data/lib/overcommit/cli.rb +205 -0
  7. data/lib/overcommit/configuration.rb +183 -0
  8. data/lib/overcommit/configuration_loader.rb +49 -0
  9. data/lib/overcommit/configuration_validator.rb +40 -0
  10. data/lib/overcommit/constants.rb +8 -0
  11. data/lib/overcommit/exceptions.rb +35 -0
  12. data/lib/overcommit/git_repo.rb +147 -0
  13. data/lib/overcommit/hook/base.rb +174 -0
  14. data/lib/overcommit/hook/commit_msg/base.rb +11 -0
  15. data/lib/overcommit/hook/commit_msg/gerrit_change_id.rb +18 -0
  16. data/lib/overcommit/hook/commit_msg/hard_tabs.rb +13 -0
  17. data/lib/overcommit/hook/commit_msg/russian_novel.rb +14 -0
  18. data/lib/overcommit/hook/commit_msg/single_line_subject.rb +12 -0
  19. data/lib/overcommit/hook/commit_msg/text_width.rb +38 -0
  20. data/lib/overcommit/hook/commit_msg/trailing_period.rb +12 -0
  21. data/lib/overcommit/hook/post_checkout/base.rb +11 -0
  22. data/lib/overcommit/hook/post_checkout/index_tags.rb +26 -0
  23. data/lib/overcommit/hook/post_commit/base.rb +11 -0
  24. data/lib/overcommit/hook/post_commit/git_guilt.rb +9 -0
  25. data/lib/overcommit/hook/pre_commit/author_email.rb +18 -0
  26. data/lib/overcommit/hook/pre_commit/author_name.rb +17 -0
  27. data/lib/overcommit/hook/pre_commit/base.rb +70 -0
  28. data/lib/overcommit/hook/pre_commit/berksfile_check.rb +20 -0
  29. data/lib/overcommit/hook/pre_commit/brakeman.rb +12 -0
  30. data/lib/overcommit/hook/pre_commit/broken_symlinks.rb +15 -0
  31. data/lib/overcommit/hook/pre_commit/bundle_check.rb +25 -0
  32. data/lib/overcommit/hook/pre_commit/chamber_security.rb +11 -0
  33. data/lib/overcommit/hook/pre_commit/coffee_lint.rb +11 -0
  34. data/lib/overcommit/hook/pre_commit/css_lint.rb +11 -0
  35. data/lib/overcommit/hook/pre_commit/go_lint.rb +12 -0
  36. data/lib/overcommit/hook/pre_commit/haml_lint.rb +19 -0
  37. data/lib/overcommit/hook/pre_commit/hard_tabs.rb +14 -0
  38. data/lib/overcommit/hook/pre_commit/image_optim.rb +41 -0
  39. data/lib/overcommit/hook/pre_commit/js_hint.rb +13 -0
  40. data/lib/overcommit/hook/pre_commit/jscs.rb +22 -0
  41. data/lib/overcommit/hook/pre_commit/json_syntax.rb +22 -0
  42. data/lib/overcommit/hook/pre_commit/jsx_hint.rb +13 -0
  43. data/lib/overcommit/hook/pre_commit/jsxcs.rb +20 -0
  44. data/lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb +14 -0
  45. data/lib/overcommit/hook/pre_commit/merge_conflicts.rb +14 -0
  46. data/lib/overcommit/hook/pre_commit/pry_binding.rb +14 -0
  47. data/lib/overcommit/hook/pre_commit/python_flake8.rb +11 -0
  48. data/lib/overcommit/hook/pre_commit/rails_schema_up_to_date.rb +45 -0
  49. data/lib/overcommit/hook/pre_commit/reek.rb +22 -0
  50. data/lib/overcommit/hook/pre_commit/rubocop.rb +19 -0
  51. data/lib/overcommit/hook/pre_commit/scss_lint.rb +19 -0
  52. data/lib/overcommit/hook/pre_commit/shell_check.rb +19 -0
  53. data/lib/overcommit/hook/pre_commit/trailing_whitespace.rb +13 -0
  54. data/lib/overcommit/hook/pre_commit/travis_lint.rb +11 -0
  55. data/lib/overcommit/hook/pre_commit/yaml_syntax.rb +22 -0
  56. data/lib/overcommit/hook_context.rb +17 -0
  57. data/lib/overcommit/hook_context/base.rb +69 -0
  58. data/lib/overcommit/hook_context/commit_msg.rb +32 -0
  59. data/lib/overcommit/hook_context/post_checkout.rb +26 -0
  60. data/lib/overcommit/hook_context/post_commit.rb +19 -0
  61. data/lib/overcommit/hook_context/pre_commit.rb +148 -0
  62. data/lib/overcommit/hook_context/run_all.rb +39 -0
  63. data/lib/overcommit/hook_loader/base.rb +36 -0
  64. data/lib/overcommit/hook_loader/built_in_hook_loader.rb +12 -0
  65. data/lib/overcommit/hook_loader/plugin_hook_loader.rb +61 -0
  66. data/lib/overcommit/hook_runner.rb +129 -0
  67. data/lib/overcommit/hook_signer.rb +79 -0
  68. data/lib/overcommit/installer.rb +148 -0
  69. data/lib/overcommit/interrupt_handler.rb +87 -0
  70. data/lib/overcommit/logger.rb +79 -0
  71. data/lib/overcommit/message_processor.rb +132 -0
  72. data/lib/overcommit/printer.rb +116 -0
  73. data/lib/overcommit/subprocess.rb +46 -0
  74. data/lib/overcommit/utils.rb +163 -0
  75. data/lib/overcommit/version.rb +4 -0
  76. data/libexec/gerrit-change-id +174 -0
  77. data/libexec/index-tags +17 -0
  78. data/template-dir/hooks/commit-msg +81 -0
  79. data/template-dir/hooks/overcommit-hook +81 -0
  80. data/template-dir/hooks/post-checkout +81 -0
  81. data/template-dir/hooks/pre-commit +81 -0
  82. metadata +184 -0
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Entrypoint for Overcommit hook integration. Installing Overcommit will result
4
+ # in all of your git hooks being symlinked to this file, allowing the framework
5
+ # to manage your hooks for you.
6
+
7
+ # Prevent a Ruby stack trace from appearing when we interrupt the hook.
8
+ # Note that this will be overridden when Overcommit is loaded, since the
9
+ # InterruptHandler will redefine the trap at that time.
10
+ Signal.trap('INT') do
11
+ puts 'Hook run interrupted'
12
+ exit 130
13
+ end
14
+
15
+ # Allow hooks to be disabled via environment variable so git commands can be run
16
+ # in scripts without Overcommit running hooks
17
+ if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
18
+ exit
19
+ end
20
+
21
+ hook_type = File.basename($0)
22
+ if hook_type == 'overcommit-hook'
23
+ puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
24
+ "by each hook in a repository's .git/hooks directory."
25
+ exit 64 # EX_USAGE
26
+ end
27
+
28
+ begin
29
+ require 'overcommit'
30
+ rescue LoadError
31
+ puts 'This repository contains hooks installed by Overcommit, but the ' \
32
+ "overcommit gem is not installed.\n" \
33
+ 'Install it with `gem install overcommit`.'
34
+ exit
35
+ end
36
+
37
+ begin
38
+ logger = Overcommit::Logger.new(STDOUT)
39
+
40
+ # Ensure master hook is up-to-date
41
+ installer = Overcommit::Installer.new(logger)
42
+ if installer.run(Overcommit::Utils.repo_root, action: :update)
43
+ exec($0, *ARGV) # Execute the updated hook with all original arguments
44
+ end
45
+
46
+ config = Overcommit::ConfigurationLoader.load_repo_config
47
+
48
+ context = Overcommit::HookContext.create(hook_type, config, ARGV)
49
+ config.apply_environment!(context, ENV)
50
+
51
+ printer = Overcommit::Printer.new(logger, context)
52
+ runner = Overcommit::HookRunner.new(config, logger, context, printer)
53
+
54
+ status = runner.run
55
+
56
+ exit(status ? 0 : 65) # 65 = EX_DATAERR
57
+ rescue Overcommit::Exceptions::ConfigurationError => error
58
+ puts error
59
+ exit 78 # EX_CONFIG
60
+ rescue Overcommit::Exceptions::HookContextLoadError => error
61
+ puts error
62
+ puts 'Are you running an old version of Overcommit?'
63
+ exit 69 # EX_UNAVAILABLE
64
+ rescue Overcommit::Exceptions::HookSetupFailed,
65
+ Overcommit::Exceptions::HookCleanupFailed => error
66
+ puts error.message
67
+ exit 74 # EX_IOERR
68
+ rescue Overcommit::Exceptions::HookCancelled
69
+ puts 'You cancelled the hook run'
70
+ exit 130 # Ctrl-C cancel
71
+ rescue Overcommit::Exceptions::InvalidGitRepo => error
72
+ puts error
73
+ exit 64 # EX_USAGE
74
+ rescue Overcommit::Exceptions::InvalidHookSignature
75
+ exit 1
76
+ rescue => error
77
+ puts error.message
78
+ puts error.backtrace
79
+ puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
80
+ exit 70 # EX_SOFTWARE
81
+ end
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Entrypoint for Overcommit hook integration. Installing Overcommit will result
4
+ # in all of your git hooks being symlinked to this file, allowing the framework
5
+ # to manage your hooks for you.
6
+
7
+ # Prevent a Ruby stack trace from appearing when we interrupt the hook.
8
+ # Note that this will be overridden when Overcommit is loaded, since the
9
+ # InterruptHandler will redefine the trap at that time.
10
+ Signal.trap('INT') do
11
+ puts 'Hook run interrupted'
12
+ exit 130
13
+ end
14
+
15
+ # Allow hooks to be disabled via environment variable so git commands can be run
16
+ # in scripts without Overcommit running hooks
17
+ if ENV['OVERCOMMIT_DISABLE'].to_i != 0 || ENV['OVERCOMMIT_DISABLED'].to_i != 0
18
+ exit
19
+ end
20
+
21
+ hook_type = File.basename($0)
22
+ if hook_type == 'overcommit-hook'
23
+ puts "Don't run `overcommit-hook` directly; it is intended to be symlinked " \
24
+ "by each hook in a repository's .git/hooks directory."
25
+ exit 64 # EX_USAGE
26
+ end
27
+
28
+ begin
29
+ require 'overcommit'
30
+ rescue LoadError
31
+ puts 'This repository contains hooks installed by Overcommit, but the ' \
32
+ "overcommit gem is not installed.\n" \
33
+ 'Install it with `gem install overcommit`.'
34
+ exit
35
+ end
36
+
37
+ begin
38
+ logger = Overcommit::Logger.new(STDOUT)
39
+
40
+ # Ensure master hook is up-to-date
41
+ installer = Overcommit::Installer.new(logger)
42
+ if installer.run(Overcommit::Utils.repo_root, action: :update)
43
+ exec($0, *ARGV) # Execute the updated hook with all original arguments
44
+ end
45
+
46
+ config = Overcommit::ConfigurationLoader.load_repo_config
47
+
48
+ context = Overcommit::HookContext.create(hook_type, config, ARGV)
49
+ config.apply_environment!(context, ENV)
50
+
51
+ printer = Overcommit::Printer.new(logger, context)
52
+ runner = Overcommit::HookRunner.new(config, logger, context, printer)
53
+
54
+ status = runner.run
55
+
56
+ exit(status ? 0 : 65) # 65 = EX_DATAERR
57
+ rescue Overcommit::Exceptions::ConfigurationError => error
58
+ puts error
59
+ exit 78 # EX_CONFIG
60
+ rescue Overcommit::Exceptions::HookContextLoadError => error
61
+ puts error
62
+ puts 'Are you running an old version of Overcommit?'
63
+ exit 69 # EX_UNAVAILABLE
64
+ rescue Overcommit::Exceptions::HookSetupFailed,
65
+ Overcommit::Exceptions::HookCleanupFailed => error
66
+ puts error.message
67
+ exit 74 # EX_IOERR
68
+ rescue Overcommit::Exceptions::HookCancelled
69
+ puts 'You cancelled the hook run'
70
+ exit 130 # Ctrl-C cancel
71
+ rescue Overcommit::Exceptions::InvalidGitRepo => error
72
+ puts error
73
+ exit 64 # EX_USAGE
74
+ rescue Overcommit::Exceptions::InvalidHookSignature
75
+ exit 1
76
+ rescue => error
77
+ puts error.message
78
+ puts error.backtrace
79
+ puts "Report this bug at #{Overcommit::BUG_REPORT_URL}"
80
+ exit 70 # EX_SOFTWARE
81
+ end
metadata ADDED
@@ -0,0 +1,184 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jawshooah-overcommit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.22.0
5
+ platform: ruby
6
+ authors:
7
+ - Causes Engineering
8
+ - Shane da Silva
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-01-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: childprocess
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 0.5.1
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 0.5.1
28
+ - !ruby/object:Gem::Dependency
29
+ name: image_optim
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: 0.18.0
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 0.18.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: rspec
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '3.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '3.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: travis
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.7'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.7'
70
+ description: Utility to install, configure, and extend Git hooks
71
+ email:
72
+ - eng@causes.com
73
+ - shane@causes.com
74
+ executables:
75
+ - overcommit
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - bin/overcommit
80
+ - config/default.yml
81
+ - config/starter.yml
82
+ - lib/overcommit.rb
83
+ - lib/overcommit/cli.rb
84
+ - lib/overcommit/configuration.rb
85
+ - lib/overcommit/configuration_loader.rb
86
+ - lib/overcommit/configuration_validator.rb
87
+ - lib/overcommit/constants.rb
88
+ - lib/overcommit/exceptions.rb
89
+ - lib/overcommit/git_repo.rb
90
+ - lib/overcommit/hook/base.rb
91
+ - lib/overcommit/hook/commit_msg/base.rb
92
+ - lib/overcommit/hook/commit_msg/gerrit_change_id.rb
93
+ - lib/overcommit/hook/commit_msg/hard_tabs.rb
94
+ - lib/overcommit/hook/commit_msg/russian_novel.rb
95
+ - lib/overcommit/hook/commit_msg/single_line_subject.rb
96
+ - lib/overcommit/hook/commit_msg/text_width.rb
97
+ - lib/overcommit/hook/commit_msg/trailing_period.rb
98
+ - lib/overcommit/hook/post_checkout/base.rb
99
+ - lib/overcommit/hook/post_checkout/index_tags.rb
100
+ - lib/overcommit/hook/post_commit/base.rb
101
+ - lib/overcommit/hook/post_commit/git_guilt.rb
102
+ - lib/overcommit/hook/pre_commit/author_email.rb
103
+ - lib/overcommit/hook/pre_commit/author_name.rb
104
+ - lib/overcommit/hook/pre_commit/base.rb
105
+ - lib/overcommit/hook/pre_commit/berksfile_check.rb
106
+ - lib/overcommit/hook/pre_commit/brakeman.rb
107
+ - lib/overcommit/hook/pre_commit/broken_symlinks.rb
108
+ - lib/overcommit/hook/pre_commit/bundle_check.rb
109
+ - lib/overcommit/hook/pre_commit/chamber_security.rb
110
+ - lib/overcommit/hook/pre_commit/coffee_lint.rb
111
+ - lib/overcommit/hook/pre_commit/css_lint.rb
112
+ - lib/overcommit/hook/pre_commit/go_lint.rb
113
+ - lib/overcommit/hook/pre_commit/haml_lint.rb
114
+ - lib/overcommit/hook/pre_commit/hard_tabs.rb
115
+ - lib/overcommit/hook/pre_commit/image_optim.rb
116
+ - lib/overcommit/hook/pre_commit/js_hint.rb
117
+ - lib/overcommit/hook/pre_commit/jscs.rb
118
+ - lib/overcommit/hook/pre_commit/json_syntax.rb
119
+ - lib/overcommit/hook/pre_commit/jsx_hint.rb
120
+ - lib/overcommit/hook/pre_commit/jsxcs.rb
121
+ - lib/overcommit/hook/pre_commit/local_paths_in_gemfile.rb
122
+ - lib/overcommit/hook/pre_commit/merge_conflicts.rb
123
+ - lib/overcommit/hook/pre_commit/pry_binding.rb
124
+ - lib/overcommit/hook/pre_commit/python_flake8.rb
125
+ - lib/overcommit/hook/pre_commit/rails_schema_up_to_date.rb
126
+ - lib/overcommit/hook/pre_commit/reek.rb
127
+ - lib/overcommit/hook/pre_commit/rubocop.rb
128
+ - lib/overcommit/hook/pre_commit/scss_lint.rb
129
+ - lib/overcommit/hook/pre_commit/shell_check.rb
130
+ - lib/overcommit/hook/pre_commit/trailing_whitespace.rb
131
+ - lib/overcommit/hook/pre_commit/travis_lint.rb
132
+ - lib/overcommit/hook/pre_commit/yaml_syntax.rb
133
+ - lib/overcommit/hook_context.rb
134
+ - lib/overcommit/hook_context/base.rb
135
+ - lib/overcommit/hook_context/commit_msg.rb
136
+ - lib/overcommit/hook_context/post_checkout.rb
137
+ - lib/overcommit/hook_context/post_commit.rb
138
+ - lib/overcommit/hook_context/pre_commit.rb
139
+ - lib/overcommit/hook_context/run_all.rb
140
+ - lib/overcommit/hook_loader/base.rb
141
+ - lib/overcommit/hook_loader/built_in_hook_loader.rb
142
+ - lib/overcommit/hook_loader/plugin_hook_loader.rb
143
+ - lib/overcommit/hook_runner.rb
144
+ - lib/overcommit/hook_signer.rb
145
+ - lib/overcommit/installer.rb
146
+ - lib/overcommit/interrupt_handler.rb
147
+ - lib/overcommit/logger.rb
148
+ - lib/overcommit/message_processor.rb
149
+ - lib/overcommit/printer.rb
150
+ - lib/overcommit/subprocess.rb
151
+ - lib/overcommit/utils.rb
152
+ - lib/overcommit/version.rb
153
+ - libexec/gerrit-change-id
154
+ - libexec/index-tags
155
+ - template-dir/hooks/commit-msg
156
+ - template-dir/hooks/overcommit-hook
157
+ - template-dir/hooks/post-checkout
158
+ - template-dir/hooks/pre-commit
159
+ homepage: https://github.com/causes/overcommit
160
+ licenses:
161
+ - MIT
162
+ metadata: {}
163
+ post_install_message: Install hooks by running `overcommit --install` in your Git
164
+ repository
165
+ rdoc_options: []
166
+ require_paths:
167
+ - lib
168
+ required_ruby_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 1.9.3
173
+ required_rubygems_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ requirements: []
179
+ rubyforge_project:
180
+ rubygems_version: 2.4.5
181
+ signing_key:
182
+ specification_version: 4
183
+ summary: Git hook manager
184
+ test_files: []