Skip to content

Commit eb76c03

Browse files
authored
feat: ✨ add validator for package_github_repo (#93)
# Description This PR adds a validator for `package_github_repo`. Closes #48 This PR needs a quick review. ## Checklist - [x] Formatted Markdown - [x] Ran `just run-all`
1 parent ea36263 commit eb76c03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

copier.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ _subdirectory: template
33
# Questions:
44
package_github_repo:
55
type: str
6-
help: "What is the GitHub repository spec for the package (in the form of 'user/repo'))?"
6+
help: "What is the GitHub repository spec for the package?"
77
placeholder: "user/repo"
8+
validator: |
9+
{% if package_github_repo and not (package_github_repo | regex_search('^[\w.-]+\/[\w.-]+$')) %}
10+
Must be in the format `user/repo` and contain only alphanumeric characters and `_`, `-`, or `.`.
11+
{% endif %}
812
913
author_given_name:
1014
type: str

0 commit comments

Comments
 (0)