Skip to content

Commit 81dd8c2

Browse files
davidstosiksds
authored andcommitted
Move size_limit_bytes default to Yaml
1 parent ca0cfe6 commit 81dd8c2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

config/default.yml

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ PreCommit:
296296
FileSize:
297297
enabled: false
298298
description: 'Check for oversized files'
299+
size_limit_bytes: 1_000_000
299300

300301
Flay:
301302
enabled: false

lib/overcommit/hook/pre_commit/file_size.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
module Overcommit::Hook::PreCommit
44
# Checks for oversized files before committing.
55
class FileSize < Base
6-
DEFAULT_SIZE_LIMIT_BYTES = 1_000_000 # 1MB
7-
86
def run
97
return :pass if oversized_files.empty?
108

@@ -26,7 +24,7 @@ def build_oversized_file_list
2624
end
2725

2826
def size_limit_bytes
29-
config.fetch('size_limit_bytes', DEFAULT_SIZE_LIMIT_BYTES)
27+
config.fetch('size_limit_bytes')
3028
end
3129

3230
def error_message_for(file)

0 commit comments

Comments
 (0)