Skip to content

Commit

Permalink
Verify cookiecutter input for invalid characters
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Jan 31, 2024
1 parent 9143bba commit b9441f4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fprime.util.cookiecutter_wrapper import is_valid_name

name = "{{ cookiecutter.deployment_name }}"

if is_valid_name(name) != "valid":
raise ValueError(
f"Unacceptable deployment name: {name}. Do not use spaces or special characters"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fprime.util.cookiecutter_wrapper import is_valid_name

name = "{{ cookiecutter.module_name }}"

if is_valid_name(name) != "valid":
raise ValueError(
f"Unacceptable module name: {name}. Do not use spaces or special characters"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fprime.util.cookiecutter_wrapper import is_valid_name

name = "{{ cookiecutter.project_name }}"

if is_valid_name(name) != "valid":
raise ValueError(
f"Unacceptable project name: {name}. Do not use spaces or special characters"
)

0 comments on commit b9441f4

Please sign in to comment.