on master help sign in
Whitelist 0.15 package names with uppercase letters.
commit247b2582ea8ade5ea554351b7babfdba643ba1f3 authorLaszlo Pandy <laszlo.pandy@prezi.com> dateWed 18 Nov 2015, 11:38 (11 years ago) parent1b1a899
1 file changed+62
src/Elm/Package.hs+62
src/Elm/Package.hs+62
@@ -66,6 +66,65 @@ fromString string =
6666 Left "There should be a slash separating the user and project name (user/project)"
6767
6868
69+whitelistedUppercaseName :: String -> Bool
70+whitelistedUppercaseName name =
71+ -- These packages were uploaded to package.elm-lang.org before version 0.16,
72+ -- when uppercase letters were disallowed in package names.
73+ -- They should be considered deprecated and removed from this list once users
74+ -- migrate to using the lowercase versions of the names.
75+ let whitelist =
76+ [ "Apanatshka/elm-list-ndet"
77+ , "Apanatshka/elm-signal-extra"
78+ , "Bogdanp/elm-combine"
79+ , "Dandandan/Easing"
80+ , "Dandandan/parser"
81+ , "JoeyEremondi/LoadAssets"
82+ , "JoeyEremondi/elm-MultiDimArray"
83+ , "JoeyEremondi/elm-SafeLists"
84+ , "JoeyEremondi/elm-typenats"
85+ , "JustusAdam/elm-path"
86+ , "NoRedInk/elm-check"
87+ , "NoRedInk/elm-lazy-list"
88+ , "NoRedInk/elm-rails"
89+ , "NoRedInk/elm-random-extra"
90+ , "NoRedInk/elm-shrink"
91+ , "NoRedInk/elm-string-extra"
92+ , "NoRedInk/elm-task-extra"
93+ , "TheSeamau5/GraphicsEngine"
94+ , "TheSeamau5/elm-check"
95+ , "TheSeamau5/elm-history"
96+ , "TheSeamau5/elm-html-decoder"
97+ , "TheSeamau5/elm-lazy-list"
98+ , "TheSeamau5/elm-material-icons"
99+ , "TheSeamau5/elm-quadtree"
100+ , "TheSeamau5/elm-random-extra"
101+ , "TheSeamau5/elm-rosetree"
102+ , "TheSeamau5/elm-router"
103+ , "TheSeamau5/elm-shrink"
104+ , "TheSeamau5/elm-spring"
105+ , "TheSeamau5/elm-task-extra"
106+ , "TheSeamau5/elm-undo-redo"
107+ , "TheSeamau5/flex-html"
108+ , "TheSeamau5/selection-list"
109+ , "TheSeamau5/typographic-scale"
110+ , "ThomasWeiser/elmfire"
111+ , "ThomasWeiser/elmfire-extra"
112+ , "adam-r-kowalski/Elm-Css"
113+ , "deadfoxygrandpa/Elm-Test"
114+ , "heyLu/elm-format-date"
115+ , "jterbraak/DateOp"
116+ , "maxsnew/IO"
117+ , "mgold/Elm-Align-Distribute"
118+ , "mgold/Elm-Format-String"
119+ , "mgold/Elm-Multiset"
120+ , "mgold/Elm-Random-Sampling"
121+ , "thSoft/ElmCache"
122+ , "thSoft/ExternalStorage"
123+ , "uehaj/IntRange"
124+ ]
125+ in
126+ List.any (\x -> x == name) whitelist
127+
69128validate :: String -> Either String String
70129validate str =
71130 if elem ('-','-') (zip str (tail str)) then
@@ -74,6 +133,9 @@ validate str =
74133 else if elem '_' str then
75134 Left "Underscores are not allowed in package names."
76135
136+ else if any Char.isUpper str && not (whitelistedUppercaseName str) then
137+ Left "Upper case characters are not allowed in package names."
138+
77139 else if not (Char.isLetter (head str)) then
78140 Left "Package names must start with a letter."
79141