<commit_before>const Joi = require('joi');
/**
 * Fix rule options to create a fix rule from given options.
 * @typedef  {Object}                             RuleConfig
 * @property {string|Array.<string>|Set.<string>} [elements]            - Strings which are covered by rule. They are compared by equal operator.
 * @property {string|Array.<string>|Set.<string>} [except]              - Fields which are not covered by rule.
 * @property {string|Array.<string>|Set.<string>} [prefixes]            - Strings which starts with given prefixes are covered by rule.
 * @property {string|Array.<string>|Set.<string>} [suffixes]            - Strings which ends with given suffixes are covered by rule.
 * @property {string|Array.<string>|Set.<string>} [exceptPrefixes]      - Strings which starts with given prefixes are NOT covered by rule.
 * @property {string|Array.<string>|Set.<string>} [exceptSuffixes]      - Strings which ends with given suffixes are NOT covered by rule.
 * @property {boolean}                            [stripPrefix=true]    - Whether it should prefix be stripped from start of field name
 * @property {boolean}                            [stripSuffix=true]    - Whether it should suffix be stripped from end of field name.
 */
const ruleConfigSchema = {
  elements:       Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  except:         Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  prefixes:       Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  suffixes:       Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  exceptPrefixes: Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  exceptSuffixes: Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  stripPrefix:    Joi.boolean().default(true),
  stripSuffix:    Joi.boolean().default(true),
};

module.exports = {
  ruleConfigSchema,
};<commit_msg>Doc update<commit_after>const Joi = require('joi');
/**
 * Fix rule options to create a fix rule from given options.
 * @typedef  {Object}                             RuleConfig
 * @property {string|Array.<string>|Set.<string>} [elements]            - Strings which are covered by rule. They are compared by equal operator.
 * @property {string|Array.<string>|Set.<string>} [except]              - Fields which are not covered by rule.
 * @property {string|Array.<string>|Set.<string>} [prefixes]            - Strings which starts with given prefixes are covered by rule.
 * @property {string|Array.<string>|Set.<string>} [suffixes]            - Strings which ends with given suffixes are covered by rule.
 * @property {string|Array.<string>|Set.<string>} [exceptPrefixes]      - Strings which starts with given prefixes are NOT covered by rule.
 * @property {string|Array.<string>|Set.<string>} [exceptSuffixes]      - Strings which ends with given suffixes are NOT covered by rule.
 * @property {boolean}                            [stripPrefix]         - Whether it should prefix be stripped from start of field name
 * @property {boolean}                            [stripSuffix]         - Whether it should suffix be stripped from end of field name.
 */
const ruleConfigSchema = {
  elements:       Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  except:         Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  prefixes:       Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  suffixes:       Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  exceptPrefixes: Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  exceptSuffixes: Joi.alternatives(Joi.array().items(Joi.string()), Joi.string(), Joi.object().type(Set)).optional(),
  stripPrefix:    Joi.boolean().optional(),
  stripSuffix:    Joi.boolean().optional(),
};

module.exports = {
  ruleConfigSchema,
};
{'fraction_non_alphanumeric': 0.1534130893736805, 'fraction_numerical': 0.0, 'mean_word_length': 3.450939457202505, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '7355808', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1223, 'n_words': 313}