代碼如下所示:
db_table
.where('some condition')
.joins('another table')
.find_each do |table_record|
puts table_record.name
end
是否有允許您在之后添加縮進的 rubocop 規則do?
db_table
.where('some condition')
.joins('another table')
.find_each do |table_record|
puts table_record.name
end
uj5u.com熱心網友回復:
查看 Rubocop 檔案,這似乎是您正在尋找的警察:
布局/縮進寬度
uj5u.com熱心網友回復:
rubocop.yml 中的這個對我有幫助
Layout/BlockAlignment:
EnforcedStyleAlignWith: start_of_block
它迫使我最后移動end:
db_table
.where('some condition')
.joins('another table')
.find_each do |table_record|
puts table_record.name
end
然后 rubocop 強制使用縮進
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/359996.html
上一篇:谷歌云功能授權
