# frozen_string_literal: true require 'English' namespace :factory_bot do desc 'Verify that all FactoryBot factories are valid' task lint: :environment do if Rails.env.test? DatabaseCleaner.clean_with(:deletion) DatabaseCleaner.cleaning do FactoryBot.lint traits: true end else system("bundle exec rake factory_bot:lint RAILS_ENV='test'") raise if $CHILD_STATUS.exitstatus.nonzero? end end end