From f9197130d2b50e12909b085764c5c1eb8bf3c89c Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 27 Jun 2022 11:37:16 +0200 Subject: [PATCH 1/7] bump aws-partitions --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 60f54ecb70..9f8a0cb8f1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -291,7 +291,7 @@ GEM awesome_nested_set (3.5.0) activerecord (>= 4.0.0, < 7.1) aws-eventstream (1.2.0) - aws-partitions (1.600.0) + aws-partitions (1.601.0) aws-sdk-core (3.131.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) From 552dd48f818d7a2d78346bdc1ec167d6ef587048 Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 27 Jun 2022 11:41:06 +0200 Subject: [PATCH 2/7] bump lefthook --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9f8a0cb8f1..42c97d0f8d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -593,7 +593,7 @@ GEM open4 (~> 1.0) launchy (2.5.0) addressable (~> 2.7) - lefthook (1.0.1) + lefthook (1.0.3) letter_opener (1.8.1) launchy (>= 2.2, < 3) listen (3.7.1) From 9ee344738ea1149f2ccde34bc48c45a501e18828 Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 27 Jun 2022 11:42:23 +0200 Subject: [PATCH 3/7] bump parallel_tests --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 42c97d0f8d..615d253a2e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -684,7 +684,7 @@ GEM openproject-token (2.2.0) activemodel parallel (1.22.1) - parallel_tests (3.11.0) + parallel_tests (3.11.1) parallel parser (3.1.2.0) ast (~> 2.4.1) From 300939b8242274fb24db439ed3c5c2824d5b36a7 Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 27 Jun 2022 11:44:04 +0200 Subject: [PATCH 4/7] bump pg --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 615d253a2e..6577f5b6b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -697,7 +697,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.4.0) + pg (1.4.1) plaintext (0.3.4) activesupport (> 2.2.1) nokogiri (~> 1.10, >= 1.10.4) From d7df7ad2d4860abca532efe9764ed84a818585ba Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 27 Jun 2022 11:45:40 +0200 Subject: [PATCH 5/7] bump rubocop & unicode-display_width --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6577f5b6b2..ccf183be9e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -856,7 +856,7 @@ GEM rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.11.0) - rubocop (1.30.1) + rubocop (1.31.0) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) @@ -969,7 +969,7 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.1.0) + unicode-display_width (2.2.0) uri_template (0.7.0) validate_email (0.1.6) activemodel (>= 3.0) From 10d9bd6215ef770531b6ea55b93f7d0131110e16 Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 27 Jun 2022 11:46:38 +0200 Subject: [PATCH 6/7] bump rubocop-rails --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ccf183be9e..e126895628 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -867,7 +867,7 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.18.0) parser (>= 3.1.1.0) - rubocop-rails (2.15.0) + rubocop-rails (2.15.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) From 3f8ca138302f0309909412b687aa5f7ddeee3258 Mon Sep 17 00:00:00 2001 From: ulferts Date: Mon, 27 Jun 2022 12:07:37 +0200 Subject: [PATCH 7/7] rubocop autofix for cops added in 1.31.0 --- app/controllers/repositories_controller.rb | 2 +- app/mailers/application_mailer.rb | 16 ++++++++-------- .../attachments/finish_direct_upload_job.rb | 2 +- app/workers/backup_job.rb | 2 +- app/workers/copy_project_job.rb | 4 ++-- app/workers/projects/delete_project_job.rb | 2 +- lib/open_project/patches/fog_file.rb | 2 +- .../contracts/bim/ifc_models/base_contract.rb | 2 +- .../scm/adapters/git_adapter_spec.rb | 2 +- .../scm/adapters/subversion_adapter_spec.rb | 2 +- .../work_packages/scopes/relatable_spec.rb | 4 ++-- spec/requests/api/v3/render_resource_spec.rb | 4 ++-- spec/workers/backup_job_spec.rb | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 298ff056b8..ab85305fc1 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -348,7 +348,7 @@ class RepositoriesController < ApplicationController end changes_by_day = Change.includes(:changeset) - .where(["#{Changeset.table_name}.repository_id = ? "\ + .where(["#{Changeset.table_name}.repository_id = ? " \ "AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to]) .references(:changesets) diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 44398d2fef..56cd237427 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -140,12 +140,12 @@ class ApplicationMailer < ActionMailer::Base else "#{object.class.name.demodulize.underscore}-#{object.id}" end - hash = 'op'\ - '.'\ - "#{object_reference}"\ - '.'\ - "#{Time.current.strftime('%Y%m%d%H%M%S')}"\ - '.'\ + hash = 'op' \ + '.' \ + "#{object_reference}" \ + '.' \ + "#{Time.current.strftime('%Y%m%d%H%M%S')}" \ + '.' \ "#{recipient.id}" "#{hash}@#{header_host_value}" @@ -160,8 +160,8 @@ class ApplicationMailer < ActionMailer::Base # It in fact is aimed not not so that similar messages (i.e. those belonging to the same # work package and journal) end up being grouped together. def references_value(object) - hash = 'op'\ - '.'\ + hash = 'op' \ + '.' \ "#{object.class.name.demodulize.underscore}-#{object.id}" "#{hash}@#{header_host_value}" diff --git a/app/workers/attachments/finish_direct_upload_job.rb b/app/workers/attachments/finish_direct_upload_job.rb index fd30d6d7fc..28f56a7421 100644 --- a/app/workers/attachments/finish_direct_upload_job.rb +++ b/app/workers/attachments/finish_direct_upload_job.rb @@ -57,7 +57,7 @@ class Attachments::FinishDirectUploadJob < ApplicationJob ::OpenProject.logger.error e attachment.destroy ensure - File.unlink(local_file.path) if File.exist?(local_file.path) + FileUtils.rm_rf(local_file.path) end def set_attributes_from_file(attachment, local_file) diff --git a/app/workers/backup_job.rb b/app/workers/backup_job.rb index fca6e36392..c5040584a8 100644 --- a/app/workers/backup_job.rb +++ b/app/workers/backup_job.rb @@ -121,7 +121,7 @@ class BackupJob < ::ApplicationJob def remove_files!(*files) Array(files).each do |file| - FileUtils.rm file if File.exist? file + FileUtils.rm_rf file end end diff --git a/app/workers/copy_project_job.rb b/app/workers/copy_project_job.rb index fadb863442..de5a543bdf 100644 --- a/app/workers/copy_project_job.rb +++ b/app/workers/copy_project_job.rb @@ -138,11 +138,11 @@ class CopyProjectJob < ApplicationJob rescue ActiveRecord::RecordNotFound => e logger.error("Entity missing: #{e.message} #{e.backtrace.join("\n")}") rescue StandardError => e - logger.error('Encountered an error when trying to copy project '\ + logger.error('Encountered an error when trying to copy project ' \ "'#{source_project_id}' : #{e.message} #{e.backtrace.join("\n")}") ensure unless errors.empty? - logger.error('Encountered an errors while trying to copy related objects for '\ + logger.error('Encountered an errors while trying to copy related objects for ' \ "project '#{source_project_id}': #{errors.inspect}") end end diff --git a/app/workers/projects/delete_project_job.rb b/app/workers/projects/delete_project_job.rb index c2a72909cc..37d59b0676 100644 --- a/app/workers/projects/delete_project_job.rb +++ b/app/workers/projects/delete_project_job.rb @@ -54,7 +54,7 @@ module Projects end def log_standard_error(e) - logger.error('Encountered an error when trying to delete project '\ + logger.error('Encountered an error when trying to delete project ' \ "'#{project}' : #{e.message} #{e.backtrace.join("\n")}") end diff --git a/lib/open_project/patches/fog_file.rb b/lib/open_project/patches/fog_file.rb index 9f6cd7ef14..4465503ffc 100644 --- a/lib/open_project/patches/fog_file.rb +++ b/lib/open_project/patches/fog_file.rb @@ -9,7 +9,7 @@ module OpenProject::Patches::CarrierwaveSanitizedFile def mkdir!(path, directory_permissions) options = {} options[:mode] = directory_permissions if directory_permissions - FileUtils.mkdir_p(File.dirname(path), **options) unless File.exist?(File.dirname(path)) + FileUtils.mkdir_p(File.dirname(path), **options) end end end diff --git a/modules/bim/app/contracts/bim/ifc_models/base_contract.rb b/modules/bim/app/contracts/bim/ifc_models/base_contract.rb index e83c88668a..b2a8f70299 100644 --- a/modules/bim/app/contracts/bim/ifc_models/base_contract.rb +++ b/modules/bim/app/contracts/bim/ifc_models/base_contract.rb @@ -80,7 +80,7 @@ module Bim # For local uploads the file must remain to be copied later to its final (local) destination from the cache. return unless OpenProject::Configuration.direct_uploads? - FileUtils.rm file_path if File.exist? file_path + FileUtils.rm_rf file_path end def uploader_is_ifc_attachment_author diff --git a/spec/lib/open_project/scm/adapters/git_adapter_spec.rb b/spec/lib/open_project/scm/adapters/git_adapter_spec.rb index ab502ba3d3..671b2b1148 100644 --- a/spec/lib/open_project/scm/adapters/git_adapter_spec.rb +++ b/spec/lib/open_project/scm/adapters/git_adapter_spec.rb @@ -432,7 +432,7 @@ describe OpenProject::SCM::Adapters::Git do annotate = adapter.annotate('sources/watchers_controller.rb') expect(annotate).to be_kind_of(OpenProject::SCM::Adapters::Annotate) expect(annotate.lines.length).to eq(41) - expect(annotate.lines[4].strip).to eq('# This program is free software; '\ + expect(annotate.lines[4].strip).to eq('# This program is free software; ' \ 'you can redistribute it and/or') expect(annotate.revisions[4].identifier).to eq('7234cb2750b63f47bff735edc50a1c0a433c2518') expect(annotate.revisions[4].author).to eq('jsmith') diff --git a/spec/lib/open_project/scm/adapters/subversion_adapter_spec.rb b/spec/lib/open_project/scm/adapters/subversion_adapter_spec.rb index 1618341a2d..97b2a62436 100644 --- a/spec/lib/open_project/scm/adapters/subversion_adapter_spec.rb +++ b/spec/lib/open_project/scm/adapters/subversion_adapter_spec.rb @@ -358,7 +358,7 @@ describe OpenProject::SCM::Adapters::Subversion do describe '.cat' do it 'outputs the given file' do out = adapter.cat('subversion_test/[folder_with_brackets]/README.txt', 11) - expect(out).to eq('This file should be accessible for Redmine, '\ + expect(out).to eq('This file should be accessible for Redmine, ' \ "although its folder contains square\nbrackets.\n") end diff --git a/spec/models/work_packages/scopes/relatable_spec.rb b/spec/models/work_packages/scopes/relatable_spec.rb index 970c9f425f..afbba556ab 100644 --- a/spec/models/work_packages/scopes/relatable_spec.rb +++ b/spec/models/work_packages/scopes/relatable_spec.rb @@ -103,7 +103,7 @@ describe WorkPackages::Scopes::Relatable, '.relatable scope' do end end - context "for the '#{current_type}' type with the other project being in a different project "\ + context "for the '#{current_type}' type with the other project being in a different project " \ "and having cross project relations disabled", with_settings: { cross_project_work_package_relations: false } do let(:relation_type) { current_type } let(:unrelated_work_package) { create(:work_package, project: create(:project)) } @@ -114,7 +114,7 @@ describe WorkPackages::Scopes::Relatable, '.relatable scope' do end end - context "for the '#{current_type}' type with the other project being in a different project "\ + context "for the '#{current_type}' type with the other project being in a different project " \ "and having cross project relations enabled", with_settings: { cross_project_work_package_relations: true } do let(:relation_type) { current_type } let(:unrelated_work_package) { create(:work_package, project: create(:project)) } diff --git a/spec/requests/api/v3/render_resource_spec.rb b/spec/requests/api/v3/render_resource_spec.rb index d80ce743da..798238e639 100644 --- a/spec/requests/api/v3/render_resource_spec.rb +++ b/spec/requests/api/v3/render_resource_spec.rb @@ -81,8 +81,8 @@ describe 'API v3 Render resource', type: :request do let(:id) { work_package.id } let(:href) { "/work_packages/#{id}" } let(:text) do - '

Hello World! Have a look at Hello World! Have a look at ##{id}

" end diff --git a/spec/workers/backup_job_spec.rb b/spec/workers/backup_job_spec.rb index 2b10ffef07..ab8f1a1bd9 100644 --- a/spec/workers/backup_job_spec.rb +++ b/spec/workers/backup_job_spec.rb @@ -179,7 +179,7 @@ describe BackupJob, type: :model do end after do - FileUtils.rm dummy_path if File.exist? dummy_path + FileUtils.rm_rf dummy_path end it_behaves_like "it creates a backup", remote_storage: true