dfmt
dfmt copied to clipboard
EditorConfig "max_line_length = off" triggers conversion exception
According to this documentation, the max_line_length
EditorConfig property can be positive integers or the string "off". Setting it to the latter triggers a conversion exception with dfmt, however.
Output of dub fetch --version='~master' dfmt && dub run dfmt -- anycodefile.d
(revision 024c6e6a6)
std.conv.ConvException@/usr/include/dlang/dmd/std/conv.d(2309): Unexpected 'o' when converting from type string to type int
----------------
/usr/include/dlang/dmd/std/conv.d:84 pure @safe int std.conv.parse!(int, immutable(char)[]).parse(ref immutable(char)[]) [0x5643212f9d21]
/usr/include/dlang/dmd/std/conv.d:1902 pure @safe int std.conv.toImpl!(int, immutable(char)[]).toImpl(immutable(char)[]) [0x5643212f9e3c]
/usr/include/dlang/dmd/std/conv.d:222 pure @safe int std.conv.to!(int).to!(immutable(char)[]).to(immutable(char)[]) [0x5643212f9b47]
../../.dub/packages/dfmt-master/dfmt/src/dfmt/editorconfig.d:210 dfmt.config.Config[] dfmt.editorconfig.parseConfig!(dfmt.config.Config).parseConfig(immutable(char)[]) [0x5643212f1ba2]
../../.dub/packages/dfmt-master/dfmt/src/dfmt/editorconfig.d:140 dfmt.config.Config dfmt.editorconfig.getConfigFor!(dfmt.config.Config).getConfigFor(immutable(char)[]) [0x5643212f0de4]
../../.dub/packages/dfmt-master/dfmt/src/dfmt/main.d:241 _Dmain [0x564321309d6d]
Program exited with code 1
This bug is stil present in version v0.14.2.