Sha256: 14076c0df3b5940ef068436765009e49bcea05934aef6d9befca649ae8aeaa33

Contents?: true

Size: 469 Bytes

Versions: 14

Compression:

Stored size: 469 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module FactoryBot
      # Handles `ExplicitOnly` configuration parameters.
      module ConfigurableExplicitOnly
        include RuboCop::FactoryBot::Language

        def factory_call?(node)
          return factory_bot?(node) if explicit_only?

          factory_bot?(node) || node.nil?
        end

        def explicit_only?
          cop_config['ExplicitOnly']
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 5 rubygems

Version Path
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/rubocop-factory_bot-2.26.1/lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
rubocop-factory_bot-2.26.1 lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
rubocop-factory_bot-2.26.0 lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/rubocop-factory_bot-2.25.1/lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
rubocop-factory_bot-2.25.1 lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
rubocop-factory_bot-2.25.0 lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rubocop-factory_bot-2.23.1/lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
rubocop-factory_bot-2.24.0 lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/rubocop-factory_bot-2.23.1/lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/rubocop-factory_bot-2.23.1/lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-factory_bot-2.23.1/lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rubocop-factory_bot-2.23.1/lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
rubocop-factory_bot-2.23.1 lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb
rubocop-factory_bot-2.23.0 lib/rubocop/cop/factory_bot/mixin/configurable_explicit_only.rb