工厂女孩宝石生成错误的行缩进

时间:2015-08-12 08:59:45

标签: ruby-on-rails factory-bot

这是工厂女孩的一个例子:

FactoryGirl.define do
  factory :camp do
    name "MyString"
    icon "MyString"
url "MyString"
patterns "MyString"
featured_patterns "MyString"
score 1
description "MyString"
end
end

它仍然有效但修复工厂女孩生成的所有文件真的很烦人。我怎么能修复这个错误的缩进。

1 个答案:

答案 0 :(得分:-1)

使用--auto-correct运行rubocop将解决此问题。

rubocop --auto-correct spec/factories/camps.rb

spec/factories/camps.rb:42:1: C: [Corrected] Inconsistent indentation detected.
score 1
^^^^^^^
spec/factories/camps.rb:142:1: C: [Corrected] Extra empty line detected at block body end.

1 file inspected, 2 offenses detected, 2 offenses corrected