From 4b1a1a8292e3d767d6119c222efbc9b9c6127900 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Fri, 30 Dec 2016 01:55:33 -0400 Subject: [PATCH] Fix changes from review of #1212. --- src/beautifiers/hh_format.coffee | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/beautifiers/hh_format.coffee b/src/beautifiers/hh_format.coffee index 48484b5..a2e0949 100644 --- a/src/beautifiers/hh_format.coffee +++ b/src/beautifiers/hh_format.coffee @@ -10,13 +10,21 @@ module.exports = class HhFormat extends Beautifier link: "http://hhvm.com/" options: - PHP: true + PHP: false beautify: (text, language, options) -> @run("hh_format", [ @tempFile("input", text) - ]).then((output) => - # hh_format can exit with status 0 and no output for some files which - # it doesn't format. In that case we just return original text. - if output.trim() then output else text - ) + ], + { + help: { + link: "http://hhvm.com/" + } + }).then((output) -> + # hh_format can exit with status 0 and no output for some files which + # it doesn't format. In that case we just return original text. + if output.trim() + output + else + @Promise.resolve(new Error("hh_format returned an empty output.")) + )