diagnostic: elide stray filenames in subdirs
Usually, the subdirectory name is sufficient info, and the full file list is just noise. This reduces `brew doctor` output clutter, making it easier for user to paste, and maintainers to parse. Before: ``` $ brew doctor [...] Unexpected header files: /usr/local/include/node/cppgc/allocation.h /usr/local/include/node/cppgc/common.h /usr/local/include/node/cppgc/custom-space.h /usr/local/include/node/cppgc/garbage-collected.h /usr/local/include/node/cppgc/heap.h /usr/local/include/node/cppgc/internal/accessors.h /usr/local/include/node/cppgc/internal/api-constants.h /usr/local/include/node/cppgc/internal/compiler-specific.h /usr/local/include/node/cppgc/internal/finalizer-trait.h /usr/local/include/node/cppgc/internal/gc-info.h /usr/local/include/node/cppgc/internal/logging.h /usr/local/include/node/cppgc/internal/persistent-node.h /usr/local/include/node/cppgc/internal/pointer-policies.h /usr/local/include/node/cppgc/internal/prefinalizer-handler.h [about 500 more files] ``` After: ``` $ brew doctor Unexpected header files: /usr/local/include/node/... ``` The full list of stray files can still be viewed with `brew doctor -v`.
This commit is contained in:
parent
0c1abc11b4
commit
2d02c3950f
@ -188,11 +188,14 @@ module Homebrew
|
||||
files = Dir.chdir(dir) do
|
||||
(Dir.glob(pattern) - Dir.glob(allow_list))
|
||||
.select { |f| File.file?(f) && !File.symlink?(f) }
|
||||
.map { |f| File.join(dir, f) }
|
||||
.map do |f|
|
||||
f.sub!(%r{/.*}, "/...") unless @verbose
|
||||
File.join(dir, f)
|
||||
end
|
||||
end
|
||||
return if files.empty?
|
||||
|
||||
inject_file_list(files.sort, message)
|
||||
inject_file_list(files.sort.uniq, message)
|
||||
end
|
||||
|
||||
def check_for_stray_dylibs
|
||||
|
Loading…
x
Reference in New Issue
Block a user