ast/parser: vairables in port ranges#85
Merged
lorenzo merged 1 commit intohadolint:masterfrom Nov 9, 2022
Merged
Conversation
- Fix parser being unable to parse port ranges when the limits are expressed with variables - Rearrange AST such that the limits of port ranges are ports - Move tests for `EXPOSE` instructions to their own file This change introduces a breaking change to the AST. The old AST was unable to represent port ranges delimited with variables, since the data type for port ranges mandated that a limit must be expressed as an integer. This creates problems when limits of a range are expressed as variables (e.g. as ARGs). The change to the AST defines the limits of a port range as port. This has the advantage that any way a port can be expressed can also be used to express a port range limit, including variables. required-for: hadolint/hadolint#876
Member
|
Thanks! |
|
Thanks! |
m-ildefons
added a commit
to m-ildefons/hadolint
that referenced
this pull request
Nov 10, 2022
Fix up usage of the AST in DL3011 corresponding to the changes to the AST with respect to port ranges in `EXPOSE` instructions. requires: hadolint/language-docker#85 fixes: hadolint#876
lorenzo
pushed a commit
to hadolint/hadolint
that referenced
this pull request
Nov 16, 2022
Fix up usage of the AST in DL3011 corresponding to the changes to the AST with respect to port ranges in `EXPOSE` instructions. requires: hadolint/language-docker#85 fixes: #876
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.
EXPOSEinstructions to their own fileThis change introduces a breaking change to the AST.
The old AST was unable to represent port ranges delimited with variables, since the data type for port ranges mandated that a limit must be expressed as an integer. This creates problems when limits of a range are expressed as variables (e.g. as ARGs). The change to the AST defines the limits of a port range as port. This has the advantage that any way a port can be expressed can also be used to express a port range limit, including variables.
required-for: hadolint/hadolint#876
Since this would be a breaking change in the AST, I'd recommend a major version jump. This will require adjustments to Hadolint, but offers the ability to fix hadolint/hadolint#876