<commit_before>import chalk from 'chalk'
import commonTags = require('common-tags')
import StackTracey = require('stacktracey')
import {Log} from 'supi'
import {EOL} from './constants'

const stripIndent = commonTags.stripIndent
const stripIndents = commonTags.stripIndents
const highlight = chalk.yellow
const colorPath = chalk.gray

export default function reportError (logObj: Log) {
  if (logObj['err']) {
    const err = logObj['err'] as (Error & { code: string, stack: object })
    switch (err.code) {
      case 'UNEXPECTED_STORE':
        return reportUnexpectedStore(err, logObj['message'])
      case 'STORE_BREAKING_CHANGE':
        return reportStoreBreakingChange(err, logObj['message'])
      case 'MODULES_BREAKING_CHANGE':
        return reportModulesBreakingChange(err, logObj['message'])
      case 'MODIFIED_DEPENDENCY':
        return reportModifiedDependency(err, logObj['message'])
      case 'SHRINKWRAP_BREAKING_CHANGE':
        return reportShrinkwrapBreakingChange(err, logObj['message'])
      case 'RECURSIVE_RUN_NO_SCRIPT':
        return formatErrorSummary(err.message)
      default:<commit_msg>fix(reporting): don't print stack for known errors<commit_after>import chalk from 'chalk'
import commonTags = require('common-tags')
import StackTracey = require('stacktracey')
import {Log} from 'supi'
import {EOL} from './constants'

const stripIndent = commonTags.stripIndent
const stripIndents = commonTags.stripIndents
const highlight = chalk.yellow
const colorPath = chalk.gray

export default function reportError (logObj: Log) {
  if (logObj['err']) {
    const err = logObj['err'] as (Error & { code: string, stack: object })
    switch (err.code) {
      case 'UNEXPECTED_STORE':
        return reportUnexpectedStore(err, logObj['message'])
      case 'STORE_BREAKING_CHANGE':
        return reportStoreBreakingChange(err, logObj['message'])
      case 'MODULES_BREAKING_CHANGE':
        return reportModulesBreakingChange(err, logObj['message'])
      case 'MODIFIED_DEPENDENCY':
        return reportModifiedDependency(err, logObj['message'])
      case 'SHRINKWRAP_BREAKING_CHANGE':
        return reportShrinkwrapBreakingChange(err, logObj['message'])
      case 'RECURSIVE_RUN_NO_SCRIPT':
        return formatErrorSummary(err.message)
      default:
        // Errors with known error codes are printed w/o stack trace
        if (err.code && err.code.startsWith('ERR_PNPM_')) {
          return formatErrorSummary(err.message)
        }
{'fraction_non_alphanumeric': 0.10528438886647842, 'fraction_numerical': 0.0, 'mean_word_length': 4.265392781316348, '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': '2002194', 'n_tokens_mistral': 741, 'n_tokens_neox': 737, 'n_words': 178}