Skip to content
Snippets Groups Projects

Resolve "repo_name must not contain hyphens or other illegal characters and project_short_name is missleading"

8 files
+ 27
23
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 11
3
import re
import sys
project_short_name = '{{cookiecutter.project_short_name}}'
MODULE_REGEX = r'^[_a-zA-Z][_a-zA-Z0-9]+$'
repo_name = '{{cookiecutter.repo_name}}'
grammar_name = '{{cookiecutter.grammar_name}}'
def main():
if not project_short_name.isalnum():
print('project_short_name "' + project_short_name + '" must be a single word. Exiting.')
if not re.match(MODULE_REGEX, repo_name):
print('Error: repo_name "%s" is not a valid URL and Java package name' % repo_name)
sys.exit(1)
if not grammar_name.isalnum():
print('Error: grammar_name "%s" must be a single word. Exiting.' % grammar_name)
sys.exit(1)
Loading