Skip to content

Commit

Permalink
bugfix: name regex was incorrectly accepting uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum committed Sep 22, 2023
1 parent 53bb03f commit ec0ecd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gto/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def tag_to_name(value):


dirname = "[a-z0-9-_./]+" # improve?
name = r"[a-z0-9]([a-z0-9-/_]*[A-Za-z0-9])?"
name = r"[a-z0-9]([a-z0-9-/_]*[a-z0-9])?"
semver = r"(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?"
counter = "?P<counter>[0-9]+"
name_re = re.compile(f"^{name}$")
Expand Down
1 change: 1 addition & 0 deletions tests/test_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_check_name_is_valid(name):
"model#1",
"@namespace/model",
"DVCLive/Model",
"model A",
],
)
def test_check_name_is_invalid(name):
Expand Down

0 comments on commit ec0ecd5

Please sign in to comment.