tldr; Now you can do this:
Scribe’s latest v0.6.0
release overrides Inspect
for lists and maps. Simply installing the package will enable it, but you can also disable with config :scribe, enable: false
if necessary.
Again to reiterate: This will redefine the Inspect protocol. Tread lightly in production.
I wish there was a less hacky solution to implement this, but for now the override is an almost direct copy/paste of source from the Elixir 1.5 and 1.6 branches, modified slightly to use Scribe’s formatter where needed. Suggestions are welcome here if there’s a better solution.
Future Roadmap
- Proper handling of
Inspect.Opts
where Scribe’s formatter takes over. Currently the opts are ignored, as I still need to rework Scribe’s formatting opts to accommodate the new functionality. This will be addressed in the next minor release. Scribe.Inspect
protocol for your structs to define custom table headers. Printing a struct with too many columns looks terrible if it line wraps.
Feedback is welcome!