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:
|
Lint/LiteralAsCondition:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Lint/NonAtomicFileOperation:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Lint/ParenthesesAsGroupedExpression:
|
Lint/ParenthesesAsGroupedExpression:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ describe "rake sitemap:create", type: :system do
|
|||||||
let(:file) { Rails.root.join("public", "sitemap.xml") }
|
let(:file) { Rails.root.join("public", "sitemap.xml") }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
File.delete(file) if File.exist?(file)
|
FileUtils.rm_f(file)
|
||||||
Rake::Task["sitemap:create"].reenable
|
Rake::Task["sitemap:create"].reenable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user