on master help sign in
Add more restrictions on repo names

No dots in names, and names cannot end with dashes.

commit372b73e6f80c7d46ccf55e3c5a1570c103be6b19 authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 5 Jul 2017, 17:39 (9 years ago) parent2e354ce
1 file changed+6
src/Elm/Package.hs+6
src/Elm/Package.hs+6
@@ -125,12 +125,18 @@ validateProjectName text =
125125 else if Text.isInfixOf "_" text then
126126 Left "Underscores are not allowed in package names."
127127
128+ else if Text.isInfixOf "." text then
129+ Left "Dots are not allowed in package names."
130+
128131 else if Text.any Char.isUpper text then
129132 Left "Upper case characters are not allowed in package names."
130133
131134 else if not (Char.isLetter (Text.head text)) then
132135 Left "Package names must start with a letter."
133136
137+ else if Text.isSuffixOf "-" text then
138+ Left "Package names cannot end with a dash."
139+
134140 else
135141 Right text
136142