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

Add option to selectively skip linting with reserved comment #106

Closed
kwvg opened this issue Dec 20, 2021 · 3 comments
Closed

Add option to selectively skip linting with reserved comment #106

kwvg opened this issue Dec 20, 2021 · 3 comments
Assignees

Comments

@kwvg
Copy link

kwvg commented Dec 20, 2021

Description

Currently, dockerfile-utils cannot account for syntax extensions introduced with BuildKit causing false-positive error reporting with the example given below...

# syntax = edrevo/dockerfile-plus
FROM ubuntu:focal
INCLUDE+ example/Dockerfile
RUN echo "Hello World"

The second line causes dockerfile-utils to return Unknown instruction: INCLUDE+dockerfile-utils(38)

Proposal

Introduce the ability to (similar to ShellCheck, for instance # shellcheck disable=SC1083) selectively disable linting errors (specific or otherwise) for a block of instructions

Something along the lines of the example given below would be neat!

# syntax = edrevo/dockerfile-plus
FROM ubuntu:focal

# dockerfile-utils: ignore
INCLUDE+ example/Dockerfile

RUN echo "Hello World"
@muuvmuuv
Copy link

Mhmm, any help needed here?

rcjsuen added a commit that referenced this issue Sep 9, 2023
The line of the instruction that introduced the error will now be
recorded in the diagnostic itself. This will allow us to implement #106
by checking to see if there is a comment directly above the source line
of the diagnostic.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
@rcjsuen rcjsuen closed this as completed in 36e9102 Sep 9, 2023
@rcjsuen
Copy link
Owner

rcjsuen commented Sep 9, 2023

@kwvg @muuvmuuv The change to support # dockerfile-utils: ignore comments have been published and released to npm in today's 0.12.0 release. Perhaps you have already moved on to a different linting library but I thought I would let you know anyway.

Have a nice weekend!

@rcjsuen rcjsuen self-assigned this Sep 9, 2023
@kwvg
Copy link
Author

kwvg commented Sep 9, 2023

Thanks for the surprise! Opened this issue more than a year ago so I'm glad it's fixed!

Have a great weekend!

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

No branches or pull requests

3 participants