<commit_before>"use strict";

import * as path from 'path';
import {Styleguide} from './Styleguide';

import {success, error} from './Logger';
/**
 * create the static styleguide
 *
 * TODO: add commandline feedback for success and error case
 */
export function build() {
  new Styleguide()
  /**
   * initialize the styleguide with the current working
   * directory of the app and the root of the upfront tool itself.
   */
  .initialize(process.cwd(), path.resolve(__dirname, '..'))
  /** resolve styleguide structure */
  .then(function(styleguide) {
    success('Styleguide.prepare:' ,'preparing the styleguide target ...');
    return styleguide.prepare();
  })
  .then(function(styleguide) {
    success('Styleguide.read:' ,'start reading ...');
    return styleguide.read();
  })
  /** create static styleguide structure */
  .then(function(styleguide) {
    success('Styleguide.read:' ,'finished reading');
    success('Styleguide.write:' ,'start writing ...');
    return styleguide.write();
  })
  .then(function(styleguide) {
    success('Styleguide.write:' ,'finished writing');
  })
  .catch(function(e) {
    error("Cli.build", "failed to build Styleguide", e);
    error(e.stack);
    throw(e);
  });
};

/**
 * resolve commandline arguments and run the appropriate command
 *
 * TODO: manage commandline arguments :)
 * TODO: add argument to clean the dist folder in beforehand
 */
export function command(args:[string]) {
  build();
};<commit_msg>USXP-663 log adjustment in CLI<commit_after>"use strict";

import * as path from 'path';
import {Styleguide} from './Styleguide';

import {success, error} from './Logger';
/**
 * create the static styleguide
 *
 * TODO: add commandline feedback for success and error case
 */
export function build() {
  new Styleguide()
  /**
   * initialize the styleguide with the current working
   * directory of the app and the root of the upfront tool itself.
   */
  .initialize(process.cwd(), path.resolve(__dirname, '..'))
  /** resolve styleguide structure */
  .then(function(styleguide) {
    success('Styleguide.prepare:' ,'preparing the styleguide target ...');
    return styleguide.prepare();
  })
  .then(function(styleguide) {
    success('Styleguide.read:' ,'start reading ...');
    return styleguide.read();
  })
  /** create static styleguide structure */
  .then(function(styleguide) {
    success('Styleguide.read:' ,'finished reading');
    success('Styleguide.write:' ,'start writing ...');
    return styleguide.write();
  })
  .then(function(styleguide) {
    success('Styleguide.write:' ,'finished writing');
  })
  .catch(function(e) {
    error("Cli.build", "failed to build Styleguide", e);
    console.log(e.callee, e.stack);
    throw(e);
  });
};

/**
 * resolve commandline arguments and run the appropriate command
 *
 * TODO: manage commandline arguments :)
 * TODO: add argument to clean the dist folder in beforehand
 */
export function command(args:[string]) {
  build();
};
{'fraction_non_alphanumeric': 0.15109612141652615, 'fraction_numerical': 0.001011804384485666, 'mean_word_length': 3.8227642276422764, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2695862', 'n_tokens_mistral': 892, 'n_tokens_neox': 920, 'n_words': 253}