Skip to content

Add validator for double and single quotes in name and description #407

Closed

Description

@lyashevska

This can be used for inspiration

full_name:
  type: str
  default: Jane Smith
  help: Enter your full name.
  # validator: >-
  #       {% if '"' in full_name %}
  #       full_name must not contain unescaped double quotes. Use \\" for double quotes.
  #       {% endif %}

Activity

  1. abelsiqueira commented on Jul 31, 2024

    @abelsiqueira
    Member

    We're using a regex to validate the package name: https://github.com/abelsiqueira/BestieTemplate.jl/blob/b1114d039578dbd5a132a8955c87352e6371448d/copier.yml#L9
    Maybe it's helpful, maybe it's overkill.

  2. lyashevska commented on Jul 31, 2024

    @lyashevska
    CollaboratorAuthor

    @abelsiqueira thanks, this is great indeed. We also use it for some of the variables.
    I thinks the original functionality was to ensure that any double/single quotes are escaped. Do we want to allow this? I guess it is debatable.
    This was implemented via cookicutter hooks like so:
    "full_name": cookiecutter.full_name.replace('\"', '\\\"'),

  3. lyashevska commented on Aug 15, 2024

    @lyashevska
    CollaboratorAuthor

    Closing as addressed via #414

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions