Skip Menu |

This queue is for tickets about the Type-Tiny CPAN distribution.

Report information
The Basics
Id: 89251
Status: resolved
Priority: 0/
Queue: Type-Tiny

People
Owner: perl [...] toby.ink
Requestors: TIMB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Make truncation length in Type::Tiny::_dd (currently 72) configurable
Whatever value is picked it won't suit some cases. It ought to be configurable. A package variable would be fine.
I'd also argue that 72 is too low, especially when dealing with structures. (This isn't a punched-card or even a git commit message title. My standard window is 176 columns.) For example: Reference {"inflate_via" => "pg","inflate_with" => {"with_age" => 1,"w...} did not pass type constraint "Dict[inflate_via=>Maybe[StrMatch[(?-xism:^(?:es|pg)$)]],inflate_with=>Maybe[HashRef],page_number=>PageNumberType,rows_per_page=>Int2_not_negative,search_criteria=>Ref,search_via=>Maybe[StrMatch[(?-xism:^(?:es|pg)$)]],sort_order=>Str]" The truncation means the error message isn't helpful in identifying the actual cause. It's a pity that Data::Dumper doesn't offer more control, such as limiting the length of individual values. I understand that Type::Tiny has to live with that. Perhaps, in addition to raising the default (I'd suggest somewhere around 300..500), you'd consider making the ref dumping part of _dd pluggable so users can provide their own.
I've checked in a change that allows you to set $Type::Tiny::DD to a coderef which will be responsible for dumping data. I'll consider a max width setting as well.
I've checked into the repo the ability to set $DD to a number instead of a coderef.
Fixed in 0.030.