-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
InvalidDefinitionDescription Rule Check #5208
base: master
Are you sure you want to change the base?
Conversation
f2b6718
to
5e1ca11
Compare
5e1ca11
to
91470a3
Compare
@dvdksn Do you mind taking a look at the docs here and shooting me suggestions? I'm not at all happy with them, and I'd love your input. 😍 |
frontend/dockerfile/linter/docs/InvalidDefinitionDescription.md
Outdated
Show resolved
Hide resolved
frontend/dockerfile/linter/docs/InvalidDefinitionDescription.md
Outdated
Show resolved
Hide resolved
5218f04
to
ba68288
Compare
@@ -233,30 +296,35 @@ COPY $bar . | |||
|
|||
func testRuleCheckOption(t *testing.T, sb integration.Sandbox) { | |||
dockerfile := []byte(`#check=skip=all | |||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be needed. Directives are known comments and not associated with FROM
. Probably makes sense to just ignore the whole first comment block(until empty line) as it is more likely about the whole file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this particular added comment line is less than ideal. Is there a way to do this from instrutions.Parse
? I'd absolutely hate to have to try to move this check to the AST and I'm not sure that there's a sensible way to correlate any given FROM
/ARG
command's previous comment to the FIRST comment after the AST stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think directives section can be taken out in the AST layer so that they do not appear as PrevComment
in the AST. For the very first stage without global ARG we can maybe just ignore the warning.
frontend/dockerfile/docs/rules/invalid-definition-description.md
Outdated
Show resolved
Hide resolved
f060309
to
9c3fcea
Compare
Signed-off-by: Talon Bowler <talon.bowler@docker.com>
Signed-off-by: Talon Bowler <talon.bowler@docker.com>
fe59af0
to
4270ddf
Compare
fixes #5169
Implements a check around definition description comments used by
--call=outline
and--call=targets
.