eclipse-archived / ceylon-herd

The Ceylon repository web application
Apache License 2.0
21 stars 11 forks source link

ModuleChecker should check module names and versions #71

Closed FroMage closed 11 years ago

FroMage commented 12 years ago

To see if they are legal.

thradec commented 11 years ago

Done.

FroMage commented 11 years ago

Sorry I think this is too strict for Java modules, see my comments inline.

thradec commented 11 years ago

I did it by specification. Chapter 8.2.1 ...

A module name is a period-separated list of lowercase identifiers, for example:

and

A module version identifier is a character string containing digits, periods, and lowercase letters

FroMage commented 11 years ago

Well, perhaps the spec is not up to date then, see https://github.com/ceylon/ceylon-spec/blob/master/Ceylon.g#L3658

So module names confirm to package names, which are sequences of LIDENTIFIER which means that _foo89.bar23._a_ is legal, even including '\u00c0'..'\ufffe'.

As for module versions, it appears to be just any CHAR_LITERAL https://github.com/ceylon/ceylon-spec/blob/master/Ceylon.g#L78

In any case, these restrictions don't apply to Java modules we would upload.

gavinking commented 11 years ago

@thradec this section of the spec is talking about the names of Ceylon modules. The spec does not really define interoperation with legacy module archives, but it mentions the idea in section 8.2.10.

thradec commented 11 years ago

According to our conversation, check is applied only on car and js, and regex pattern should allow same names like grammar.

FroMage commented 11 years ago

Looks good to me, thanks!