<commit_before>package info.javaspec.lang.lambda;

import info.javaspec.RunObserver;
import info.javaspec.SpecCollection;
import info.javaspec.console.Command;
import info.javaspec.lang.lambda.SpecCollectionFactory;

public final class RunSpecsCommand implements Command {
  private final SpecCollectionFactory factory;
  private final RunObserver observer;

  public RunSpecsCommand(SpecCollectionFactory factory, RunObserver observer) {
    this.factory = factory;
    this.observer = observer;
  }

  @Override
  public int run() {
    SpecCollection rootCollection;
    try {
      rootCollection = this.factory.declareSpecs();
    } catch(Exception e) {
      return 2;
    }

    rootCollection.runSpecs(this.observer);
    return this.observer.hasFailingSpecs() ? 1 : 0;
  }<commit_msg>Note for what to do<commit_after>package info.javaspec.lang.lambda;

import info.javaspec.RunObserver;
import info.javaspec.SpecCollection;
import info.javaspec.console.Command;
import info.javaspec.lang.lambda.SpecCollectionFactory;

public final class RunSpecsCommand implements Command {
  private final SpecCollectionFactory factory;
  private final RunObserver observer;

  public RunSpecsCommand(SpecCollectionFactory factory, RunObserver observer) {
    this.factory = factory;
    this.observer = observer;
  }

  @Override
  public int run() {
    SpecCollection rootCollection;
    try {
      rootCollection = this.factory.declareSpecs();
    } catch(Exception e) {
      //TODO KDK: Return the exception along with the error code
//      e.printStackTrace();
      return 2;
    }

    rootCollection.runSpecs(this.observer);
    return this.observer.hasFailingSpecs() ? 1 : 0;
  }
{'fraction_non_alphanumeric': 0.08481613285883749, 'fraction_numerical': 0.0035587188612099642, 'mean_word_length': 4.096676737160121, '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': '5048813', 'n_tokens_mistral': 493, 'n_tokens_neox': 470, 'n_words': 117}