diff --git a/.haml-lint.yml b/.haml-lint.yml index e2f80eebdb..07aa5ebf7c 100644 --- a/.haml-lint.yml +++ b/.haml-lint.yml @@ -29,6 +29,7 @@ linters: RuboCop: enabled: true ignored_cops: + - Layout/ArgumentAlignment - Layout/ElseAlignment - Layout/EndAlignment - Layout/IndentationWidth diff --git a/.rubocop.yml b/.rubocop.yml index 2354423fa1..a04d9f8165 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -20,9 +20,23 @@ AllCops: ### Capybara. +# TODO: Enable. +Capybara/ClickLinkOrButtonStyle: + Enabled: false + Capybara/SpecificFinders: Enabled: false +# FactoryBot. + +# FactoryBot/CreateList: +RSpec/FactoryBot/CreateList: + EnforcedStyle: n_times + +# FactoryBot/ConsistentParenthesesStyle: +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false + ### Layout. Layout/ArgumentAlignment: @@ -110,10 +124,17 @@ Lint/EmptyBlock: Lint/HeredocMethodCallPosition: Enabled: true +# TODO: Investigate. +Lint/LiteralAssignmentInCondition: + Enabled: false + Lint/MissingSuper: Exclude: - 'app/components/**/*' +Lint/RedundantCopDisableDirective: + Enabled: false + Lint/RequireRelativeSelfPath: Exclude: - 'lib/tasks/**/*.rake' @@ -200,6 +221,9 @@ Naming/VariableNumber: Performance/MapCompact: Enabled: false +Performance/MapMethodChain: + Enabled: false + Performance/MethodObjectAsBlock: Enabled: false @@ -235,6 +259,9 @@ Rails/EnvironmentVariableAccess: Enabled: true AllowReads: true +Rails/FindEach: + Enabled: false + Rails/FreezeTime: Enabled: false @@ -340,12 +367,6 @@ RSpec/ExampleLength: RSpec/ExpectChange: EnforcedStyle: block -RSpec/FactoryBot/CreateList: - EnforcedStyle: n_times - -RSpec/FactoryBot/ConsistentParenthesesStyle: - Enabled: false - RSpec/FilePath: # TODO: See if we can remove this after https://github.com/rubocop/rubocop-rspec/pull/1266 CustomTransform: @@ -501,6 +522,19 @@ Style/RedundantConstantBase: - 'config/environments/production.rb' - 'config/environments/staging.rb' +# TODO: Investigate. +Style/RedundantDoubleSplatHashBraces: + Enabled: false + +Style/RedundantParentheses: + Enabled: false + +Style/RedundantRegexpArgument: + Enabled: false + +Style/RedundantReturn: + Enabled: false + Style/ReturnNil: Enabled: true diff --git a/Gemfile b/Gemfile index 5520417e27..ce7902332c 100644 --- a/Gemfile +++ b/Gemfile @@ -72,7 +72,8 @@ group :development, :test do gem 'haml_lint', require: false gem 'pry' gem 'rspec-rails' - gem 'rubocop', '~> 1.50.0', require: false + gem 'rubocop', '~> 1.59.0', require: false + gem 'rubocop-capybara', require: false gem 'rubocop-performance' gem 'rubocop-rails' gem 'rubocop-rake' diff --git a/Gemfile.lock b/Gemfile.lock index f1656c6af3..5ce91bc9e7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,9 +60,9 @@ GEM globalid (>= 0.3.6) activemodel (7.0.4.3) activesupport (= 7.0.4.3) - activemodel-serializers-xml (1.0.2) - activemodel (> 5.x) - activesupport (> 5.x) + activemodel-serializers-xml (1.0.3) + activemodel (>= 5.0.0.a) + activesupport (>= 5.0.0.a) builder (~> 3.1) activerecord (7.0.4.3) activemodel (= 7.0.4.3) @@ -79,44 +79,47 @@ GEM i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - acts_as_list (1.1.0) - activerecord (>= 4.2) - addressable (2.8.4) - public_suffix (>= 2.0.2, < 6.0) + acts_as_list (1.2.4) + activerecord (>= 6.1) + activesupport (>= 6.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) attr_extras (7.1.0) awesome_print (1.9.2) - aws-eventstream (1.2.0) - aws-partitions (1.749.0) - aws-sdk-core (3.171.0) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) + aws-eventstream (1.3.0) + aws-partitions (1.1018.0) + aws-sdk-core (3.214.0) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.63.0) - aws-sdk-core (~> 3, >= 3.165.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.120.1) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-kms (1.96.0) + aws-sdk-core (~> 3, >= 3.210.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.176.0) + aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.10.1) aws-eventstream (~> 1, >= 1.0.2) axiom-types (0.1.1) descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - bcrypt (3.1.18) - brakeman (5.4.1) - builder (3.2.4) - bundler-audit (0.9.1) + bcrypt (3.1.20) + bigdecimal (3.1.8) + brakeman (6.2.2) + racc + builder (3.3.0) + bundler-audit (0.9.2) bundler (>= 1.2.0, < 3) thor (~> 1.0) - capybara (3.39.0) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) @@ -124,6 +127,8 @@ GEM capybara-screenshot (1.0.26) capybara (>= 1.0, < 4) launchy + childprocess (5.1.0) + logger (~> 1.5) climate_control (0.2.0) coderay (1.1.3) coercible (1.0.0) @@ -135,33 +140,34 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - colorize (0.8.1) - concurrent-ruby (1.2.2) - config (4.1.0) + colorize (1.1.0) + concurrent-ruby (1.3.4) + config (5.5.2) deep_merge (~> 1.2, >= 1.2.1) - dry-validation (~> 1.0, >= 1.0.0) - crack (0.4.5) + ostruct + crack (1.0.0) + bigdecimal rexml crass (1.0.6) - database_cleaner (2.0.2) + database_cleaner (2.1.0) database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.1.0) + database_cleaner-active_record (2.2.0) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - date (3.3.3) + date (3.4.1) deep_merge (1.2.2) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - devise (4.9.2) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) - diffy (3.4.2) - docile (1.4.0) + diff-lcs (1.5.1) + diffy (3.4.3) + docile (1.4.1) draper (4.0.2) actionpack (>= 5.0) activemodel (>= 5.0) @@ -169,74 +175,44 @@ GEM activesupport (>= 5.0) request_store (>= 1.0) ruby2_keywords - dry-configurable (1.0.1) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-core (1.0.0) - concurrent-ruby (~> 1.0) - zeitwerk (~> 2.6) - dry-inflector (1.0.0) - dry-initializer (3.1.1) - dry-logic (1.5.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-schema (1.13.1) - concurrent-ruby (~> 1.0) - dry-configurable (~> 1.0, >= 1.0.1) - dry-core (~> 1.0, < 2) - dry-initializer (~> 3.0) - dry-logic (>= 1.4, < 2) - dry-types (>= 1.7, < 2) - zeitwerk (~> 2.6) - dry-types (1.7.1) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0) - dry-inflector (~> 1.0) - dry-logic (~> 1.4) - zeitwerk (~> 2.6) - dry-validation (1.10.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - dry-initializer (~> 3.0) - dry-schema (>= 1.12, < 2) - zeitwerk (~> 2.6) - email_spec (2.2.1) + email_spec (2.3.0) htmlentities (~> 4.3.3) - launchy (~> 2.1) + launchy (>= 2.1, < 4.0) mail (~> 2.7) - equalizer (0.0.11) - erubi (1.12.0) - execjs (2.8.1) - ey_config (0.0.7) - factory_bot (6.2.1) + erubi (1.13.0) + execjs (2.10.0) + ey_config (0.0.8) + factory_bot (6.5.0) activesupport (>= 5.0.0) - factory_bot_rails (6.2.0) - factory_bot (~> 6.2.0) + factory_bot_rails (6.4.4) + factory_bot (~> 6.5) railties (>= 5.0.0) - faraday (2.7.4) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - ffi (1.15.5) - flay (2.13.0) + faraday (2.12.1) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + ffi (1.17.0) + flay (2.13.3) erubi (~> 1.10) path_expander (~> 1.0) ruby_parser (~> 3.0) sexp_processor (~> 4.0) - flog (4.6.6) + flog (4.8.0) path_expander (~> 1.0) ruby_parser (~> 3.1, > 3.1.0) sexp_processor (~> 4.8) formatador (1.1.0) - globalid (1.1.0) - activesupport (>= 5.0) - grape-swagger-rails (0.4.0) + globalid (1.2.1) + activesupport (>= 6.1) + grape-swagger-rails (0.6.0) + ostruct railties (>= 6.0.6.1) - gretel (4.4.0) - actionview (>= 5.1, < 7.1) - railties (>= 5.1, < 7.1) - guard (2.18.0) + gretel (5.0.1) + actionview (>= 6.1) + railties (>= 6.1) + guard (2.19.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) lumberjack (>= 1.0.12, < 2.0) @@ -253,89 +229,98 @@ GEM guard-rubocop (1.5.0) guard (~> 2.0) rubocop (< 2.0) - haml (6.1.1) + haml (6.3.0) temple (>= 0.8.2) thor tilt - haml_lint (0.45.0) - haml (>= 4.0, < 6.2) + haml_lint (0.59.0) + haml (>= 5.0) parallel (~> 1.10) rainbow - rubocop (>= 0.50.0) + rubocop (>= 1.0) sysexits (~> 1.1) hamlit (3.0.3) temple (>= 0.8.2) thor tilt - hashdiff (1.0.1) - high_voltage (3.1.2) - highline (2.1.0) + hashdiff (1.1.2) + high_voltage (4.0.0) + highline (3.1.1) + reline htmlentities (4.3.4) - i18n (1.12.0) + i18n (1.14.6) concurrent-ruby (~> 1.0) ice_nine (0.11.2) - inline_svg (1.9.0) + inline_svg (1.10.0) activesupport (>= 3.0) nokogiri (>= 1.6) + io-console (0.8.0) jmespath (1.6.2) jquery-atwho-rails (1.5.4) - jquery-rails (4.5.1) + jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) - jquery-ui-rails (6.0.1) + jquery-ui-rails (7.0.0) railties (>= 3.2.16) - json (2.6.3) + json (2.9.0) kwalify (0.7.2) - launchy (2.5.2) + language_server-protocol (3.17.0.3) + launchy (3.0.1) addressable (~> 2.8) - ledermann-rails-settings (2.5.0) - activerecord (>= 4.2) - listen (3.8.0) + childprocess (~> 5.0) + ledermann-rails-settings (2.6.2) + activerecord (>= 6.1) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.20.0) + logger (1.6.2) + loofah (2.23.1) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - lumberjack (1.2.8) + nokogiri (>= 1.12.0) + lumberjack (1.2.10) mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) - mime-types (3.4.1) + method_source (1.1.0) + mime-types (3.6.0) + logger mime-types-data (~> 3.2015) - mime-types-data (3.2023.0218.1) + mime-types-data (3.2024.1203) mimemagic (0.3.10) nokogiri (~> 1) rake - mini_mime (1.1.2) - mini_portile2 (2.8.1) - minitest (5.18.0) - mysql2 (0.5.5) + mini_mime (1.1.5) + mini_portile2 (2.8.8) + minitest (5.25.4) + mysql2 (0.5.6) nenv (0.3.0) - net-imap (0.3.4) + net-http (0.6.0) + uri + net-imap (0.5.1) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol - newrelic_rpm (9.2.0) - nio4r (2.5.9) - nokogiri (1.14.3) - mini_portile2 (~> 2.8.0) + newrelic_rpm (9.16.1) + nio4r (2.7.4) + nokogiri (1.16.8) + mini_portile2 (~> 2.8.2) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) options (2.3.2) orm_adapter (0.5.0) + ostruct (0.6.1) paper_trail (14.0.0) activerecord (>= 6.0) request_store (~> 1.4) @@ -345,25 +330,26 @@ GEM mime-types mimemagic (~> 0.3.0) terrapin (~> 0.6.0) - parallel (1.22.1) - parser (3.2.2.0) + parallel (1.26.3) + parser (3.2.2.4) ast (~> 2.4.1) - path_expander (1.1.1) + racc + path_expander (1.1.3) pr_geohash (1.0.0) - progress_bar (1.3.3) - highline (>= 1.6, < 3) + progress_bar (1.3.4) + highline (>= 1.6) options (~> 2.3.0) - pry (0.14.2) + pry (0.15.0) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (5.0.1) - puma (5.6.5) + public_suffix (6.0.1) + puma (5.6.9) nio4r (~> 2.0) - racc (1.6.2) - rack (2.2.6.4) - rack-cors (2.0.1) + racc (1.8.1) + rack (2.2.10) + rack-cors (2.0.2) rack (>= 2.0.0) - rack-proxy (0.7.6) + rack-proxy (0.7.7) rack rack-test (2.1.0) rack (>= 1.3) @@ -385,11 +371,13 @@ GEM actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.1) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) railties (7.0.4.3) actionpack (= 7.0.4.3) activesupport (= 7.0.4.3) @@ -398,37 +386,39 @@ GEM thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.0.6) + rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) redcarpet (3.6.0) reek (6.1.4) kwalify (~> 0.7.0) parser (~> 3.2.0) rainbow (>= 2.0, < 4.0) - regexp_parser (2.8.0) - request_store (1.5.1) + regexp_parser (2.9.3) + reline (0.5.12) + io-console (~> 0.5) + request_store (1.7.0) rack (>= 1.4) - responders (3.1.0) + responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.2.5) - rsolr (2.5.0) + rexml (3.3.9) + rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.1) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.2) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.2) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) + rspec-support (~> 3.13.0) rspec-rails (6.0.1) actionpack (>= 6.1) activesupport (>= 6.1) @@ -437,24 +427,25 @@ GEM rspec-expectations (~> 3.11) rspec-mocks (~> 3.11) rspec-support (~> 3.11) - rspec-support (3.12.0) - rubocop (1.50.2) + rspec-support (3.13.2) + rubocop (1.59.0) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.4) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.0, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.28.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-capybara (2.17.1) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-performance (1.17.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) + rubocop-performance (1.20.2) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.30.0, < 2.0) rubocop-rails (2.19.1) activesupport (>= 4.2.0) rack (>= 1.1) @@ -466,19 +457,21 @@ GEM rubocop-capybara (~> 2.17) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) - ruby_parser (3.20.0) + ruby_parser (3.21.1) + racc (~> 1.5) sexp_processor (~> 4.16) - rubycritic (4.7.0) - flay (~> 2.8) - flog (~> 4.4) - launchy (>= 2.0.0) - parser (>= 2.6.0) - rainbow (~> 3.0) - reek (~> 6.0, < 7.0) - ruby_parser (~> 3.8) - simplecov (>= 0.17.0) - tty-which (~> 0.4.0) - virtus (~> 1.0) + rubycritic (4.9.1) + flay (~> 2.13) + flog (~> 4.7) + launchy (>= 2.5.2) + parser (>= 3.2.2.4) + rainbow (~> 3.1.1) + reek (~> 6.0, < 6.2) + rexml + ruby_parser (~> 3.21) + simplecov (>= 0.22.0) + tty-which (~> 0.5.0) + virtus (~> 2.0) sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) @@ -487,76 +480,78 @@ GEM sprockets (> 3.0) sprockets-rails tilt - semantic_range (3.0.0) - sexp_processor (4.16.1) + semantic_range (3.1.0) + sexp_processor (4.17.3) shellany (0.0.1) - shoulda-matchers (5.3.0) + shoulda-matchers (6.4.0) activesupport (>= 5.2.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.12.3) + simplecov-html (0.13.1) simplecov_json_formatter (0.1.4) - sprockets (4.2.0) + sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - stimulus-rails (1.2.1) + stimulus-rails (1.3.4) railties (>= 6.0.0) - strip_attributes (1.13.0) - activemodel (>= 3.0, < 8.0) - sunspot (2.6.0) + strip_attributes (1.14.0) + activemodel (>= 3.0, < 9.0) + sunspot (2.7.1) + bigdecimal pr_geohash (~> 1.0) rsolr (>= 1.1.1, < 3) - sunspot_rails (2.6.0) - rails (>= 3) - sunspot (= 2.6.0) + sunspot_rails (2.7.1) + rails (>= 5) + sunspot (= 2.7.1) sunspot_solr (2.2.0) sunspot_test (0.4.2) sunspot_rails (>= 2.1.1) sunspot_solr sysexits (1.2.0) - tabulo (2.8.2) - tty-screen (= 0.8.1) - unicode-display_width (~> 2.2) - tailwindcss-rails (2.0.27) - railties (>= 6.0.0) - temple (0.10.0) + tabulo (3.0.2) + tty-screen (= 0.8.2) + unicode-display_width (~> 2.5) + tailwindcss-rails (3.0.0) + railties (>= 7.0.0) + tailwindcss-ruby + tailwindcss-ruby (3.4.16) + temple (0.10.3) terrapin (0.6.0) climate_control (>= 0.0.3, < 1.0) - thor (1.2.1) + thor (1.3.2) thread_safe (0.3.6) - tilt (2.1.0) - timeout (0.3.2) - tty-screen (0.8.1) - tty-which (0.4.2) - turbo-rails (1.4.0) + tilt (2.4.0) + timeout (0.4.2) + tty-screen (0.8.2) + tty-which (0.5.0) + turbo-rails (2.0.11) actionpack (>= 6.0.0) - activejob (>= 6.0.0) railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (4.2.0) + uglifier (4.2.1) execjs (>= 0.3.0, < 3) - unicode-display_width (2.4.2) - unread (0.12.0) - activerecord (>= 3) - view_component (2.82.0) - activesupport (>= 5.2.0, < 8.0) + unicode-display_width (2.6.0) + unread (0.14.0) + activerecord (>= 6.1) + uri (1.0.2) + view_component (3.20.0) + activesupport (>= 5.2.0, < 8.1) concurrent-ruby (~> 1.0) method_source (~> 1.0) - virtus (1.0.5) + virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) - equalizer (~> 0.0, >= 0.0.9) warden (1.2.9) rack (>= 2.0.9) - webmock (3.18.1) + webmock (3.24.0) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -565,14 +560,14 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - webrick (1.8.1) - websocket-driver (0.7.5) + webrick (1.9.1) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - will_paginate (3.3.1) + will_paginate (4.0.1) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.7) + zeitwerk (2.7.1) PLATFORMS ruby @@ -624,7 +619,8 @@ DEPENDENCIES redcarpet request_store rspec-rails - rubocop (~> 1.50.0) + rubocop (~> 1.59.0) + rubocop-capybara rubocop-performance rubocop-rails rubocop-rake diff --git a/app/controllers/feedbacks_controller.rb b/app/controllers/feedbacks_controller.rb index 7e3f80285c..271e1c7bda 100644 --- a/app/controllers/feedbacks_controller.rb +++ b/app/controllers/feedbacks_controller.rb @@ -105,7 +105,7 @@ def feedback_params end def rate_throttle? remote_ip - return if current_user + return false if current_user Feedback.submitted_by_ip(remote_ip).recent.count >= 5 end end diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 2ddcd104b2..b502b28ab7 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -37,7 +37,7 @@ def update_resource resource, params if settings_params settings_params[:editing_helpers]&.each do |key, value| - resource.settings(:editing_helpers).public_send("#{key}=", ActiveModel::Type::Boolean.new.cast(value)) + resource.settings(:editing_helpers).public_send(:"#{key}=", ActiveModel::Type::Boolean.new.cast(value)) end end diff --git a/app/forms/protonym_form.rb b/app/forms/protonym_form.rb index d6e855499c..e3943efab2 100644 --- a/app/forms/protonym_form.rb +++ b/app/forms/protonym_form.rb @@ -44,7 +44,7 @@ def initialize protonym, params = {}, form_params = {} @protonym.name = build_name protonym_name_string end - super params + super(params) end def authorship_attributes= attributes diff --git a/app/models/concerns/cleanup_and_convert_taxt_columns.rb b/app/models/concerns/cleanup_and_convert_taxt_columns.rb index 6fe6a346e5..461f12d44c 100644 --- a/app/models/concerns/cleanup_and_convert_taxt_columns.rb +++ b/app/models/concerns/cleanup_and_convert_taxt_columns.rb @@ -9,7 +9,7 @@ def cleanup_and_convert_taxt_columns *taxt_columns new_taxt = Taxt::Cleanup[new_taxt] new_taxt = Taxt::ConvertTags[new_taxt] - public_send("#{taxt_column}=".to_sym, new_taxt) + public_send(:"#{taxt_column}=", new_taxt) end end end diff --git a/app/models/db_script_soft_validation.rb b/app/models/db_script_soft_validation.rb index e8dc5d1b75..7f73d683a3 100644 --- a/app/models/db_script_soft_validation.rb +++ b/app/models/db_script_soft_validation.rb @@ -8,8 +8,8 @@ class DbScriptSoftValidation attr_private_initialize :record, :database_script_klass delegate :issue_description, to: :database_script - def self.run *args - new(*args).tap(&:run) + def self.run(*) + new(*).tap(&:run) end def run diff --git a/app/models/taxon_browser/tabs/extra_tab.rb b/app/models/taxon_browser/tabs/extra_tab.rb index d359579d3c..20eabda616 100644 --- a/app/models/taxon_browser/tabs/extra_tab.rb +++ b/app/models/taxon_browser/tabs/extra_tab.rb @@ -54,7 +54,7 @@ def self.create taxon, view, taxon_browser end def initialize title, taxa_in_tab, taxon_browser - super taxa_in_tab, taxon_browser + super(taxa_in_tab, taxon_browser) @title = title.html_safe end diff --git a/app/models/taxon_browser/tabs/taxon_tab.rb b/app/models/taxon_browser/tabs/taxon_tab.rb index c482e871aa..65f8aa4003 100644 --- a/app/models/taxon_browser/tabs/taxon_tab.rb +++ b/app/models/taxon_browser/tabs/taxon_tab.rb @@ -9,7 +9,7 @@ class TaxonTab < Tab def initialize tab_taxon, taxon_browser @tab_taxon = tab_taxon - super tab_taxon.immediate_children, taxon_browser + super(tab_taxon.immediate_children, taxon_browser) end def title diff --git a/app/services/taxa/operations/move_items.rb b/app/services/taxa/operations/move_items.rb index 7786e35f9a..1e64892e2f 100644 --- a/app/services/taxa/operations/move_items.rb +++ b/app/services/taxa/operations/move_items.rb @@ -18,7 +18,7 @@ def call private def cannot_move_reference_sections? - return if reference_sections.blank? + return false if reference_sections.blank? !to_taxon.type.in?(Rank::AntCatSpecific::CAN_HAVE_REFERENCE_SECTIONS_TYPES) end diff --git a/app/views/database_scripts/index.html.haml b/app/views/database_scripts/index.html.haml index 4c93667311..ee37c54e2b 100644 --- a/app/views/database_scripts/index.html.haml +++ b/app/views/database_scripts/index.html.haml @@ -15,7 +15,6 @@ =DatabaseScriptDecorator.format_tags([params[:tag]]) =link_to "(show all)", database_scripts_path - -if @grouped_database_scripts.empty? Found no database scripts. -@grouped_database_scripts.each do |section, database_scripts| diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 28efa30226..87b06093ba 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -18,4 +18,3 @@ .row .medium-6 =f.button "Change my password", class: "btn-saves btn-md" - diff --git a/app/views/mailers/user_mailer/new_notification.html.haml b/app/views/mailers/user_mailer/new_notification.html.haml index e357fea2ad..2cbd5b3e49 100644 --- a/app/views/mailers/user_mailer/new_notification.html.haml +++ b/app/views/mailers/user_mailer/new_notification.html.haml @@ -94,7 +94,6 @@ =@notification.notifier.name =render partial: @notification.email_template_name, locals: { notification: @notification } - :plain diff --git a/lib/dev_monkey_patches/object.rb b/lib/dev_monkey_patches/object.rb index fc5fb82747..5057896e14 100644 --- a/lib/dev_monkey_patches/object.rb +++ b/lib/dev_monkey_patches/object.rb @@ -43,14 +43,14 @@ def dev_dev_puts string # "ddpgl" = "dd puts green light" # Puts to standard out with color. %w[red green yellow blue magenta cyan white].each do |color| - color_method_name = "ddp#{color.to_s.first}".to_sym + color_method_name = :"ddp#{color.to_s.first}" define_method color_method_name do |string| - $stdout.puts string.to_s.public_send color + $stdout.puts string.to_s.public_send(color) end - light_color_method_name = "#{color_method_name}l".to_sym + light_color_method_name = :"#{color_method_name}l" define_method light_color_method_name do |string| - $stdout.puts string.to_s.public_send "light_#{color}" + $stdout.puts string.to_s.public_send(:"light_#{color}") end end diff --git a/spec/factories/history_items.rb b/spec/factories/history_items.rb index cf64e25b1f..30a5677bf0 100644 --- a/spec/factories/history_items.rb +++ b/spec/factories/history_items.rb @@ -6,7 +6,7 @@ taxt_tag {} end - association :protonym + protonym trait :family_rank_only_item do rank { Rank::FAMILY } diff --git a/spec/factories/site_notices.rb b/spec/factories/site_notices.rb index 1dd7ea4e87..76d603ab30 100644 --- a/spec/factories/site_notices.rb +++ b/spec/factories/site_notices.rb @@ -4,6 +4,6 @@ factory :site_notice do sequence(:title) { |n| "Site notice title #{n}" } sequence(:message) { |n| "Site notice message #{n}" } - association :user, factory: :user + association :user end end diff --git a/spec/models/db_script_soft_validations_spec.rb b/spec/models/db_script_soft_validations_spec.rb index 33c1969d23..5deff5ae5b 100644 --- a/spec/models/db_script_soft_validations_spec.rb +++ b/spec/models/db_script_soft_validations_spec.rb @@ -12,9 +12,11 @@ end it "does not include slow database scripts (since it's checked in the catalog)" do + # rubocop:disable Lint/LiteralAssignmentInCondition unless klass.methods(_including_ancestors = false).include?(:record_in_results?) expect(klass.new.decorate.slow?).to eq false end + # rubocop:enable Lint/LiteralAssignmentInCondition end end end diff --git a/spec/support/shared_examples.rb b/spec/support/shared_examples.rb index 92e15f4501..bbaaec7863 100644 --- a/spec/support/shared_examples.rb +++ b/spec/support/shared_examples.rb @@ -2,7 +2,7 @@ shared_examples_for "a taxt column with cleanup" do |column| it 'strips double spaces and colons' do - subject.public_send "#{column}=", 'Pi zz : : a' + subject.public_send(:"#{column}=", 'Pi zz : : a') expect { subject.valid? }.to change { subject.public_send(column) }.from('Pi zz : : a').to('Pi zz: a') end end