<commit_before>/**
 * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @flow
 */

import type {Path, ProjectConfig} from 'types/Config';
import type {AggregatedResult} from 'types/TestResult';

import path from 'path';
import chalk from 'chalk';
import slash from 'slash';

type SummaryOptions = {|
  estimatedTime?: number,
  roundTime?: boolean,
  width?: number,
|};

const PROGRESS_BAR_WIDTH = 40;

const printDisplayName = (config: ProjectConfig) => {
  const {displayName} = config;

  if (displayName) {
    return chalk.supportsColor
      ? chalk.reset.inverse.white.dim(` ${displayName} `)
      : displayName;
  }

  return '';
};

const trimAndFormatPath = (
  pad: number,
  config: {rootDir: Path},
  testPath: Path,
  columns: number,
): string => {
  const maxLength = columns - pad;
  const relative = relativePath(config, testPath);
  const {basename} = relative;
  let {dirname} = relative;
<commit_msg>Remove .dim from displayName for better readability (#4377)<commit_after>/**
 * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @flow
 */

import type {Path, ProjectConfig} from 'types/Config';
import type {AggregatedResult} from 'types/TestResult';

import path from 'path';
import chalk from 'chalk';
import slash from 'slash';

type SummaryOptions = {|
  estimatedTime?: number,
  roundTime?: boolean,
  width?: number,
|};

const PROGRESS_BAR_WIDTH = 40;

const printDisplayName = (config: ProjectConfig) => {
  const {displayName} = config;

  if (displayName) {
    return chalk.supportsColor
      ? chalk.reset.inverse.white(` ${displayName} `)
      : displayName;
  }

  return '';
};

const trimAndFormatPath = (
  pad: number,
  config: {rootDir: Path},
  testPath: Path,
  columns: number,
): string => {
  const maxLength = columns - pad;
  const relative = relativePath(config, testPath);
  const {basename} = relative;
  let {dirname} = relative;

{'fraction_non_alphanumeric': 0.11338912133891213, 'fraction_numerical': 0.0066945606694560665, 'mean_word_length': 4.002092050209205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '399080', 'n_tokens_mistral': 739, 'n_tokens_neox': 706, 'n_words': 255}