<commit_before>FactoryBot.define do
  sequence(:email) { |n| "<EMAIL>" }
  sequence(:login_name) { |n| "member#{n}" }

  factory :member, aliases: %i(author owner sender recipient creator) do
    login_name { generate(:login_name) }
    password '<PASSWORD>'
    email { generate(:email) }
    tos_agreement true
    confirmed_at { Time.now }
    show_email false
    bio 'I love seeds'

    # cropbot is needed for certain tests, eg. Crop.create_from_csv
    factory :cropbot do
      login_name 'cropbot'
    end

    factory :no_tos_member do
      tos_agreement false
    end

    factory :newsletter_recipient_member do
      newsletter true
    end

    factory :no_bio_member do
      bio nil
    end

    factory :unconfirmed_member do
      confirmed_at nil
    end

    # this member has very loose privacy settings
    factory :public_member do
      login_name 'NothingToHide'
      show_email true
    end

    factory :london_member do
      sequence(:login_name) { |n| "JohnH#{n}" } # for the astronomer who figured out longitude
      location 'Greenwich, UK'
      # including lat/long explicitly because geocoder doesn't work with FG
      latitude 51.483
      longitude 0.004
    end

    factory :edinburgh_member do
      location 'Edinburgh'
      latitude 55.953252
      longitude -3.188267
    end

    factory :south_pole_member do
      sequence(:login_name) { |n| "ScottRF#{n}" }
      location 'Amundsen-Scott Base, Antarctica'
      latitude -90
      longitude 0
    end

    factory :admin_member do
      roles { [FactoryBot.create(:admin)] }
    end

    factory :crop_wrangling_member do
      roles { [FactoryBot.create(:crop_wrangler)] }
      sequence(:login_name) { |n| "wrangler#{n}" }
    end

    factory :invalid_member_shortname do
      login_name 'a'
    end

    factory :invalid_member_longname do
      login_name 'MarmadukeBlundellHollinsheadBlundellTolemachePlantagenetWhistlebinkie3rdDukeofMarmoset'
    end

    factory :invalid_member_spaces do
      login_name "a b"
    end

    factory :invalid_member_badchars do
      login_name 'aa%$'
    end

    factory :invalid_member_badname do
      login_name 'admin'
    end

    factory :valid_member_alphanumeric do
      login_name 'abc<PASSWORD>'
    end

    factory :valid_member_uppercase do
      login_name 'ABC123'
    end

    factory :valid_member_underscore do
      login_name 'abc_123'
    end

    factory :no_email_notifications_member do
      send_notification_email false
    end
  end
end
<commit_msg>Style fix up<commit_after>FactoryBot.define do
  sequence(:email) { |n| "<EMAIL>" }
  sequence(:login_name) { |n| "member#{n}" }

  factory :member, aliases: %i(author owner sender recipient creator) do
    login_name { generate(:login_name) }
    password '<PASSWORD>'
    email { generate(:email) }
    tos_agreement true
    confirmed_at { Time.now }
    show_email false
    bio 'I love seeds'

    # cropbot is needed for certain tests, eg. Crop.create_from_csv
    factory :cropbot do
      login_name 'cropbot'
    end

    factory :no_tos_member do
      tos_agreement false
    end

    factory :newsletter_recipient_member do
      newsletter true
    end

    factory :no_bio_member do
      bio nil
    end

    factory :unconfirmed_member do
      confirmed_at nil
    end

    # this member has very loose privacy settings
    factory :public_member do
      login_name 'NothingToHide'
      show_email true
    end

    factory :london_member do
      sequence(:login_name) { |n| "JohnH#{n}" } # for the astronomer who figured out longitude
      location 'Greenwich, UK'
      # including lat/long explicitly because geocoder doesn't work with FG
      latitude 51.483
      longitude 0.004
    end

    factory :edinburgh_member do
      location 'Edinburgh'
      latitude 55.953252
      longitude -3.188267
    end

    factory :south_pole_member do
      sequence(:login_name) { |n| "ScottRF#{n}" }
      location 'Amundsen-Scott Base, Antarctica'
      latitude { -90 }
      longitude { 0 }
    end

    factory :admin_member do
      roles { [FactoryBot.create(:admin)] }
    end

    factory :crop_wrangling_member do
      roles { [FactoryBot.create(:crop_wrangler)] }
      sequence(:login_name) { |n| "wrangler#{n}" }
    end

    factory :invalid_member_shortname do
      login_name 'a'
    end

    factory :invalid_member_longname do
      login_name 'MarmadukeBlundellHollinsheadBlundellTolemachePlantagenetWhistlebinkie3rdDukeofMarmoset'
    end

    factory :invalid_member_spaces do
      login_name "a b"
    end

    factory :invalid_member_badchars do
      login_name 'aa%$'
    end

    factory :invalid_member_badname do
      login_name 'admin'
    end

    factory :valid_member_alphanumeric do
      login_name 'abc123'
    end

    factory :valid_member_uppercase do
      login_name 'ABC123'
    end

    factory :valid_member_underscore do
      login_name 'abc_123'
    end

    factory :no_email_notifications_member do
      send_notification_email false
    end
  end
end

{'fraction_non_alphanumeric': 0.06854199683042789, 'fraction_numerical': 0.014064976228209191, 'mean_word_length': 2.793388429752066, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '6167312', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1584, 'n_words': 428}