Skip to content

Commit fd0c851

Browse files
authored
Merge pull request #19118 from gromgit/diagnostic/less-verbose-fnames
diagnostic: elide stray filenames in subdirs
2 parents 0c1abc1 + 872bb92 commit fd0c851

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Library/Homebrew/diagnostic.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,15 @@ def __check_stray_files(dir, pattern, allow_list, message)
188188
files = Dir.chdir(dir) do
189189
(Dir.glob(pattern) - Dir.glob(allow_list))
190190
.select { |f| File.file?(f) && !File.symlink?(f) }
191-
.map { |f| File.join(dir, f) }
191+
.map do |f|
192+
f.sub!(%r{/.*}, "/*") unless @verbose
193+
File.join(dir, f)
194+
end
195+
.sort.uniq
192196
end
193197
return if files.empty?
194198

195-
inject_file_list(files.sort, message)
199+
inject_file_list(files, message)
196200
end
197201

198202
def check_for_stray_dylibs

0 commit comments

Comments
 (0)