class Rufo::Command
def format_stdin
def format_stdin code = STDIN.read erb = @filename_for_dot_rufo && @filename_for_dot_rufo.end_with?(".erb") result = format(code, @filename_for_dot_rufo || Dir.getwd, erb: erb) print(result) if !@want_check code == result ? CODE_OK : CODE_CHANGE rescue Rufo::SyntaxError => e logger.error("STDIN is invalid code. Error on line:#{e.lineno} #{e.message}") CODE_ERROR rescue => e logger.error("You've found a bug!") logger.error("Please report it to https://github.com/ruby-formatter/rufo/issues with code that triggers it\n") raise e end