From c95fce8cff8cc5d45d8ba30b02fa3c0c27e8001e Mon Sep 17 00:00:00 2001 From: Lilith Orion Hafner Date: Thu, 2 Mar 2023 09:53:12 -0600 Subject: [PATCH] Abbreviate varinfo signature and re-order for consistency The signature line is very long, so I dropped the ::Bool annotations which imo don't add value. I also switched from mixed `m=Main` and `imported = false` style to consistent `m=Main` and `imported=false`. Consistent within a single line is better than inconsistent, and I chose more concise because we're well over the line limit. Also reorder the function arguments to match the docstring. NFC, but might avoid some confusion for IDEs that show the actual signature. cc @udohjeremiah --- stdlib/InteractiveUtils/src/InteractiveUtils.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/InteractiveUtils/src/InteractiveUtils.jl b/stdlib/InteractiveUtils/src/InteractiveUtils.jl index 2b8990764509a..ee19cb49f33aa 100644 --- a/stdlib/InteractiveUtils/src/InteractiveUtils.jl +++ b/stdlib/InteractiveUtils/src/InteractiveUtils.jl @@ -21,7 +21,7 @@ include("macros.jl") include("clipboard.jl") """ - varinfo(m::Module=Main, pattern::Regex=r""; all::Bool = false, imported::Bool = false, recursive::Bool = false, sortby::Symbol = :name, minsize::Int = 0) + varinfo(m::Module=Main, pattern::Regex=r""; all=false, imported=false, recursive=false, sortby::Symbol=:name, minsize::Int=0) Return a markdown table giving information about exported global variables in a module, optionally restricted to those matching `pattern`. @@ -34,7 +34,7 @@ The memory consumption estimate is an approximate lower bound on the size of the - `sortby` : the column to sort results by. Options are `:name` (default), `:size`, and `:summary`. - `minsize` : only includes objects with size at least `minsize` bytes. Defaults to `0`. """ -function varinfo(m::Module=Base.active_module(), pattern::Regex=r""; all::Bool = false, imported::Bool = false, sortby::Symbol = :name, recursive::Bool = false, minsize::Int=0) +function varinfo(m::Module=Base.active_module(), pattern::Regex=r""; all::Bool = false, imported::Bool = false, recursive::Bool = false, sortby::Symbol = :name, minsize::Int=0) sortby in (:name, :size, :summary) || throw(ArgumentError("Unrecognized `sortby` value `:$sortby`. Possible options are `:name`, `:size`, and `:summary`")) rows = Vector{Any}[] workqueue = [(m, ""),]