Posted Mon, 07 Dec 2015 14:00:47 GMT in reply to
Luís Marques
Reply
On Wed, 04 Nov 2015 17:24:19 GMT, Luís Marques wrote:
DUB now complains about the package name example.org
. Changing this to example-org
IMHO reduces the prettiness of the name (and you have to specify the old executable name separately, slightly against DRY). Given that -
is not a valid identifier character in most languages anyway, any change to add dot to the list of acceptable characters in DUB package names?
Allowing "-" was kind of a compromise, because it looks less awkward/heavy as a separator than "_". Without that we'd indeed have the beauty that package names would be valid indentifiers within the target programming language. But the main reason to disallow arbitrary characters was to not accidentally harm future developments. For example ":" is now used to delimit sub packages from each other and "," may be used to separate names on the command line. The reasoning was to start strict and relax the conditions once we are clear that it won't do harm.
Alternatively, we could have instead selected a set of all possibly critical characters as reserved and allow all other characters (either ASCII or Unicode), but we can still do that today, while the inverse wouldn't be possible.
In any case, the warning message (DUB package names may only contain alphanumeric characters, as well as '-' and '_'.
) is a bit misleading, only ASCII alphanumeric characters are accepted. Either the check or the message should be tweaked, no?
The check explicitly includes "-" and "_": https://github.com/D-Programming-Language/dub/blob/aecc5b9da2c81db7f9b7eedf1e6534be300148ea/source/dub/project.d#L191