Skip to content

Commit

Permalink
Appease RuboCop
Browse files Browse the repository at this point in the history
spec/support/file_helper.rb:10:33: W: [Correctable] Lint/NonAtomicFileOperation: Remove unnecessary existence checks File.exist?.
    FileUtils.makedirs dir_path unless File.exist?(dir_path)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tasks/changelog.rb:33:31: W: [Correctable] Lint/NonAtomicFileOperation: Remove unnecessary existence checks Dir.exist?.
      Dir.mkdir(ENTRIES_PATH) unless Dir.exist?(ENTRIES_PATH)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  • Loading branch information
pirj committed Jun 27, 2022
1 parent 6caca55 commit 25fe8fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/support/file_helper.rb
Expand Up @@ -7,7 +7,7 @@ def create_file(file_path, content)
file_path = File.expand_path(file_path)

dir_path = File.dirname(file_path)
FileUtils.makedirs dir_path unless File.exist?(dir_path)
FileUtils.makedirs dir_path

File.open(file_path, 'w') do |file|
case content
Expand Down
2 changes: 1 addition & 1 deletion tasks/changelog.rb
Expand Up @@ -30,7 +30,7 @@ def initialize(type:, body: last_commit_title, ref_type: nil, ref_id: nil, user:
end

def write
Dir.mkdir(ENTRIES_PATH) unless Dir.exist?(ENTRIES_PATH)
Dir.mkdir(ENTRIES_PATH)
File.write(path, content)
path
end
Expand Down

0 comments on commit 25fe8fb

Please sign in to comment.