Skip to content

Digest in image breaks formatting #19

@scop

Description

@scop

Describe the bug

dprint-plugin-dockerfile version: 0.3.2

Using a digest in the image in FROM breaks formatting.

Based on release notes looks like dockerfile-parser-rs 0.9.0 could fix it: https://github.com/HewlettPackard/dockerfile-parser-rs/releases/tag/v0.9.0

Input Code

FROM golang:1.24.1@sha256:fa145a3c13f145356057e00ed6f66fbd9bf017798c9d7b2b8e956651fe4f52da

Expected Output

FROM golang:1.24.1@sha256:fa145a3c13f145356057e00ed6f66fbd9bf017798c9d7b2b8e956651fe4f52da

Actual Output

Error formatting /path/to/Dockerfile. Message: could not parse Dockerfile:  --> 1:19
  |
1 | FROM golang:1.24.1@sha256:fa145a3c13f145356057e00ed6f66fbd9bf017798c9d7b2b8e956651fe4f52da␊␊
  |                   ^---
  |
  = expected EOI
Had 1 error formatting.

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