Skip to content

Allow trailing whitespace in ignore comments #997

@PeterStolz

Description

@PeterStolz
  • This is a bug report
  • This is a feature request
  • I searched existing issues before opening this one

Expected behavior

Not sure if this is a bug, so I opened as a feature request. I would expect the ignore rules to strip/ignore trailing whitespaces.

Actual behavior

# hadolint ignore=DL3029 ignores the rules whereas # hadolint ignore=DL3029 does not.
I know there is no particular reason to have a trailing whitespace at the end of a comment, but it took me a bit to figure it out.

Steps to reproduce the behavior

Run hadolint on this dockerfile

FROM busybox
# hadoling ignore=DL3003
RUN cd /
# hadoling ignore=DL3003 
RUN cd /

In my opinion there should be 2 DL3003 warnings, but there is only one.

Output of hadolint --version or
docker run --rm hadolint/hadolint hadolint --version or
docker run --rm ghcr.io/hadolint/hadolint hadolint --version:

Haskell Dockerfile Linter 2.12.0

Dockerfile (if relevant)
see above

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