Skip to content
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

Error: unable to parse Dockerfile: unexpected token comment #12

Open
akkadaya opened this issue May 13, 2024 · 0 comments
Open

Error: unable to parse Dockerfile: unexpected token comment #12

akkadaya opened this issue May 13, 2024 · 0 comments

Comments

@akkadaya
Copy link

akkadaya commented May 13, 2024

Describe the bug

dprint-plugin-dockerfile version: 0.3.0

Input Code

RUN \
# Print Hello World!
echo 'Hello World!'

Expected Output

RUN \
  # Print Hello World!
  echo 'Hello World!'

Actual Output

❌ Error:

[ERROR] Error formatting text. Error: unable to parse Dockerfile: unexpected token comment

RUN \
# Print Hello World!
echo 'Hello World!'

Additional Information

if I move the comment up or down, it'll work fine but it breaks only when the comment sits under RUN \ directly

# Print Hello World!
RUN \
echo 'Hello World!' \
# Print Hello World!
echo 'Hello World!'

⚠️ BUT, the comment and the subsequent code will not be formatted!
Output:

# Print Hello World!
RUN echo 'Hello World!' \
# Print Hello World!
echo 'Hello World!'
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

No branches or pull requests

1 participant