<commit_before>#!/bin/bash

set -euo pipefail

if [ -n "${CIRCLE_ARTIFACTS-}" ]; then
  outdir="${CIRCLE_ARTIFACTS}"
elif [ -n "${TMPDIR-}" ]; then
  outdir="${TMPDIR}"
else
  outdir="/tmp"
fi

builder=$(dirname $0)/builder.sh
match='^F\d+|^panic|^[Gg]oroutine \d+|(read|write) by.*goroutine|DATA RACE|Too many goroutines running after tests'

prepare_artifacts() {
  ret=$?
  # Show each action taken so we can trace if things go awry here.
  set -x

  # Translate the log output to xml to integrate with CircleCI
  # better.
  if [ -n "${CIRCLE_TEST_REPORTS-}" ]; then
    if [ -f "${outdir}/test.log" ]; then
      mkdir -p "${CIRCLE_TEST_REPORTS}/test"
      ${builder} go2xunit < "${outdir}/test.log" \
        > "${CIRCLE_TEST_REPORTS}/test/test.xml"
    fi
    if [ -f "${outdir}/testrace.log" ]; then
      mkdir -p "${CIRCLE_TEST_REPORTS}/race"
      ${builder} go2xunit < "${outdir}/testrace.log" \
        > "${CIRCLE_TEST_REPORTS}/race/testrace.xml"<commit_msg>don't use `\d` with `grep -E`<commit_after>#!/bin/bash

set -euo pipefail

if [ -n "${CIRCLE_ARTIFACTS-}" ]; then
  outdir="${CIRCLE_ARTIFACTS}"
elif [ -n "${TMPDIR-}" ]; then
  outdir="${TMPDIR}"
else
  outdir="/tmp"
fi

builder=$(dirname $0)/builder.sh
match='^F[0-9]+|^panic|^[Gg]oroutine [0-9]+|(read|write) by.*goroutine|DATA RACE|Too many goroutines running after tests'

prepare_artifacts() {
  ret=$?
  # Show each action taken so we can trace if things go awry here.
  set -x

  # Translate the log output to xml to integrate with CircleCI
  # better.
  if [ -n "${CIRCLE_TEST_REPORTS-}" ]; then
    if [ -f "${outdir}/test.log" ]; then
      mkdir -p "${CIRCLE_TEST_REPORTS}/test"
      ${builder} go2xunit < "${outdir}/test.log" \
        > "${CIRCLE_TEST_REPORTS}/test/test.xml"
    fi
    if [ -f "${outdir}/testrace.log" ]; then
      mkdir -p "${CIRCLE_TEST_REPORTS}/race"
      ${builder} go2xunit < "${outdir}/testrace.log" \
        > "${CIRCLE_TEST_REPORTS}/race/testrace.xml"
{'fraction_non_alphanumeric': 0.18140243902439024, 'fraction_numerical': 0.00508130081300813, 'mean_word_length': 3.4547511312217196, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '7278882', 'n_tokens_mistral': 781, 'n_tokens_neox': 760, 'n_words': 170}