<commit_before>const { concat, contains, prop, equals, not, propOr, compose, test, curry
  , both, keys, assoc, converge, merge, complement } =
    require('ramda')
const { exists, selected, check_tests, date } = require('app/validate')

const subscription = ['date', 'amount']
const event = concat(subscription, ['notes'])
const donation = event
const payment = concat(donation, ['type', 'reference'])

const payment_category_options =
  [ 'Cash', 'Cheque', 'Standing Order', 'HO', 'CAF' ]

const types =
  { subscription
  , event
  , donation
  , payment
  }

const type_order =
  [ 'subscription'
  , 'event'
  , 'donation'
  , 'payment'
  ]

const validate = (values) => {
  const ref_required = compose(test(/ash|eque/), propOr('', 'type'))

  const required_tests =
    { date: exists
    , amount: exists
    , type: selected
    , reference: (field) => both(ref_required, () => exists(field))
    }

  return converge
    ( merge
    , [ check_tests('required', required_tests)<commit_msg>allows normal commit<commit_after>const { concat, contains, prop, equals, not, propOr, compose, test, curry
  , both, keys, assoc, converge, merge, complement } =
    require('ramda')
const { exists, selected, check_tests, date } = require('app/validate')

const subscription = ['date', 'amount']
const event = concat(subscription, ['notes'])
const donation = event
const payment = concat(donation, ['type', 'reference'])

const payment_category_options =
  [ 'Cash', 'Cheque', 'Standing Order', 'HO', 'CAF' ]

const types =
  { subscription
  , event
  , donation
  , payment
  }

const type_order =
  [ 'subscription'
  , 'event'
  , 'donation'
  , 'payment'
  ]

const validate = (values) => {
  const ref_required = compose(test(/ash|eque/), propOr('ash', 'type'))

  const required_tests =
    { date: exists
    , amount: exists
    , type: selected
    , reference: (field) => both(ref_required, () => exists(field))
    }

  return converge
    ( merge
    , [ check_tests('required', required_tests)
{'fraction_non_alphanumeric': 0.15254237288135594, 'fraction_numerical': 0.0, 'mean_word_length': 4.055415617128464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '1868113', 'n_tokens_mistral': 651, 'n_tokens_neox': 633, 'n_words': 169}