InvalidDefinitionDescription
Note
This check is experimental and is not enabled by default. To enable it, see Experimental checks.
Output
Comment for build stage or argument should follow the format: `# <arg/stage name> <description>`. If this is not intended to be a description comment, add an empty line or comment between the instruction and the comment.
Description
The
--call=outline
and
--call=targets
flags for the docker build
command print descriptions for build targets and arguments.
The descriptions are generated from
Dockerfile comments
that immediately precede the FROM
or ARG
instruction
and that begin with the name of the build stage or argument.
For example:
In cases where preceding comments are not meant to be descriptions, add an empty line or comment between the instruction and the preceding comment.
Examples
❌ Bad: A non-descriptive comment on the line preceding the FROM
command.
✅ Good: An empty line separating non-descriptive comments.
✅ Good: Comments describing ARG
keys and stages immediately proceeding the command.