Skip to content

Instruction options are duplicated when formatting line breaks #42

@kirillmorozov

Description

@kirillmorozov

Hi, I've recently discovered this cool project and wanted to integrate it into my Vim config but I've encountered a bug that prevents me from doing so.

Steps to reproduce:

cat << EOF > Dockerfile
FROM python:3.10-slim-bookworm AS development
COPY pyproject.toml /app
RUN --mount=type=bind,source=requirements.lock,target=requirements.lock \
  --mount=type=ssh \
  pip install -r requirements.lock
COPY main.py /app
ENTRYPOINT ["python", "main.py"]
EOF

dockerfmt Dockerfile

Output:

FROM python:3.10-slim-bookworm AS development
COPY pyproject.toml /app
RUN --mount=type=bind,source=requirements.lock,target=requirements.lock --mount=type=ssh --mount=type=ssh pip install -r requirements.lock
COPY main.py /app
ENTRYPOINT ["python", "main.py"]

Notice how --mount=type=ssh option got duplicated when line breaks were eliminated.

I'm using dockerfmt version 0.3.9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions