Avoid indenting blank lines, to avoid trailing whitespace.
Make comment format match others in file.
Ensure generated file ends with a newline character.
Merge pull request #1001 from bensymonds/codegen-trailing-whitespace

Avoid indenting blank lines, to avoid trailing whitespace.