<commit_before>require 'git'

module Services
  module Projects
    class Clone < Services::Base
      FolderExistsError = Class.new(Error)

      def call(project)
        raise FolderExistsError, "Folder #{project.local_path} already exists and is not empty." if File.exist?(project.local_path) && !Dir[File.join(project.local_path, '*')].empty?

        dir = File.expand_path('..', project.local_path)
        Git.clone project.git, project.slug, path: dir
        project
      end
    end
  end
end<commit_msg>Formatting, code style<commit_after>require 'git'

module Services
  module Projects
    class Clone < Services::Base
      FolderExistsError = Class.new(Error)

      def call(project)
        raise FolderExistsError, "Folder #{project.local_path} already exists and is not empty." if File.exist?(project.local_path) && Dir[File.join(project.local_path, '*')].present?
        dir = File.expand_path('..', project.local_path)
        Git.clone project.git, project.slug, path: dir
        project
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11143131604226705, 'fraction_numerical': 0.0, 'mean_word_length': 3.2016129032258065, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1671908', 'n_tokens_mistral': 313, 'n_tokens_neox': 307, 'n_words': 81}