dockerfile-parser-rs icon indicating copy to clipboard operation
dockerfile-parser-rs copied to clipboard

Better parsing of ONBUILD

Open dsherret opened this issue 4 years ago • 0 comments

The ONBUILD instruction has the format:

ONBUILD <INSTRUCTION>

https://docs.docker.com/engine/reference/builder/#onbuild

It would probably be better to not parse this as a MiscInstruction, but instead it could have the form:

struct OnbuildInstruction {
  span: Span,
  instruction: Instruction,
}

I'm building a code formatter with this parser and it would be useful to format the instructions within an ONBUILD instruction.

Thoughts? I can contribute this after my other PR lands.

dsherret avatar Oct 09 '21 16:10 dsherret