当我添加了
它显示:
guard-rspec
宝石并将Guardfile
设置为以下内容时:guard :rspec, cmd: 'bundle exec rspec' do
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
watch(%r{^spec/.+_spec\.rb$})
end
然后运行rubocop
检查:
rake rubocop:rubocop
它显示:
Guardfile:5:9: C: Use %r only for regular expressions matching more than 1 '/' character.
watch(%r{^spec/.+_spec\.rb$})
^^^^^^^^^^^^^^^^^^^^^^
我应该尝试重写常规代码还是编写忽略代码到.rubocop.yml
文件中?