<commit_before># frozen_string_literal: true

module Lita
  module Handlers
    module GithubPrs
      class GitDiff
        def initialize(diff)
          @diff = diff
        end

        def modified_files
          @diff
            .files
            .select { |file| file.status == 'modified' }
            .map(&:filename)
        end

        def added_files
          @diff
            .files
            .select { |file| file.status == 'added' }
            .map(&:filename)
        end

        def pull_requests
          @diff
            .commits
            .map(&:commit)
            .select { |commit| pull_request_commit?(commit) }
        end

        private

        def pull_request_commit?(commit)
          commit.message.start_with?('Merge pull request')
        end
      end
    end
  end
end<commit_msg>!fixup Use `&method` over block<commit_after># frozen_string_literal: true

module Lita
  module Handlers
    module GithubPrs
      class GitDiff
        def initialize(diff)
          @diff = diff
        end

        def modified_files
          @diff
            .files
            .select { |file| file.status == 'modified' }
            .map(&:filename)
        end

        def added_files
          @diff
            .files
            .select { |file| file.status == 'added' }
            .map(&:filename)
        end

        def pull_requests
          @diff
            .commits
            .map(&:commit)
            .select(&method(:pull_request_commit?))
        end

        private

        def pull_request_commit?(commit)
          commit.message.start_with?('Merge pull request')
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08383233532934131, 'fraction_numerical': 0.0, 'mean_word_length': 1.3635077793493635, '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': '3211719', 'n_tokens_mistral': 461, 'n_tokens_neox': 453, 'n_words': 113}