Skip to content

Commit dd4e4ec

Browse files
committed
fix: fix Rubocop Style/MultilineBlockChain offense
1 parent c974832 commit dd4e4ec

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 2
10-
Style/MultilineBlockChain:
11-
Exclude:
12-
- 'lib/git/base.rb'
13-
149
# Offense count: 5
1510
# Configuration parameters: AllowedMethods.
1611
# AllowedMethods: respond_to_missing?

lib/git/base.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,12 @@ def repo
233233

234234
# returns the repository size in bytes
235235
def repo_size
236-
Dir.glob(File.join(repo.path, '**', '*'), File::FNM_DOTMATCH).reject do |f|
237-
f.include?('..')
238-
end.map do |f|
239-
File.expand_path(f)
240-
end.uniq.map do |f|
241-
File.stat(f).size.to_i
242-
end.reduce(:+)
236+
all_files = Dir.glob(File.join(repo.path, '**', '*'), File::FNM_DOTMATCH)
237+
238+
all_files.reject { |file| file.include?('..') }
239+
.map { |file| File.expand_path(file) }
240+
.uniq
241+
.sum { |file| File.stat(file).size.to_i }
243242
end
244243

245244
def set_index(index_file, check = true)

0 commit comments

Comments
 (0)