We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8d87e2 commit 5e326a9Copy full SHA for 5e326a9
lib/overcommit/hook/pre_commit/file_size.rb
@@ -36,32 +36,12 @@ def error_message_for(file)
36
:error,
37
file,
38
nil,
39
- error_text_for(file)
+ "#{file} is #{file_size(file)} bytes"
40
)
41
end
42
43
- def error_text_for(file)
44
- error_text_format % {
45
- path: relative_path_for(file),
46
- limit: size_limit_bytes,
47
- size: file_size(file)
48
- }
49
- end
50
-
51
- def error_text_format
52
- '%<path>s is over the file size limit of %<limit>s bytes (is %<size>s bytes)'
53
54
55
def file_size(file)
56
File.size(file)
57
58
59
- def relative_path_for(file)
60
- Pathname.new(file).relative_path_from(repo_root_path)
61
62
63
- def repo_root_path
64
- @repo_root_path ||= Pathname.new(Overcommit::Utils.repo_root)
65
66
67
0 commit comments