<commit_before>module Attestify
  # Holds the tests that will be loaded for a test run.
  class TestList
    attr_reader :dir, :test_helper_file

    def initialize(files = nil, dir: nil)
      @dir = dir || "./test"
      @provided_files = files
    end

    def test_helper_file
      @test_helper_file_path ||= File.join(dir, "test_helper.rb")
      @test_helper_file_path if File.file?(@test_helper_file_path)
    end

    def test_files
      @test_files ||= test_filters.map(&:file)
    end

    def run?(test_class, method)
      if provided_files?
        test_filters.any? { |filter| filter.run?(test_class, method) }
      else
        true
      end
    end

    private

    def test_filters
      @test_filters ||=
        begin
          if provided_files?
            @provided_files.map { |path| all_file_filters_for(path) }.flatten.compact
          else<commit_msg>Don't need to have special case for no provided files anymore<commit_after>module Attestify
  # Holds the tests that will be loaded for a test run.
  class TestList
    attr_reader :dir, :test_helper_file

    def initialize(files = nil, dir: nil)
      @dir = dir || "./test"
      @provided_files = files
    end

    def test_helper_file
      @test_helper_file_path ||= File.join(dir, "test_helper.rb")
      @test_helper_file_path if File.file?(@test_helper_file_path)
    end

    def test_files
      @test_files ||= test_filters.map(&:file)
    end

    def run?(test_class, method)
      test_filters.any? { |filter| filter.run?(test_class, method) }
    end

    private

    def test_filters
      @test_filters ||=
        begin
          if provided_files?
            @provided_files.map { |path| all_file_filters_for(path) }.flatten.compact
          else
{'fraction_non_alphanumeric': 0.09127210496292071, 'fraction_numerical': 0.0, 'mean_word_length': 2.6090534979423867, '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': '4302143', 'n_tokens_mistral': 571, 'n_tokens_neox': 555, 'n_words': 140}