G-Code Files Break Too Easily

As of 1.4.1, G-Code files are scanned to check for validity before printing, but the validity criteria are too strict. In particular, it should be possible to omit some or all of the configuration block at the end, and have the printer adopt sensible defaults.

My recent use-case was that I wanted to remove preset filament colours in a print file (yes, I know you can turn off filament auto-matching in the printer settings). Simply removing one line in the config block that appears at the end of the file broke it.

This might be build into Klipper, I’m not sure, but it seems very restrictive. I am used to hand-coding test G-Code, and if a few lines of G-Code requires several KB of preset configuration stuff I can’t see that’s viable any more.