rubocopを実行すると下記のように1つ弾かれてしまうのですが、解説策はご存知でしょうか?
調べてみたのですが英文の記事が多くなかなか解決にありつけずもしご存知でしたらよろしくお願い致します。
$rubocop Inspecting 25 files .........C............... Offenses: app/controllers/potepan/products_controller.rb:nine:11: C: Layout/MultilineMethodCallIndentation: Use 2 (not 4) spaces for indenting an expression in an assignment spanning multiple lines. limit(MAX_DISPRAY_NUMBER_OF_RELATED_PRODUCTS) ^^^^^ 25 files inspected, 1 offense detected``` ```products_controller.rb class Potepan::ProductsController < ApplicationController MAX_DISPRAY_NUMBER_OF_RELATED_PRODUCTS = 4 def show @product = Spree::Product.find(params[:id]) @related_products = @product.related_products. includes(master: [:default_price, :images]). limit(MAX_DISPRAY_NUMBER_OF_RELATED_PRODUCTS) end end
products_controller.rb class Potepan::ProductsController < ApplicationController MAX_DISPRAY_NUMBER_OF_RELATED_PRODUCTS = 4 def show @product = Spree::Product.find(params[:id]) @related_products = @product.related_products. includes(master: [:default_price, :images]). limit(MAX_DISPRAY_NUMBER_OF_RELATED_PRODUCTS) end end
rubocop.yml inherit_from: - .rubocop_airbnb.yml LineLength: Enabled: false34 AllCops: Exclude: - 'db/**/*' - 'bin/*' - 'config/environments/*' - 'config/application.rb' - 'config/initializers/*' - 'config/spring.rb' - 'lib/tasks/*' - 'vendor/**/*' - 'path/ruby'
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。