From 53e30e2c3b3c3b2d720a639e726c16de8ce3f9d6 Mon Sep 17 00:00:00 2001 From: Igor Rzegocki Date: Wed, 12 Aug 2020 17:49:12 +0200 Subject: [PATCH] chore: gems update --- .overcommit.yml | 5 --- .rubocop.yml | 47 +++++++++++++++++++++++- Gemfile | 1 - Gemfile.lock | 54 ++++++++++++---------------- libraries/drivers_appserver_base.rb | 2 -- libraries/drivers_db_base.rb | 2 -- libraries/drivers_framework_rails.rb | 2 ++ libraries/drivers_worker_base.rb | 2 +- libraries/helpers.rb | 6 ++-- spec/fixtures/node.rb | 2 +- 10 files changed, 74 insertions(+), 49 deletions(-) diff --git a/.overcommit.yml b/.overcommit.yml index 6a7b095a..93834f8a 100644 --- a/.overcommit.yml +++ b/.overcommit.yml @@ -38,11 +38,6 @@ PreCommit: enabled: true LocalPathsInGemfile: enabled: true - Mdl: - enabled: true - exclude: - - CHANGELOG.md - - .github/ISSUE_TEMPLATE.md MergeConflicts: enabled: true RuboCop: diff --git a/.rubocop.yml b/.rubocop.yml index fcc3ca9f..ef29c0c2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -11,27 +11,57 @@ Layout/LineLength: Layout/SpaceAroundMethodCallOperator: Enabled: true +Lint/BinaryOperatorWithIdenticalOperands: + Enabled: true + Lint/DeprecatedOpenSSLConstant: Enabled: true Lint/DuplicateElsifCondition: Enabled: true +Lint/DuplicateRescueException: + Enabled: true + +Lint/EmptyConditionalBody: + Enabled: true + +Lint/FloatComparison: + Enabled: true + +Lint/MissingSuper: + Enabled: true + Lint/MixedRegexpCaptureTypes: Enabled: true +Lint/OutOfRangeRegexpRef: + Enabled: true + Lint/RaiseException: Enabled: true +Lint/SelfAssignment: + Enabled: true + Lint/StructNewOverride: Enabled: true +Lint/TopLevelReturnWithArgument: + Enabled: true + +Lint/UnreachableLoop: + Enabled: true + Metrics/AbcSize: - Max: 25 + Max: 30 Metrics/BlockLength: Enabled: false +Metrics/PerceivedComplexity: + Max: 10 + Performance/AncestorsInclude: Enabled: true @@ -71,9 +101,15 @@ Style/CaseLikeIf: Style/Documentation: Enabled: false +Style/ExplicitBlockArgument: + Enabled: true + Style/ExponentialNotation: Enabled: true +Style/GlobalStdStream: + Enabled: true + Style/HashAsLastArrayItem: Enabled: true @@ -89,6 +125,9 @@ Style/HashTransformKeys: Style/HashTransformValues: Enabled: false +Style/OptionalBooleanParameter: + Enabled: true + Style/RedundantAssignment: Enabled: true @@ -104,9 +143,15 @@ Style/RedundantRegexpCharacterClass: Style/RedundantRegexpEscape: Enabled: true +Style/SingleArgumentDig: + Enabled: true + Style/SlicingWithRange: Enabled: true +Style/StringConcatenation: + Enabled: true + AllCops: TargetRubyVersion: 2.6 DisplayCopNames: true diff --git a/Gemfile b/Gemfile index d6132dd0..27362a5b 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,6 @@ group :lint do gem 'coveralls' gem 'fasterer' gem 'foodcritic' - gem 'mdl' gem 'overcommit' gem 'rubocop' gem 'rubocop-performance' diff --git a/Gemfile.lock b/Gemfile.lock index d883d5c2..c42b7d4d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -27,7 +27,7 @@ GEM ridley (~> 5.0) solve (~> 4.0) thor (~> 0.19, < 0.19.2) - brakeman (4.8.2) + brakeman (4.9.0) buff-config (2.0.0) buff-extensions (~> 2.0) varia_model (~> 0.6) @@ -92,7 +92,7 @@ GEM childprocess (4.0.0) cleanroom (1.0.0) colorize (0.8.1) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.7) coveralls (0.8.19) json (>= 1.8, < 3) simplecov (~> 0.12.0) @@ -102,7 +102,6 @@ GEM diff-lcs (1.4.4) docile (1.1.5) ed25519 (1.2.4) - equatable (0.6.1) erubi (1.9.0) erubis (2.7.0) ethon (0.12.0) @@ -143,16 +142,15 @@ GEM highline (1.7.10) hitimes (2.0.0) httpclient (2.8.3) - i18n (1.8.4) + i18n (1.8.5) concurrent-ruby (~> 1.0) iniparse (1.5.0) ipaddress (0.8.3) json (2.3.1) kitchen-docker (2.10.0) test-kitchen (>= 1.0.0) - kitchen-vagrant (1.6.1) + kitchen-vagrant (1.7.0) test-kitchen (>= 1.4, < 3) - kramdown (1.17.0) launchy (2.5.0) addressable (~> 2.7) libyajl2 (1.2.0) @@ -165,10 +163,6 @@ GEM logging (2.3.0) little-plugger (~> 1.1) multi_json (~> 1.14) - mdl (0.5.0) - kramdown (~> 1.12, >= 1.12.0) - mixlib-cli (~> 1.7, >= 1.7.0) - mixlib-config (~> 2.2, >= 2.2.1) mini_portile2 (2.4.0) minitar (0.9) minitest (5.14.1) @@ -188,7 +182,6 @@ GEM molinillo (0.6.6) multi_json (1.15.0) multipart-post (2.1.1) - necromancer (0.5.1) net-http-persistent (2.9.4) net-http-pipeline (1.0.1) net-scp (3.0.0) @@ -227,8 +220,7 @@ GEM parallel (1.19.2) parser (2.7.1.4) ast (~> 2.4.1) - pastel (0.7.4) - equatable (~> 0.6) + pastel (0.8.0) tty-color (~> 0.5) plist (3.5.0) polyglot (0.3.5) @@ -280,17 +272,17 @@ GEM rspec_junit_formatter (0.2.3) builder (< 4) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (0.88.0) + rubocop (0.89.1) parallel (~> 1.10) parser (>= 2.7.1.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.7) rexml - rubocop-ast (>= 0.1.0, < 1.0) + rubocop-ast (>= 0.3.0, < 1.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.2.0) - parser (>= 2.7.0.1) + rubocop-ast (0.3.0) + parser (>= 2.7.1.4) rubocop-performance (1.7.1) rubocop (>= 0.82.0) ruby-progressbar (1.10.1) @@ -323,8 +315,8 @@ GEM net-ssh (>= 2.7) net-telnet (= 0.1.1) sfl - strings (0.1.8) - strings-ansi (~> 0.1) + strings (0.2.0) + strings-ansi (~> 0.2) unicode-display_width (~> 1.5) unicode_utils (~> 1.4) strings-ansi (0.2.0) @@ -333,7 +325,7 @@ GEM systemu (2.6.5) term-ansicolor (1.7.1) tins (~> 1.0) - test-kitchen (2.5.3) + test-kitchen (2.5.4) bcrypt_pbkdf (~> 1.0) ed25519 (~> 1.2) license-acceptance (~> 1.0, >= 1.0.11) @@ -364,20 +356,19 @@ GEM typhoeus (~> 0.6, >= 0.6.8) treetop (1.6.10) polyglot (~> 0.3) - tty-box (0.5.0) - pastel (~> 0.7.2) - strings (~> 0.1.6) + tty-box (0.6.0) + pastel (~> 0.8) + strings (~> 0.2.0) tty-cursor (~> 0.7) - tty-color (0.5.1) + tty-color (0.5.2) tty-cursor (0.7.1) - tty-prompt (0.21.0) - necromancer (~> 0.5.0) - pastel (~> 0.7.0) - tty-reader (~> 0.7.0) - tty-reader (0.7.0) + tty-prompt (0.22.0) + pastel (~> 0.8) + tty-reader (~> 0.8) + tty-reader (0.8.0) tty-cursor (~> 0.7) - tty-screen (~> 0.7) - wisper (~> 2.0.0) + tty-screen (~> 0.8) + wisper (~> 2.0) tty-screen (0.8.1) typhoeus (0.8.0) ethon (>= 0.8.0) @@ -426,7 +417,6 @@ DEPENDENCIES foodcritic kitchen-docker kitchen-vagrant - mdl overcommit rspec rubocop diff --git a/libraries/drivers_appserver_base.rb b/libraries/drivers_appserver_base.rb index db8c6c55..abee73c1 100644 --- a/libraries/drivers_appserver_base.rb +++ b/libraries/drivers_appserver_base.rb @@ -53,7 +53,6 @@ def manual_action(action) end end - # rubocop:disable Metrics/AbcSize def add_appserver_config opts = { deploy_dir: deploy_dir(app), out: out, deploy_env: deploy_env, webserver: Drivers::Webserver::Factory.build(context, app).adapter, @@ -67,7 +66,6 @@ def add_appserver_config variables opts end end - # rubocop:enable Metrics/AbcSize def add_appserver_service_script opts = { deploy_dir: deploy_dir(app), app_shortname: app['shortname'], name: adapter, environment: environment, diff --git a/libraries/drivers_db_base.rb b/libraries/drivers_db_base.rb index be0d0838..c15e5177 100644 --- a/libraries/drivers_db_base.rb +++ b/libraries/drivers_db_base.rb @@ -17,7 +17,6 @@ def setup handle_packages end - # rubocop:disable Metrics/AbcSize: def out return out_defaults if multiple_databases? return out_node_engine if configuration_data_source == :node_engine @@ -28,7 +27,6 @@ def out database: app['data_sources'].first.try(:[], 'database_name') ).reject { |_k, v| v.blank? } end - # rubocop:enable Metrics/AbcSize: def out_node_engine out_defaults.merge( diff --git a/libraries/drivers_framework_rails.rb b/libraries/drivers_framework_rails.rb index 9b30d1a1..2cac198e 100644 --- a/libraries/drivers_framework_rails.rb +++ b/libraries/drivers_framework_rails.rb @@ -55,9 +55,11 @@ def setup_rails_console return unless File.exist?(application_rb_path) + # rubocop:disable Style/StringConcatenation env_code = "if(defined?(Rails::Console))\n " + environment.map { |key, value| "ENV['#{key}'] = #{value.inspect}" }.join("\n ") + "\nend\n" + # rubocop:enable Style/StringConcatenation contents = File.read(application_rb_path).sub(/(^(?:module|class).*$)/, "#{env_code}\n\\1") diff --git a/libraries/drivers_worker_base.rb b/libraries/drivers_worker_base.rb index 2bd067b9..5a649213 100644 --- a/libraries/drivers_worker_base.rb +++ b/libraries/drivers_worker_base.rb @@ -14,7 +14,7 @@ def validate_app_engine; end protected - def add_worker_monit # rubocop:disable Metrics/AbcSize + def add_worker_monit opts = { application: app['shortname'], name: app['name'], out: out, deploy_to: deploy_dir(app), environment: environment, adapter: adapter, app_shortname: app['shortname'] } diff --git a/libraries/helpers.rb b/libraries/helpers.rb index 0aee53f5..997d0f0b 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -87,11 +87,9 @@ def every_enabled_application end end -def every_enabled_rds(context, application) +def every_enabled_rds(context, application, &block) data = [rdses.presence, Drivers::Db::Factory.build(context, application)].flatten.compact - data.each do |rds| - yield rds - end + data.each(&block) end def perform_bundle_install(shared_path, envs = {}) diff --git a/spec/fixtures/node.rb b/spec/fixtures/node.rb index 92f692ba..9056df4f 100644 --- a/spec/fixtures/node.rb +++ b/spec/fixtures/node.rb @@ -104,7 +104,7 @@ } }.freeze -def node(override = {}, deep_merge = false) +def node(override = {}, deep_merge = false) # rubocop:disable Style/OptionalBooleanParameter item = if deep_merge RubyOpsworksTests::DeepMergeableHash.new(DEFAULT_NODE).deep_merge(override)