Easiest way to reproduce is to try to use a non-existing config file path:
muon fmt -i -c /file/that/does/not/exist meson.build.
However, this also happens if there is an error in the configuration file, or there was an error while parsing meson.build, etc.
This happens because target file path is opened for writing before calling fmt(). I think the best way to fix this would be to instead write to a file called
$target_file.$pid.tmpor something along the lines, and then rename it
$target_valueessentially overwriting the fie.