<commit_before>#!/usr/bin/env node
/* eslint-disable global-require, no-console */

// This script exits with an error if there are local configs that could
// pollute the test suite.

const fs = require('fs');
const path = require('path');

const chalk = require('chalk');

const root = path.resolve(path.join(path.dirname(__filename), '..'));
if (!fs.statSync(root).isDirectory()) {
  throw new Error(`Oops, detected the wrong root? ${root}`);
}

const configDir = path.join(root, 'config');
if (!fs.statSync(configDir).isDirectory()) {
  throw new Error(`Oops, detected the wrong config dir? ${configDir}`);
}

const disallowedFiles = fs.readdirSync(configDir)
  // Disallow any local configs that could possibly pollute the tests.
  .filter((name) => name === 'local.js' || name.startsWith('local-test'))
  .map((name) => path.join(configDir, name).replace(process.cwd(), '.'));

if (disallowedFiles.length) {<commit_msg>Reverting the change that allowed local production configs (#2453)<commit_after>#!/usr/bin/env node
/* eslint-disable global-require, no-console */

// This script exits with an error if there are local configs that could
// pollute the test suite.

const fs = require('fs');
const path = require('path');

const chalk = require('chalk');

const root = path.resolve(path.join(path.dirname(__filename), '..'));
if (!fs.statSync(root).isDirectory()) {
  throw new Error(`Oops, detected the wrong root? ${root}`);
}

const configDir = path.join(root, 'config');
if (!fs.statSync(configDir).isDirectory()) {
  throw new Error(`Oops, detected the wrong config dir? ${configDir}`);
}

const disallowedFiles = fs.readdirSync(configDir)
  // Disallow any local configs except for development configs.
  .filter((name) =>
    name.startsWith('local') && !name.startsWith('local-development'))
  .map((name) => path.join(configDir, name).replace(process.cwd(), '.'));

if (disallowedFiles.length) {
{'fraction_non_alphanumeric': 0.16779926816518556, 'fraction_numerical': 0.0020909566126502874, 'mean_word_length': 4.962616822429907, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '765148', 'n_tokens_mistral': 598, 'n_tokens_neox': 593, 'n_words': 167}