Skip to content

Don't inline multilines separated by \ in COPY statements #56

Description

@becknik

When I use multiple --exclude directives inside of a COPY statement where each --exclude has it's own line, dockerfmt seems to inline them into one line.

I'd be nice if the newlines and backslashes are kept during formatting - actually am not really sure why this doesn't apply to COPY while it is enforced in RUN and ENV

Example:

COPY exclude=nginx-default.conf \
  --exclude=zap-scan-automation-framework.yml \
  --exclude=renovate.json5 \
  --exclude=compose.yml \
  --exclude=nginx.Dockerfile \
  --exclude=Dockerfile \
  --exclude=sonarqube-server.Dockerfile \
  . .
# becomes
COPY --exclude=nginx-default.conf --exclude=zap-scan-automation-framework.yml -excl ude=renovate.json5 --exclude=compose.yml --exclude=nginx.Dockerfile --exclude=Dockerfile -exclude=sonarqube-server.Dockerfile . .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions