language-docker 9.1.2 → 9.1.3
raw patch · 3 files changed
+9/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- language-docker.cabal +2/−2
- src/Language/Docker/Parser/Instruction.hs +5/−0
- test/Language/Docker/ParserSpec.hs +2/−0
language-docker.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: ae482d4758686e114cb8d504d57ff8a1de39b6262598d3823f9b1b195035e9b0+-- hash: 288e8bea2c06314b9ba46925a5e5fa3c9c64e936b4c768874597c11d8bb53de4 name: language-docker-version: 9.1.2+version: 9.1.3 synopsis: Dockerfile parser, pretty-printer and embedded DSL description: All functions for parsing and pretty-printing Dockerfiles are exported through @Language.Docker@. For more fine-grained operations look for specific modules that implement a certain functionality. See the <https://github.com/hadolint/language-docker GitHub project> for the source-code and examples.
src/Language/Docker/Parser/Instruction.hs view
@@ -41,8 +41,13 @@ parseArg = do reserved "ARG" (try nameWithDefault <?> "the arg name")+ <|> (try nameWithoutDefault <?> "the arg name") <|> Arg <$> untilEol "the argument name" <*> pure Nothing where+ nameWithoutDefault = do+ name <- someUnless "the argument name" (== '=')+ void $ untilEol "the rest"+ return $ Arg name Nothing nameWithDefault = do name <- someUnless "the argument name" (== '=') void $ char '='
test/Language/Docker/ParserSpec.hs view
@@ -31,6 +31,8 @@ describe "parse ARG" $ do it "no default" $ assertAst "ARG FOO" [Arg "FOO" Nothing]+ it "no default with =" $+ assertAst "ARG FOO=" [Arg "FOO" Nothing] it "with default" $ assertAst "ARG FOO=bar" [Arg "FOO" (Just "bar")] describe "parse FROM" $ do