<commit_before>// Copyright 2017 Foursquare Labs Inc. All Rights Reserved.

package io.fsq.rogue.util

import io.fsq.rogue.{Degrees, FindAndModifyQuery, ModifyQuery, Query}
import io.fsq.rogue.index.UntypedMongoIndex


trait QueryValidator {
  def validateList[T](xs: Traversable[T]): Unit

  def validateRadius(d: Degrees): Degrees

  def validateQuery[M](
    query: Query[M, _, _],
    indexes: Option[Seq[UntypedMongoIndex]]
  ): Unit

  def validateModify[M](
    modify: ModifyQuery[M, _],
    indexes: Option[Seq[UntypedMongoIndex]]
  ): Unit

  def validateFindAndModify[M, R](
    modify: FindAndModifyQuery[M, R],
    indexes: Option[Seq[UntypedMongoIndex]]
  ): Unit
}

class DefaultQueryValidator extends QueryValidator {
  override def validateList[T](xs: Traversable[T]): Unit = ()

  override def validateRadius(degrees: Degrees): Degrees = degrees

  override def validateQuery[M](
    query: Query[M, _, _],
    indexes: Option[Seq[UntypedMongoIndex]]
  ): Unit = ()

  override def validateModify[M](
    modify: ModifyQuery[M, _],
    indexes: Option[Seq[UntypedMongoIndex]]
  ): Unit = ()

  override def validateFindAndModify[M, R](
    modify: FindAndModifyQuery[M, R],
    indexes: Option[Seq[UntypedMongoIndex]]
  ): Unit = ()
}<commit_msg>better param naming in QueryValidator<commit_after>// Copyright 2017 Foursquare Labs Inc. All Rights Reserved.

package io.fsq.rogue.util

import io.fsq.rogue.{Degrees, FindAndModifyQuery, ModifyQuery, Query}
import io.fsq.rogue.index.UntypedMongoIndex


trait QueryValidator {
  def validateList[T](xs: Traversable[T]): Unit

  def validateRadius(d: Degrees): Degrees

  def validateQuery[M](
    query: Query[M, _, _],
    indexesOpt: Option[Seq[UntypedMongoIndex]]
  ): Unit

  def validateModify[M](
    modify: ModifyQuery[M, _],
    indexesOpt: Option[Seq[UntypedMongoIndex]]
  ): Unit

  def validateFindAndModify[M, R](
    modify: FindAndModifyQuery[M, R],
    indexesOpt: Option[Seq[UntypedMongoIndex]]
  ): Unit
}

class DefaultQueryValidator extends QueryValidator {
  override def validateList[T](xs: Traversable[T]): Unit = ()

  override def validateRadius(degrees: Degrees): Degrees = degrees

  override def validateQuery[M](
    query: Query[M, _, _],
    indexesOpt: Option[Seq[UntypedMongoIndex]]
  ): Unit = ()

  override def validateModify[M](
    modify: ModifyQuery[M, _],
    indexesOpt: Option[Seq[UntypedMongoIndex]]
  ): Unit = ()

  override def validateFindAndModify[M, R](
    modify: FindAndModifyQuery[M, R],
    indexesOpt: Option[Seq[UntypedMongoIndex]]
  ): Unit = ()
}
{'fraction_non_alphanumeric': 0.12217898832684825, 'fraction_numerical': 0.0031128404669260703, 'mean_word_length': 4.700665188470066, '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': '5317126', 'n_tokens_mistral': 918, 'n_tokens_neox': 876, 'n_words': 188}