<commit_before>package mirror;

import static org.jooq.lambda.Seq.seq;
import static org.jooq.lambda.tuple.Tuple.tuple;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Consumer;

import org.jooq.lambda.Seq;
import org.jooq.lambda.tuple.Tuple2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.protobuf.ByteString;

/**
 * A tree of updates, e.g. both files and directories.
 *
 * All of the {@link Update}s within the UpdateTree should contain
 * metadata only, and as the tree is solely for tracking/diffing
 * the state of the remote vs. local directories.
 *
 * This class is not thread safe as it's assumed to be fed Updates
 * from a dedicated queue/thread, e.g. in {@link SyncLogic}.
 */
public class UpdateTree {

  final Node root;
  final PathRules extraIncludes = new PathRules();
  final PathRules extraExcludes = new PathRules();

  public static UpdateTree newRoot() {
    return new UpdateTree();
  }

  private UpdateTree() {
    this.root = new Node(null, Update.newBuilder().setPath("").setDirectory(true).build());
    // IntegrationTest currently depends on these values
    extraExcludes.setRules("tmp", "temp", "target", "build");
    extraIncludes.setRules("src_managed", "*-SNAPSHOT.jar", ".classpath", ".project");
  }

  public void addAll(List<Update> updates) {
    updates.forEach(this::add);
  }
<commit_msg>Add bin and hidden files (.*) to default exclude.<commit_after>package mirror;

import static org.jooq.lambda.Seq.seq;
import static org.jooq.lambda.tuple.Tuple.tuple;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Consumer;

import org.jooq.lambda.Seq;
import org.jooq.lambda.tuple.Tuple2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.protobuf.ByteString;

/**
 * A tree of updates, e.g. both files and directories.
 *
 * All of the {@link Update}s within the UpdateTree should contain
 * metadata only, and as the tree is solely for tracking/diffing
 * the state of the remote vs. local directories.
 *
 * This class is not thread safe as it's assumed to be fed Updates
 * from a dedicated queue/thread, e.g. in {@link SyncLogic}.
 */
public class UpdateTree {

  final Node root;
  final PathRules extraIncludes = new PathRules();
  final PathRules extraExcludes = new PathRules();

  public static UpdateTree newRoot() {
    return new UpdateTree();
  }

  private UpdateTree() {
    this.root = new Node(null, Update.newBuilder().setPath("").setDirectory(true).build());
    // IntegrationTest currently depends on these values
    extraExcludes.setRules("tmp", "temp", "target", "build", "bin", ".*");
    extraIncludes.setRules("src_managed", "*-SNAPSHOT.jar", ".classpath", ".project");
  }

  public void addAll(List<Update> updates) {
    updates.forEach(this::add);
  }

{'fraction_non_alphanumeric': 0.12085376406114796, 'fraction_numerical': 0.0017306028266512836, 'mean_word_length': 4.435736677115988, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1196186', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1057, 'n_words': 304}