Sha256: 050dbba6b541fd18515e6f0f2faf3b98f33ed5667b77729edd291fc6533f7622

Contents?: true

Size: 1.32 KB

Versions: 23

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    module RSpec
      module FactoryBot
        # @!parse
        #   # Use a consistent style for parentheses in factory bot calls.
        #   #
        #   # @example
        #   #
        #   #   # bad
        #   #   create :user
        #   #   build(:user)
        #   #   create(:login)
        #   #   create :login
        #   #
        #   # @example `EnforcedStyle: require_parentheses` (default)
        #   #
        #   #   # good
        #   #   create(:user)
        #   #   create(:user)
        #   #   create(:login)
        #   #   build(:login)
        #   #
        #   # @example `EnforcedStyle: omit_parentheses`
        #   #
        #   #   # good
        #   #   create :user
        #   #   build :user
        #   #   create :login
        #   #   create :login
        #   #
        #   #   # also good
        #   #   # when method name and first argument are not on same line
        #   #   create(
        #   #     :user
        #   #   )
        #   #   build(
        #   #     :user,
        #   #     name: 'foo'
        #   #   )
        #   #
        #   class ConsistentParenthesesStyle < ::RuboCop::Cop::Base; end
        ConsistentParenthesesStyle =
          ::RuboCop::Cop::FactoryBot::ConsistentParenthesesStyle
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/rubocop-rspec-2.22.0/lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb
rubocop-rspec-2.22.0 lib/rubocop/cop/rspec/factory_bot/consistent_parentheses_style.rb