<commit_before>import _ = require("lodash")
import chalk = require("chalk")
import log = require("loglevel")
import ora = require("ora")

let enable_colors : boolean = false
let allow_issue_types : vile.IssueType.All[] = []

// HACK: need to get exported ora types
const spin : any = ora({ color: "green" })

const stop_spinner = () : void => {
  spin.stop()
}

const start_spinner = () : void => {
  spin.start()
}

const update_spinner = (text : string) : void => {
  spin.text = text
  start_spinner()
}

const level = (name : string) : void => {
  process.env.VILE_LOG_LEVEL = name
  log.setLevel(name)
}

const enable = (
  colors = true,
  issue_types : vile.IssueType.All[] = []
) : void => {
  allow_issue_types = issue_types
  enable_colors = colors

  // HACK: supports auto setting color/log in worker procs for CLI
  if (process.env.VILE_NO_COLOR == "1") enable_colors = false<commit_msg>The spinner should be hidden if colors are disabled.<commit_after>import _ = require("lodash")
import chalk = require("chalk")
import log = require("loglevel")
import ora = require("ora")

let enable_colors : boolean = false
let allow_issue_types : vile.IssueType.All[] = []

// HACK: need to get exported ora types
const spin : any = ora({ color: "green" })

const stop_spinner = () : void => {
  spin.stop()
}

const start_spinner = () : void => {
  if (enable_colors) spin.start()
}

const update_spinner = (text : string) : void => {
  spin.text = text
  start_spinner()
}

const level = (name : string) : void => {
  process.env.VILE_LOG_LEVEL = name
  log.setLevel(name)
}

const enable = (
  colors = true,
  issue_types : vile.IssueType.All[] = []
) : void => {
  allow_issue_types = issue_types
  enable_colors = colors

  // HACK: supports auto setting color/log in worker procs for CLI
  if (process.env.VILE_NO_COLOR == "1") enable_colors = false
{'fraction_non_alphanumeric': 0.13832077502691065, 'fraction_numerical': 0.001076426264800861, 'mean_word_length': 3.892105263157895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '451950', 'n_tokens_mistral': 642, 'n_tokens_neox': 627, 'n_words': 171}