Skip to content

Heredoc not recognized after line continuation #1019

@jscheid

Description

@jscheid
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Should accept heredocs when combined with line continuation (backslash at EOL.)

Actual behavior

/tmp/Dockerfile:6:1 unexpected 'b' expecting '#', '\', ADD, ARG, CMD, COPY, ENTRYPOINT, ENV, EXPOSE, FROM, HEALTHCHECK, LABEL, MAINTAINER, ONBUILD, RUN, SHELL, STOPSIGNAL, USER, VOLUME, WORKDIR, a pragma, at least one space, or end of input

Steps to reproduce the behavior

hadolint /tmp/Dockerfile

Output of hadolint --version or
docker run --rm hadolint/hadolint hadolint --version or
docker run --rm ghcr.io/hadolint/hadolint hadolint --version:

Haskell Dockerfile Linter 2.12.0

Dockerfile (if relevant)

# syntax=docker/dockerfile:1.7-labs
FROM scratch

RUN foo && \
    bar <<BAR
blah
BAR

Additional environment details (OS, stack version, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions