-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a hyphen in the name when scaffolding causes the application to error out #38
Comments
Thanks for the report. Indeed the issue is caused by not sanitizing hyphens in the application name. This also occurs with endpoint names. For example, this will generate an application module and endpoint module both with hyphens in their names.
Hyphens are not always invalid - for example, a URL can contain hyphens, which the scaffolder generates from the application and endpoint names. As such, we can resolve this by replacing hyphens with underscores for the module names only. We need to be mindful of a user specifying a command like this. bl-python-scaffold create -n foo \
-e foo-bar \
-e foo_bar It may be appropriate to display a warning and continue generating the application anyway, or prompt the user whether to continue. If generating cannot be done safely in this case, the scaffolder should error and quit. |
…d endpoint names. - disallows duplicate endpoint names - disallows endpoints that share the same name as an application Closes #38
Used the following command:
bl-python-scaffold create -n test-scaffold -t openapi -m database
After creating the virtual environment and installing the app, the program crashes when trying to run.
This seems to occur because when the code is generated, invalid module names can be used and therefore causes failure when importing.
The text was updated successfully, but these errors were encountered: