<commit_before>const path = require('path');
const fs = require('fs-extra');
const chalk = require('chalk');
const ora = require('ora');
const prettyMs = require('pretty-ms');
const prettyBytes = require('pretty-bytes');


/**
 * Capitalize ever word in given string `s`.
 */
const capitalize = s => s.replace(/[-]/g,' ').replace(/\b\w/g, l => l.toUpperCase());

/**
 * Resolve a (relative) path based on current working directory.
 */
const cwd = fs.realpathSync(process.cwd());
const resolveFromCwd = (relativePath) => path.resolve(cwd, relativePath);

/**
 * Ora is an awesome module, but it doesn't (yet?) support writing
 * the same line. This "spinner" monkey patches this behaviour.
 */
const createCompileSpinner = () => {
  const spinner = ora('');

  return {
    compiling() {
      spinner.clear();
      spinner.text = 'Compiling...';
      spinner.start();
    },

    success(time, size) {
      spinner.stop();
      spinner.stream.write(
        chalk.green('\u2714  Compilation done! ') +
        chalk.dim(`(${prettyMs(time)}, ${prettyBytes(size)})`)
      );
    },

    warn() {
      spinner.text = chalk.yellow('Compiled with warnings!');
      spinner.stopAndPersist(chalk.yellow('\u26a0'));
    },

    fail() {
      spinner.text = chalk.red('Compiled with errors!');
      spinner.fail();
    }
  };
};

/**
 * Create a section seperator in the CLI.
 * Stole this idea from an ava reporter (https://github.com/avajs/ava)
 */
const createSection = () => {
  return chalk.gray.dim('_'.repeat(process.stdout.columns || 80)) + '\n';
};


// Public API
// ---------------
module.exports = {
  capitalize,
  resolveFromCwd,
  createCompileSpinner,
  createSection
}<commit_msg>:kipstick: Linted...<commit_after>const path = require('path');
const fs = require('fs-extra');
const chalk = require('chalk');
const ora = require('ora');
const prettyMs = require('pretty-ms');
const prettyBytes = require('pretty-bytes');


/**
 * Capitalize ever word in given string `s`.
 */
const capitalize = s => s.replace(/[-]/g,' ').replace(/\b\w/g, l => l.toUpperCase());

/**
 * Resolve a (relative) path based on current working directory.
 */
const cwd = fs.realpathSync(process.cwd());
const resolveFromCwd = (relativePath) => path.resolve(cwd, relativePath);

/**
 * Ora is an awesome module, but it doesn't (yet?) support writing
 * the same line. This "spinner" monkey patches this behaviour.
 */
const createCompileSpinner = () => {
  const spinner = ora('');

  return {
    compiling() {
      spinner.clear();
      spinner.text = 'Compiling...';
      spinner.start();
    },

    success(time, size) {
      spinner.stop();
      spinner.stream.write(
        chalk.green('\u2714  Compilation done! ') +
        chalk.dim(`(${prettyMs(time)}, ${prettyBytes(size)})`)
      );
    },

    warn() {
      spinner.text = chalk.yellow('Compiled with warnings!');
      spinner.stopAndPersist(chalk.yellow('\u26a0'));
    },

    fail() {
      spinner.text = chalk.red('Compiled with errors!');
      spinner.fail();
    }
  };
};

/**
 * Create a section seperator in the CLI.
 * Stole this idea from an ava reporter (https://github.com/avajs/ava)
 */
const createSection = () => {
  return chalk.gray.dim('_'.repeat(process.stdout.columns || 80)) + '\n';
};


// Public API
// ---------------
module.exports = {
  capitalize,
  resolveFromCwd,
  createCompileSpinner,
  createSection
};
{'fraction_non_alphanumeric': 0.18390129259694477, 'fraction_numerical': 0.005287896592244419, 'mean_word_length': 3.0778443113772456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '7266345', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1084, 'n_words': 259}