overcommit 0.47.0 → 0.48.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/default.yml +5 -0
- data/config/starter.yml +3 -3
- data/lib/overcommit/configuration_validator.rb +1 -1
- data/lib/overcommit/constants.rb +3 -3
- data/lib/overcommit/hook/base.rb +2 -5
- data/lib/overcommit/hook/commit_msg/message_format.rb +1 -1
- data/lib/overcommit/hook/post_checkout/bower_install.rb +1 -1
- data/lib/overcommit/hook/post_checkout/bundle_install.rb +1 -1
- data/lib/overcommit/hook/post_checkout/composer_install.rb +1 -1
- data/lib/overcommit/hook/post_checkout/index_tags.rb +1 -1
- data/lib/overcommit/hook/post_checkout/npm_install.rb +1 -1
- data/lib/overcommit/hook/post_checkout/yarn_install.rb +1 -1
- data/lib/overcommit/hook/post_commit/bower_install.rb +1 -1
- data/lib/overcommit/hook/post_commit/bundle_install.rb +1 -1
- data/lib/overcommit/hook/post_commit/composer_install.rb +1 -1
- data/lib/overcommit/hook/post_commit/index_tags.rb +1 -1
- data/lib/overcommit/hook/post_commit/npm_install.rb +1 -1
- data/lib/overcommit/hook/post_commit/yarn_install.rb +1 -1
- data/lib/overcommit/hook/post_merge/bower_install.rb +1 -1
- data/lib/overcommit/hook/post_merge/bundle_install.rb +1 -1
- data/lib/overcommit/hook/post_merge/composer_install.rb +1 -1
- data/lib/overcommit/hook/post_merge/index_tags.rb +1 -1
- data/lib/overcommit/hook/post_merge/npm_install.rb +1 -1
- data/lib/overcommit/hook/post_merge/yarn_install.rb +1 -1
- data/lib/overcommit/hook/post_rewrite/bower_install.rb +1 -1
- data/lib/overcommit/hook/post_rewrite/bundle_install.rb +1 -1
- data/lib/overcommit/hook/post_rewrite/composer_install.rb +1 -1
- data/lib/overcommit/hook/post_rewrite/index_tags.rb +1 -1
- data/lib/overcommit/hook/post_rewrite/npm_install.rb +1 -1
- data/lib/overcommit/hook/post_rewrite/yarn_install.rb +1 -1
- data/lib/overcommit/hook/pre_commit/author_email.rb +1 -1
- data/lib/overcommit/hook/pre_commit/berksfile_check.rb +1 -1
- data/lib/overcommit/hook/pre_commit/bundle_audit.rb +1 -1
- data/lib/overcommit/hook/pre_commit/bundle_check.rb +1 -1
- data/lib/overcommit/hook/pre_commit/bundle_outdated.rb +1 -1
- data/lib/overcommit/hook/pre_commit/cook_style.rb +1 -1
- data/lib/overcommit/hook/pre_commit/file_size.rb +47 -0
- data/lib/overcommit/hook/pre_commit/go_vet.rb +1 -1
- data/lib/overcommit/hook/pre_commit/jsl.rb +1 -1
- data/lib/overcommit/hook/pre_commit/rake_target.rb +1 -1
- data/lib/overcommit/hook/pre_commit/rubo_cop.rb +1 -1
- data/lib/overcommit/hook/pre_commit/scss_lint.rb +1 -1
- data/lib/overcommit/hook/pre_commit/yarn_check.rb +1 -1
- data/lib/overcommit/hook/pre_push/rake_target.rb +1 -1
- data/lib/overcommit/hook/prepare_commit_msg/replace_branch.rb +1 -1
- data/lib/overcommit/hook/shared/rake_target.rb +1 -1
- data/lib/overcommit/hook_context/prepare_commit_msg.rb +1 -1
- data/lib/overcommit/message_processor.rb +6 -6
- data/lib/overcommit/utils.rb +1 -1
- data/lib/overcommit/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9daaca7072540df4bd522b92ad834538848ed7e7baa2cda6a545574ba1aeb494
|
4
|
+
data.tar.gz: 0a47820c56e90b7598eb09e6d51d9a64e3fc6b8b56e6c4cb4dcd9b6afd7711d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c5b567931123d658f76566c5154ab574923b9b6a3c7530c83d1c36fc05b0e42021f58837e0f1edd59b00ec00382c43b3ec5cccbafb5001fa8aeb8fb591b7210
|
7
|
+
data.tar.gz: d09e08f4ca81501c4d530600896c04981c12c55353753e692b4e64126a7de4ee79084864ead0ab4c670cb47c3d868e26976a402795ee111e4ac983baa598d888
|
data/config/default.yml
CHANGED
@@ -293,6 +293,11 @@ PreCommit:
|
|
293
293
|
flags: ['-IEHnw']
|
294
294
|
keywords: ['BROKEN', 'BUG', 'ERROR', 'FIXME', 'HACK', 'NOTE', 'OPTIMIZE', 'REVIEW', 'TODO', 'WTF', 'XXX']
|
295
295
|
|
296
|
+
FileSize:
|
297
|
+
enabled: false
|
298
|
+
description: 'Check for oversized files'
|
299
|
+
size_limit_bytes: 1_000_000
|
300
|
+
|
296
301
|
Flay:
|
297
302
|
enabled: false
|
298
303
|
description: 'Analyze ruby code for structural similarities with Flay'
|
data/config/starter.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Use this file to configure the Overcommit hooks you wish to use. This will
|
2
2
|
# extend the default configuration defined in:
|
3
|
-
# https://github.com/
|
3
|
+
# https://github.com/sds/overcommit/blob/master/config/default.yml
|
4
4
|
#
|
5
5
|
# At the topmost level of this YAML file is a key representing type of hook
|
6
6
|
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
|
@@ -8,10 +8,10 @@
|
|
8
8
|
# `include`), whether to only display output if it fails (via `quiet`), etc.
|
9
9
|
#
|
10
10
|
# For a complete list of hooks, see:
|
11
|
-
# https://github.com/
|
11
|
+
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
|
12
12
|
#
|
13
13
|
# For a complete list of options that you can use to customize hooks, see:
|
14
|
-
# https://github.com/
|
14
|
+
# https://github.com/sds/overcommit#configuration
|
15
15
|
#
|
16
16
|
# Uncomment the following lines to make the configuration take effect.
|
17
17
|
|
@@ -102,7 +102,7 @@ module Overcommit
|
|
102
102
|
hash.fetch(hook_type) { {} }.each_key do |hook_name|
|
103
103
|
next if hook_name == 'ALL'
|
104
104
|
|
105
|
-
unless hook_name
|
105
|
+
unless hook_name.match?(/\A[A-Za-z0-9]+\z/)
|
106
106
|
errors << "#{hook_type}::#{hook_name} has an invalid name " \
|
107
107
|
"#{hook_name}. It must contain only alphanumeric " \
|
108
108
|
'characters (no underscores or dashes, etc.)'
|
data/lib/overcommit/constants.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
# Global application constants.
|
4
4
|
module Overcommit
|
5
5
|
HOME = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze
|
6
|
-
CONFIG_FILE_NAME = '.overcommit.yml'
|
6
|
+
CONFIG_FILE_NAME = '.overcommit.yml'
|
7
7
|
|
8
8
|
HOOK_DIRECTORY = File.join(HOME, 'lib', 'overcommit', 'hook').freeze
|
9
9
|
|
10
|
-
REPO_URL = 'https://github.com/
|
11
|
-
BUG_REPORT_URL = "#{REPO_URL}/issues"
|
10
|
+
REPO_URL = 'https://github.com/sds/overcommit'
|
11
|
+
BUG_REPORT_URL = "#{REPO_URL}/issues"
|
12
12
|
end
|
data/lib/overcommit/hook/base.rb
CHANGED
@@ -204,11 +204,8 @@ module Overcommit::Hook
|
|
204
204
|
def check_for_executable
|
205
205
|
return unless required_executable && !in_path?(required_executable)
|
206
206
|
|
207
|
-
|
208
|
-
|
209
|
-
output << install_command_prompt
|
210
|
-
|
211
|
-
output
|
207
|
+
"'#{required_executable}' is not installed, not in your PATH, " \
|
208
|
+
"or does not have execute permissions#{install_command_prompt}"
|
212
209
|
end
|
213
210
|
|
214
211
|
def install_command_prompt
|
@@ -19,7 +19,7 @@ module Overcommit::Hook::CommitMsg
|
|
19
19
|
expected_pattern_message = config['expected_pattern_message']
|
20
20
|
sample_message = config['sample_message']
|
21
21
|
|
22
|
-
unless message
|
22
|
+
unless message.match?(/#{pattern}/m)
|
23
23
|
[
|
24
24
|
'Commit message pattern mismatch.',
|
25
25
|
"Expected : #{expected_pattern_message}",
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCheckout
|
|
6
6
|
# Runs `bower install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BowerInstall
|
10
10
|
class BowerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BowerInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCheckout
|
|
6
6
|
# Runs `bundle install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BundleInstall
|
10
10
|
class BundleInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BundleInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCheckout
|
|
6
6
|
# Runs `composer install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::ComposerInstall
|
10
10
|
class ComposerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::ComposerInstall
|
12
12
|
end
|
@@ -5,7 +5,7 @@ require 'overcommit/hook/shared/index_tags'
|
|
5
5
|
module Overcommit::Hook::PostCheckout
|
6
6
|
# Updates ctags index for all source code in the repository.
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see Overcommit::Hook::Shared::IndexTags
|
9
9
|
class IndexTags < Base
|
10
10
|
include Overcommit::Hook::Shared::IndexTags
|
11
11
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCheckout
|
|
6
6
|
# Runs `npm install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::NpmInstall
|
10
10
|
class NpmInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::NpmInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCheckout
|
|
6
6
|
# Runs `yarn install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::YarnInstall
|
10
10
|
class YarnInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::YarnInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCommit
|
|
6
6
|
# Runs `bower install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BowerInstall
|
10
10
|
class BowerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BowerInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCommit
|
|
6
6
|
# Runs `bundle install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BundleInstall
|
10
10
|
class BundleInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BundleInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCommit
|
|
6
6
|
# Runs `composer install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::ComposerInstall
|
10
10
|
class ComposerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::ComposerInstall
|
12
12
|
end
|
@@ -5,7 +5,7 @@ require 'overcommit/hook/shared/index_tags'
|
|
5
5
|
module Overcommit::Hook::PostCommit
|
6
6
|
# Updates ctags index for all source code in the repository.
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see Overcommit::Hook::Shared::IndexTags
|
9
9
|
class IndexTags < Base
|
10
10
|
include Overcommit::Hook::Shared::IndexTags
|
11
11
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCommit
|
|
6
6
|
# Runs `npm install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::NpmInstall
|
10
10
|
class NpmInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::NpmInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostCommit
|
|
6
6
|
# Runs `yarn install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::YarnInstall
|
10
10
|
class YarnInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::YarnInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostMerge
|
|
6
6
|
# Runs `bower install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BowerInstall
|
10
10
|
class BowerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BowerInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostMerge
|
|
6
6
|
# Runs `bundle install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BundleInstall
|
10
10
|
class BundleInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BundleInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostMerge
|
|
6
6
|
# Runs `composer install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::ComposerInstall
|
10
10
|
class ComposerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::ComposerInstall
|
12
12
|
end
|
@@ -5,7 +5,7 @@ require 'overcommit/hook/shared/index_tags'
|
|
5
5
|
module Overcommit::Hook::PostMerge
|
6
6
|
# Updates ctags index for all source code in the repository.
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see Overcommit::Hook::Shared::IndexTags
|
9
9
|
class IndexTags < Base
|
10
10
|
include Overcommit::Hook::Shared::IndexTags
|
11
11
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostMerge
|
|
6
6
|
# Runs `npm install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::NpmInstall
|
10
10
|
class NpmInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::NpmInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostMerge
|
|
6
6
|
# Runs `yarn install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::YarnInstall
|
10
10
|
class YarnInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::YarnInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostRewrite
|
|
6
6
|
# Runs `bower install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BowerInstall
|
10
10
|
class BowerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BowerInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostRewrite
|
|
6
6
|
# Runs `bundle install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::BundleInstall
|
10
10
|
class BundleInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::BundleInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostRewrite
|
|
6
6
|
# Runs `composer install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::ComposerInstall
|
10
10
|
class ComposerInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::ComposerInstall
|
12
12
|
end
|
@@ -5,7 +5,7 @@ require 'overcommit/hook/shared/index_tags'
|
|
5
5
|
module Overcommit::Hook::PostRewrite
|
6
6
|
# Updates ctags index for all source code in the repository.
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see Overcommit::Hook::Shared::IndexTags
|
9
9
|
class IndexTags < Base
|
10
10
|
include Overcommit::Hook::Shared::IndexTags
|
11
11
|
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostRewrite
|
|
6
6
|
# Runs `npm install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::NpmInstall
|
10
10
|
class NpmInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::NpmInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PostRewrite
|
|
6
6
|
# Runs `yarn install` when a change is detected in the repository's
|
7
7
|
# dependencies.
|
8
8
|
#
|
9
|
-
# @see
|
9
|
+
# @see Overcommit::Hook::Shared::YarnInstall
|
10
10
|
class YarnInstall < Base
|
11
11
|
include Overcommit::Hook::Shared::YarnInstall
|
12
12
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PreCommit
|
|
6
6
|
# @see https://docs.chef.io/cookstyle.html
|
7
7
|
class CookStyle < Base
|
8
8
|
GENERIC_MESSAGE_TYPE_CATEGORIZER = lambda do |type|
|
9
|
-
type
|
9
|
+
type.match?(/^warn/) ? :warning : :error
|
10
10
|
end
|
11
11
|
|
12
12
|
COP_MESSAGE_TYPE_CATEGORIZER = lambda do |type|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::PreCommit
|
4
|
+
# Checks for oversized files before committing.
|
5
|
+
class FileSize < Base
|
6
|
+
def run
|
7
|
+
return :pass if oversized_files.empty?
|
8
|
+
|
9
|
+
oversized_files.map do |file|
|
10
|
+
error_message_for(file)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def description
|
15
|
+
"Check for files over #{size_limit_bytes} bytes"
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def oversized_files
|
21
|
+
@oversized_files ||= build_oversized_file_list
|
22
|
+
end
|
23
|
+
|
24
|
+
def build_oversized_file_list
|
25
|
+
applicable_files.select do |file|
|
26
|
+
File.exist?(file) && file_size(file) > size_limit_bytes
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def size_limit_bytes
|
31
|
+
config.fetch('size_limit_bytes')
|
32
|
+
end
|
33
|
+
|
34
|
+
def error_message_for(file)
|
35
|
+
Overcommit::Hook::Message.new(
|
36
|
+
:error,
|
37
|
+
file,
|
38
|
+
nil,
|
39
|
+
"#{file} is #{file_size(file)} bytes"
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def file_size(file)
|
44
|
+
File.size(file)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -9,7 +9,7 @@ module Overcommit::Hook::PreCommit
|
|
9
9
|
result = execute(command, args: applicable_files)
|
10
10
|
return :pass if result.success?
|
11
11
|
|
12
|
-
if result.stderr
|
12
|
+
if result.stderr.match?(/no such tool "vet"/)
|
13
13
|
return :fail, "`go tool vet` is not installed#{install_command_prompt}"
|
14
14
|
end
|
15
15
|
|
@@ -5,7 +5,7 @@ require 'overcommit/hook/shared/rake_target'
|
|
5
5
|
module Overcommit::Hook::PreCommit
|
6
6
|
# Runs rake targets
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see Overcommit::Hook::Shared::RakeTarget
|
9
9
|
class RakeTarget < Base
|
10
10
|
include Overcommit::Hook::Shared::RakeTarget
|
11
11
|
end
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PreCommit
|
|
6
6
|
# @see http://batsov.com/rubocop/
|
7
7
|
class RuboCop < Base
|
8
8
|
GENERIC_MESSAGE_TYPE_CATEGORIZER = lambda do |type|
|
9
|
-
type
|
9
|
+
type.match?(/^warn/) ? :warning : :error
|
10
10
|
end
|
11
11
|
|
12
12
|
COP_MESSAGE_TYPE_CATEGORIZER = lambda do |type|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Overcommit::Hook::PreCommit
|
4
4
|
# Runs `scss-lint` against any modified SCSS files.
|
5
5
|
#
|
6
|
-
# @see https://github.com/
|
6
|
+
# @see https://github.com/sds/scss-lint
|
7
7
|
class ScssLint < Base
|
8
8
|
def run
|
9
9
|
result = execute(command, args: applicable_files)
|
@@ -6,7 +6,7 @@ module Overcommit::Hook::PreCommit
|
|
6
6
|
#
|
7
7
|
# @see https://yarnpkg.com/en/docs/cli/check
|
8
8
|
class YarnCheck < Base
|
9
|
-
LOCK_FILE = 'yarn.lock'
|
9
|
+
LOCK_FILE = 'yarn.lock'
|
10
10
|
|
11
11
|
# A lot of the errors returned by `yarn check` are outside the developer's control
|
12
12
|
# (are caused by bad package specification, in the hands of the upstream maintainer)
|
@@ -5,7 +5,7 @@ require 'overcommit/hook/shared/rake_target'
|
|
5
5
|
module Overcommit::Hook::PrePush
|
6
6
|
# Runs rake targets
|
7
7
|
#
|
8
|
-
# @see
|
8
|
+
# @see Overcommit::Hook::Shared::RakeTarget
|
9
9
|
class RakeTarget < Base
|
10
10
|
include Overcommit::Hook::Shared::RakeTarget
|
11
11
|
end
|
@@ -11,7 +11,7 @@ module Overcommit::Hook::PrepareCommitMsg
|
|
11
11
|
Overcommit::Utils.log.debug(
|
12
12
|
"Checking if '#{Overcommit::GitRepo.current_branch}' matches #{branch_pattern}"
|
13
13
|
)
|
14
|
-
if branch_pattern.match(Overcommit::GitRepo.current_branch)
|
14
|
+
if branch_pattern.match?(Overcommit::GitRepo.current_branch)
|
15
15
|
Overcommit::Utils.log.debug("Writing #{commit_message_filename} with #{new_template}")
|
16
16
|
modify_commit_message do |old_contents|
|
17
17
|
"#{new_template}\n#{old_contents}"
|
@@ -8,12 +8,12 @@ module Overcommit
|
|
8
8
|
# output tuple from an array of {Overcommit::Hook::Message}s, respecting the
|
9
9
|
# configuration settings for the given hook.
|
10
10
|
class MessageProcessor
|
11
|
-
ERRORS_MODIFIED_HEADER = 'Errors on modified lines:'
|
12
|
-
WARNINGS_MODIFIED_HEADER = 'Warnings on modified lines:'
|
13
|
-
ERRORS_UNMODIFIED_HEADER = "Errors on lines you didn't modify:"
|
14
|
-
WARNINGS_UNMODIFIED_HEADER = "Warnings on lines you didn't modify:"
|
15
|
-
ERRORS_GENERIC_HEADER = 'Errors:'
|
16
|
-
WARNINGS_GENERIC_HEADER = 'Warnings:'
|
11
|
+
ERRORS_MODIFIED_HEADER = 'Errors on modified lines:'
|
12
|
+
WARNINGS_MODIFIED_HEADER = 'Warnings on modified lines:'
|
13
|
+
ERRORS_UNMODIFIED_HEADER = "Errors on lines you didn't modify:"
|
14
|
+
WARNINGS_UNMODIFIED_HEADER = "Warnings on lines you didn't modify:"
|
15
|
+
ERRORS_GENERIC_HEADER = 'Errors:'
|
16
|
+
WARNINGS_GENERIC_HEADER = 'Warnings:'
|
17
17
|
|
18
18
|
# @param hook [Overcommit::Hook::Base]
|
19
19
|
# @param unmodified_lines_setting [String] how to treat messages on
|
data/lib/overcommit/utils.rb
CHANGED
data/lib/overcommit/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overcommit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.48.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Brigade Engineering
|
8
7
|
- Shane da Silva
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2019-03
|
11
|
+
date: 2019-05-03 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: childprocess
|
@@ -47,8 +46,7 @@ dependencies:
|
|
47
46
|
version: '1.4'
|
48
47
|
description: Utility to install, configure, and extend Git hooks
|
49
48
|
email:
|
50
|
-
-
|
51
|
-
- shane.dasilva@brigade.com
|
49
|
+
- shane@dasilva.io
|
52
50
|
executables:
|
53
51
|
- overcommit
|
54
52
|
extensions: []
|
@@ -134,6 +132,7 @@ files:
|
|
134
132
|
- lib/overcommit/hook/pre_commit/es_lint.rb
|
135
133
|
- lib/overcommit/hook/pre_commit/execute_permissions.rb
|
136
134
|
- lib/overcommit/hook/pre_commit/fasterer.rb
|
135
|
+
- lib/overcommit/hook/pre_commit/file_size.rb
|
137
136
|
- lib/overcommit/hook/pre_commit/fix_me.rb
|
138
137
|
- lib/overcommit/hook/pre_commit/flay.rb
|
139
138
|
- lib/overcommit/hook/pre_commit/foodcritic.rb
|
@@ -268,7 +267,7 @@ files:
|
|
268
267
|
- template-dir/hooks/pre-push
|
269
268
|
- template-dir/hooks/pre-rebase
|
270
269
|
- template-dir/hooks/prepare-commit-msg
|
271
|
-
homepage: https://github.com/
|
270
|
+
homepage: https://github.com/sds/overcommit
|
272
271
|
licenses:
|
273
272
|
- MIT
|
274
273
|
metadata: {}
|
@@ -281,7 +280,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
281
280
|
requirements:
|
282
281
|
- - ">="
|
283
282
|
- !ruby/object:Gem::Version
|
284
|
-
version: '2.
|
283
|
+
version: '2.4'
|
285
284
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
286
285
|
requirements:
|
287
286
|
- - ">="
|