Packages not in uppercase should not be accepted#19824
Conversation
jecisc
left a comment
There was a problem hiding this comment.
LGTM
I just wonder if we should have an error or if we should just call #capitalized? In order to not break the loading of older code that might have lowercase package names?
I have the feeling this is not a good decision.
I understand this point. |
|
This is strange because I thought we already fixed this. |
|
this test is failing and is related |
Nice! :D So there were tests creating broken packages! |
|
I patched that test, but this is just bad:
We "transparently" let users create packages with spaces, and those spaces are magically trimmed. This is related to the uppercase issue and comment above by @jecisc . The issue with "magically" fixing the names is that this can be an issue that carries over many different places. What if the spaces happen due to a wrong concatenation? how much time until we realize? |
|
I see you prefer to raise an exception that the tools catch it and prompt the user. BTW |
| ifTrue: [ Package named: aPackage organizer: self ] | ||
| ifFalse: [ aPackage organizer: self ]. | ||
|
|
||
| package name first isUppercase ifFalse: [ self error: 'Package names should be uppercase' ]. |
There was a problem hiding this comment.
Why this test is not performed before?

Packages not in uppercase should not be accepted, because the system is not prepared for it:
By convention they should be in uppercase.
Right now, we support lowecase packages, but then they cannot be renamed (because package duplication is compared case insensitive), and many bugs are hit afterwards.
Prevent all issues by just preventing lowercase packages.
6 lines of test, 1 line of fix.