on master help sign in
Trim down @laszlopandy's exception list
be9f59aEvan Czaplicki
src/Elm/Package.hs+23−56
@@ -57,7 +57,7 @@ fromString string =
57 Left "You did not provide a project name (user/project)"
57 Left "You did not provide a project name (user/project)"
58
58
59 else if all (/='/') project then
59 else if all (/='/') project then
60− Name user <$> validate project
60+ Name user <$> validateProjectName project
61
61
62 else
62 else
63 Left "Expecting only one slash, separating the user and project name (user/project)"
63 Left "Expecting only one slash, separating the user and project name (user/project)"
@@ -72,61 +72,28 @@ whitelistedUppercaseName name =
72 -- when uppercase letters were disallowed in package names.
72 -- when uppercase letters were disallowed in package names.
73 -- They should be considered deprecated and removed from this list once users
73 -- They should be considered deprecated and removed from this list once users
74 -- migrate to using the lowercase versions of the names.
74 -- migrate to using the lowercase versions of the names.
75− let whitelist =
75+ List.elem name
76− [ "Apanatshka/elm-list-ndet"
77− , "Apanatshka/elm-signal-extra"
78− , "Bogdanp/elm-combine"
79− , "Dandandan/Easing"
76+ [ "Easing"
80− , "Dandandan/parser"
81− , "JoeyEremondi/LoadAssets"
77+ , "LoadAssets"
82− , "JoeyEremondi/elm-MultiDimArray"
78+ , "elm-MultiDimArray"
83− , "JoeyEremondi/elm-SafeLists"
79+ , "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"
80+ , "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"
81+ , "Elm-Css"
113− , "deadfoxygrandpa/Elm-Test"
82+ , "Elm-Test"
114− , "heyLu/elm-format-date"
115− , "jterbraak/DateOp"
83+ , "DateOp"
116− , "maxsnew/IO"
84+ , "IO"
117− , "mgold/Elm-Align-Distribute"
85+ , "Elm-Align-Distribute"
118− , "mgold/Elm-Format-String"
86+ , "Elm-Format-String"
119− , "mgold/Elm-Multiset"
87+ , "Elm-Multiset"
120− , "mgold/Elm-Random-Sampling"
88+ , "Elm-Random-Sampling"
121− , "thSoft/ElmCache"
89+ , "ElmCache"
122− , "thSoft/ExternalStorage"
90+ , "ExternalStorage"
123− , "uehaj/IntRange"
91+ , "IntRange"
124− ]
92+ ]
125− in
93+
126− List.any (\x -> x == name) whitelist
94+
127−
128−validate :: String -> Either String String
95+validateProjectName :: String -> Either String String
129−validate str =
96+validateProjectName str =
130 if elem ('-','-') (zip str (tail str)) then
97 if elem ('-','-') (zip str (tail str)) then
131 Left "There is a double dash -- in your package name. It must be a single dash."
98 Left "There is a double dash -- in your package name. It must be a single dash."
132
99