<commit_before>import * as color from "colorette"
import * as path from "path"
import { Activity } from "../activity-list/types/activity"
import { Configuration } from "../configuration/types/configuration"
import { printCodeFrame } from "../helpers/print-code-frame"
import { Formatter } from "./types/formatter"
import { StatsCounter } from "../runners/helpers/stats-counter"

/** A completely minimalistic formatter, prints nothing in the happy path */
export class SilentFormatter implements Formatter {
  /** Text-Runner configuration */
  private readonly configuration: Configuration

  // @ts-ignore: ignore unused variable
  constructor(stepCount: number, configuration: Configuration) {
    this.configuration = configuration
  }

  // @ts-ignore: okay to not use parameters here
  failed(activity: Activity, stepName: string, err: Error, output: string) {
    console.log()
    console.log(color.dim(output))
    process.stdout.write(color.red(`${activity.file.platformified()}:${activity.line} -- `))
    console.log(err.message)
    printCodeFrame(console.log, path.join(this.configuration.sourceDir, activity.file.platformified()), activity.line)
  }

  // @ts-ignore: okay to not use parameters here
  skipped(activity: Activity, stepName: string, output: string) {}

  // @ts-ignore: okay to not use parameters here
  success(activity: Activity, stepName: string, output: string) {}

  // @ts-ignore: okay to not use parameters here
  summary(stats: StatsCounter) {}
}<commit_msg>Simplify SilentFormatter (#1140)<commit_after>import { Activity } from "../activity-list/types/activity"
import { Configuration } from "../configuration/types/configuration"
import { Formatter } from "./types/formatter"
import { StatsCounter } from "../runners/helpers/stats-counter"

/** A completely minimalistic formatter, prints nothing in the happy path */
export class SilentFormatter implements Formatter {
  // @ts-ignore: ignore unused variable
  constructor(stepCount: number, configuration: Configuration) {}

  // @ts-ignore: okay to not use parameters here
  failed(activity: Activity, stepName: string, err: Error, output: string) {}

  // @ts-ignore: okay to not use parameters here
  skipped(activity: Activity, stepName: string, output: string) {}

  // @ts-ignore: okay to not use parameters here
  success(activity: Activity, stepName: string, output: string) {}

  // @ts-ignore: okay to not use parameters here
  summary(stats: StatsCounter) {}
}
{'fraction_non_alphanumeric': 0.12423873325213154, 'fraction_numerical': 0.0016240357287860333, 'mean_word_length': 4.463414634146342, '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': '6194066', 'n_tokens_mistral': 668, 'n_tokens_neox': 648, 'n_words': 210}