<commit_before>###
Requires http://hhvm.com/
###

"use strict"
Beautifier = require('./beautifier')

module.exports = class HhFormat extends Beautifier
  name: "hh_format"
  link: "http://hhvm.com/"

  options:
    PHP: true

  beautify: (text, language, options) ->
    @run("hh_format", [
      @tempFile("input", text)
      ])
<commit_msg>Ignore empty output from hh_format<commit_after>###
Requires http://hhvm.com/
###

"use strict"
Beautifier = require('./beautifier')

module.exports = class HhFormat extends Beautifier
  name: "hh_format"
  link: "http://hhvm.com/"

  options:
    PHP: true

  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
      )

{'fraction_non_alphanumeric': 0.14301075268817204, 'fraction_numerical': 0.001075268817204301, 'mean_word_length': 3.1194690265486726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7227172', 'n_tokens_mistral': 307, 'n_tokens_neox': 301, 'n_words': 87}