Skip to content

Digest in image breaks formatting #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
scop opened this issue Mar 17, 2025 · 1 comment · May be fixed by #20
Open

Digest in image breaks formatting #19

scop opened this issue Mar 17, 2025 · 1 comment · May be fixed by #20

Comments

@scop
Copy link
Contributor

scop commented Mar 17, 2025

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.
scop added a commit to scop/dprint-plugin-dockerfile that referenced this issue Mar 19, 2025
For digest in FROM image support.

Closes dprint#19
@scop scop linked a pull request Mar 19, 2025 that will close this issue
@scop
Copy link
Contributor Author

scop commented Mar 19, 2025

Confirmed 0.9.0 to fix it, PR in #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant