mojolicious / mojo

:sparkles: Mojolicious - Perl real-time web framework
https://mojolicious.org
Artistic License 2.0
2.66k stars 576 forks source link

Some of the app names lead to the generation of broken code #1567

Closed Greenfactory closed 3 years ago

Greenfactory commented 3 years ago

Some of the app names lead to the generation of broken code. So that this does not happen, it is worth checking the app name.

$ mojo generate app app-api
$ ./app-api/script/app-api
Can't find application class "app-api" in @INC.  (/home/gr...
$ perl -wc app-api/lib/app-api.pm 
Invalid version format (negative version number) at app-api/lib/app-api.pm line 1, near "package app"
syntax error at app-api/lib/app-api.pm line 1, near "package app-"
BEGIN not safe after errors--compilation aborted at app-api/lib/app-api.pm line 2.

In app-api.pm bad package name

$ head -1 app-api/lib/app-api.pm
package app-api;

Some code for this bug is here: https://github.com/mojolicious/mojo/pull/1559

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It may be closed if no further activity occurs. This is not a judgment on the merits of the issue, but an indication that more information may be needed to determine the appropriate course of action, if any. Thank you for your contributions.

kraih commented 3 years ago

That's ok, we don't validate all input.