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

Implement InvalidDefinitionDescription Rule Check #5169

Closed
daghack opened this issue Jul 18, 2024 · 0 comments · Fixed by #5208
Closed

Implement InvalidDefinitionDescription Rule Check #5169

daghack opened this issue Jul 18, 2024 · 0 comments · Fixed by #5208
Assignees
Milestone

Comments

@daghack
Copy link
Collaborator

daghack commented Jul 18, 2024

Description

If a comment is right before FROM or ARG it could be considered as part of the command and we could request specific format. If user doesn’t care and comment isn’t specifically for the command they could add a empty line.

Output Message

Description comment for stage () is invalid. Should be of the format <STAGE NAME> <DESCRIPTION>. If this is not intended to be a description comment, add an empty line/comment between them
Description comment for ARG () is invalid. Should be of the format <ARG NAME> <DESCRIPTION>. If this is not intended to be a description comment, add an empty line/comment between them.

Reason

Outline/targets command can parse comments to show text descriptions. But this only works if the comment is in specific format.

Example

Bad - description doesn’t start with stage/arg name

# This is where we do all the testing
FROM busybox AS test
# Version name
ARG VERSION
...

Bad - typo in stage/arg description comment

# tests this is where we do all the testing
FROM busybox AS test
# VERISION image version to use
ARG VERSION
...

Good - Well defined comment for

# test do all the testing
FROM busybox AS test
# VERSION image version to use
ARG VERSION
...

Good - Comments, but not a description comments

# tests this is where we do all the testing

FROM busybox AS test
#
# Test arguments
#
ARG VERSION
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants