michaellzc / vscode-hadolint

VSCode extension to integrate hadolint, a Dockerfile linter, into VSCode
https://marketplace.visualstudio.com/items?itemName=exiasr.hadolint
MIT License
78 stars 5 forks source link

Weird error: "expecting is not a supported rule" #60

Open darkvertex opened 3 years ago

darkvertex commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Ensure autosave is ON, make a new Dockerfile.
  2. Start typing this:
    FROM node:latest
    WORKDIR 

    (Note: WORKDIR has a space after it.)

  3. A notification should appear: hadolint: expecting is not a supported rule

Expected behaviour Okay, so an empty "WORKDIR" is nonsense, but I would not expect the hadolint extension to be worrying about it, let alone throwing a cryptic notification.

Screenshots or Dockerfile

FROM node:latest
WORKDIR 

(Note: WORKDIR has a space after it.) image ...and if I pop open the Help->Developer Tools window, I got this in the JS Console: image

Environment and version (please complete the following information):

Debug information I tried running the same command that the extension output log said it was running:

> hadolint C:\Users\alan\repos\redacted\buggy.Dockerfile --no-color
C:\Users\alan\repos\redacted\buggy.Dockerfile:2:9 expecting the workdir path

From my naive understanding, it appears like maybe the extension is expecting rule-style (DLXXXXX....) output strings all the time and not handling those few error messages that don't have a rule to them.

Additional context This issue looks related to #46 and #55.

darkvertex commented 3 years ago

I should perhaps add that (I think due to #42) even after closing the buggy file, hadolint continues to haunt my notification corner over the file it can't parse right.

bendem commented 1 year ago

I have kind of the same error: image

> hadolint /home/demarteaub/projects/infra/docker/postgres/patroni/Dockerfile
/home/demarteaub/projects/infra/docker/postgres/patroni/Dockerfile:79:5 unexpected '&' expecting '#', '\', ADD, ARG, CMD, COPY, ENTRYPOINT, ENV, EXPOSE, FROM, HEALTHCHECK, LABEL, MAINTAINER, ONBUILD, RUN, SHELL, STOPSIGNAL, USER, VOLUME, WORKDIR, a pragma, at least one space, or end of input

> hadolint --version
Haskell Dockerfile Linter 2.12.0
Stikus commented 12 months ago

I had the same error as @bendem - any plans to fix it? @michaellzc

Creative-Difficulty commented 2 months ago

same issue @michaellzc