Add and apply Lint/NonAtomicFileOperation rule
This rule was added in Rubocop 1.31.0; it follows the principles mentioned in the Ruby Style Guide [1]. https://rubystyle.guide/#atomic-file-operations
This commit is contained in:
@@ -179,6 +179,9 @@ Lint/EmptyFile:
|
||||
Lint/LiteralAsCondition:
|
||||
Enabled: true
|
||||
|
||||
Lint/NonAtomicFileOperation:
|
||||
Enabled: true
|
||||
|
||||
Lint/ParenthesesAsGroupedExpression:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ describe "rake sitemap:create", type: :system do
|
||||
let(:file) { Rails.root.join("public", "sitemap.xml") }
|
||||
|
||||
before do
|
||||
File.delete(file) if File.exist?(file)
|
||||
FileUtils.rm_f(file)
|
||||
Rake::Task["sitemap:create"].reenable
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user