language-docker 10.1.0 → 10.1.1
raw patch · 4 files changed
+21/−4 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- language-docker.cabal +2/−2
- src/Language/Docker/Parser/Prelude.hs +2/−2
- test/Language/Docker/ParseCopySpec.hs +6/−0
- test/Language/Docker/ParseRunSpec.hs +11/−0
language-docker.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 3b38c6eec0fc0543e696e51fa5a654074e9718ae41bd50f4114824964938c535+-- hash: f5a50fe92ae4dd5da15e1c9273d27b742ae2ea0d62734a8be7e7a292a0f94571 name: language-docker-version: 10.1.0+version: 10.1.1 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/Prelude.hs view
@@ -182,7 +182,7 @@ heredocContent :: Text -> Parser Text heredocContent marker = do- doc <- manyTill L.charLiteral (string marker)+ doc <- manyTill anySingle (string marker) return $ T.strip $ T.pack doc heredoc :: Parser Text@@ -193,7 +193,7 @@ -- | Parses text until a heredoc is found. Will also consume the heredoc. untilHeredoc :: Parser Text untilHeredoc = do- txt <- manyTill L.charLiteral heredoc+ txt <- manyTill anySingle heredoc return $ T.strip $ T.pack txt onlySpaces :: Parser Text
test/Language/Docker/ParseCopySpec.hs view
@@ -136,3 +136,9 @@ file [ Copy $ CopyArgs [SourcePath "FOO", SourcePath "BAR", SourcePath "FIZZ", SourcePath "BUZZ"] (TargetPath "/target") NoChown NoChmod NoSource ]+ it "foo heredoc with line continuations" $+ let file = Text.unlines ["COPY <<FOO /target", "foo \\", "bar", "FOO"]+ in assertAst+ file+ [ Copy $ CopyArgs [SourcePath "FOO"] (TargetPath "/target") NoChown NoChmod NoSource+ ]
test/Language/Docker/ParseRunSpec.hs view
@@ -332,3 +332,14 @@ let file = Text.unlines [ "RUN python <<EOF > /file", "print(\"foo\")", "EOF" ] flags = def {security = Nothing } in assertAst file [ Run $ RunArgs (ArgumentsText "python") flags ]+ it "heredoc with line continuation" $+ let file = Text.unlines [ "RUN <<EOF", "apt-get update", "apt-get install foo bar \\", " buzz bar", "EOF" ]+ flags = def {security = Nothing }+ in assertAst+ file+ [ Run $ RunArgs+ ( ArgumentsText+ "apt-get update\napt-get install foo bar \\\n buzz bar"+ )+ flags+ ]