Merged
Conversation
Add global variant of the ignore pragma. This allows users to disable rules for the whole dockerfile by using a pragma like: ```dockerfile ```
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add global variant of the ignore pragma. This allows users to disable rules for the whole dockerfile by using a pragma like:
# hadolint global ignore=DL3003,SC2035What I did
How I did it
The file global ignore pragma works almost like the inline ignore pragma. The difference is that it parses into just a set of rules to ignore instead of a map from line-numbers to sets of rules to ignore. Consequently there is no check for line numbers when deciding if a check-failure should be ignored or propagated, all that matters is if that failures code is in that global set of rule codes to ignore.
How to verify it
The following Dockerfile should not trigger any of the globally ignored rules, but will still trigger all other rules just normal: