<commit_before>defmodule Pxscratch.Factory do
  use ExMachina.Ecto, repo: Pxscratch.Repo

  import Comeonin.Bcrypt, only: [hashpwsalt: 1]

  alias Pxscratch.User
  alias Pxscratch.Role

  def factory(:user) do
    password = sequence(:password, &"<PASSWORD> #{&1}")
    %User{
      name: sequence(:name, &"name #{&1}"),
      email: sequence(:email, &"email #{&1}"),
      nickname: sequence(:nickname, &"nickname #{&1}"),
      password: password,
      password_digest: <PASSWORD>(password),
      role: create(:role)
    }
  end

  def factory(:role) do
    %Role{
      name: sequence(:name, &"name #{&1}"),
      description: sequence(:description, &"Role description #{&1}"),
    }
  end
end<commit_msg>Fix user email generation in factory<commit_after>defmodule Pxscratch.Factory do
  use ExMachina.Ecto, repo: Pxscratch.Repo

  import Comeonin.Bcrypt, only: [hashpwsalt: 1]

  alias Pxscratch.User
  alias Pxscratch.Role

  def factory(:user) do
    password = sequence(:password, &"<PASSWORD> #{&1}")
    %User{
      name: sequence(:name, &"name #{&1}"),
      email: sequence(:email, &"<EMAIL>#{<EMAIL>"),
      nickname: sequence(:nickname, &"nickname #{&1}"),
      password: password,
      password_digest: <PASSWORD>(password),
      role: create(:role)
    }
  end

  def factory(:role) do
    %Role{
      name: sequence(:name, &"name #{&1}"),
      description: sequence(:description, &"Role description #{&1}"),
    }
  end
end
{'fraction_non_alphanumeric': 0.16574585635359115, 'fraction_numerical': 0.008977900552486187, 'mean_word_length': 3.6293929712460065, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5182041', 'n_tokens_mistral': 510, 'n_tokens_neox': 498, 'n_words': 119}