Allow optional: :all when deriving Inspect
Inspect ill-formed structs as maps
Module
26 changes across 17 versions
Changes by version
Allow optional: :all when deriving Inspect
Inspect ill-formed structs as maps
Inspect now renders 'charlists' as ~c"charlists" by default
Add :sort_maps to Inspect.Opts.custom_options
Improve error reporting when there is a faulty implementation of the Inspect protocol
Allow :optional when deriving the Inspect protocol for hiding fields that match their default value
Inspect struct fields in the order they are declared in defstruct
Use expression-based inspection for Date.Range, MapSet, and Version.Requirement
Allow default inspect fun to be set globally with Inspect.Opts.default_inspect_fun/1
Fix a bug when inspecting a non-binary bitstring with colors
Do not override user supplied :limit option for derived implementations
Add :inspect_fun and :custom_options to Inspect.Opts
Allow Inspect protocol to be derivable with the :only/:except options
Show UTF-8 BOM on inspected strings
Properly handle minus signal for non-decimal negative integers
Add :printable_limit to control the limit of printable structures
Do not use colors when inspecting error messages
Support syntax coloring via the :syntax_color option
Support :base option when inspecting binaries
Ensure binaries break into new lines when inspected
Add the :safe option to inspect/2 and make it safe by default, meaning failures while inspecting won't trigger other failures. Instead, it will be wrapped in an exception which is properly formatted
Keep original stacktrace on Inspect errors
Support :base option in inspect/2 to choose the base (:binary, :octal, :decimal or :hex) numbers a printed
Inspect.Algebra.surround_many/6 now expects Inspect.Opts instead of an integer limit
Inspect.Algebra.pretty/2 is deprecated in favor of Inspect.Algebra.format/2 that instead returns iodata. This function was used only by documentation examples and it is unlikely to affect actual code
Ensure Inspect.Algebra.to_doc/2 doesn't go into a loop when there is a failure printing a struct