forge fmt does support stdin, by sending - instead of a path. I assume this is a better approach?
the --check flag causes forge to send an exit code 1 when invalid syntax is found. However, it also causes it to not send any output, resulting in the buffer becoming empty. Removing this flag fixes it, and also makes valid_exit_codes unnecessary
There were two different problems:
forge fmt
does support stdin, by sending-
instead of a path. I assume this is a better approach?--check
flag causesforge
to send an exit code1
when invalid syntax is found. However, it also causes it to not send any output, resulting in the buffer becoming empty. Removing this flag fixes it, and also makesvalid_exit_codes
unnecessary