这是工厂女孩的一个例子:
FactoryGirl.define do
factory :camp do
name "MyString"
icon "MyString"
url "MyString"
patterns "MyString"
featured_patterns "MyString"
score 1
description "MyString"
end
end
它仍然有效但修复工厂女孩生成的所有文件真的很烦人。我怎么能修复这个错误的缩进。
答案 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