From 32dbc7528f225ef8947dc4b2b4b955fca5647823 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Mon, 21 Oct 2024 20:46:34 -0400 Subject: [PATCH 01/22] standard -> rubocop linting --- .gitignore | 1 - .rubocop.yml | 39 +++++++++++++++++++ .rubocop_todo.yml | 7 ++++ .standard.yml | 3 -- Gemfile | 7 +++- Gemfile.lock | 4 +- bin/lint | 3 +- config/environments/development.rb | 2 + ...05_populate_case_contact_contact_type.rake | 2 +- 9 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml delete mode 100644 .standard.yml diff --git a/.gitignore b/.gitignore index a2384a9d23..9da634330e 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,6 @@ yarn-debug.log* .rails_routes* .vscode -.rubocop.yml coverage/ .idea/ diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000000..44e2a21339 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_mode: + merge: + - Exclude + +require: + - standard + - standard-custom + - standard-performance + - rubocop-performance + +inherit_gem: + standard: config/ruby-3.2.yml + standard-performance: config/base.yml + standard-custom: config/base.yml + +inherit_from: + - .rubocop_todo.yml + +AllCops: + NewCops: enable + SuggestExtensions: false + TargetRubyVersion: 3.2 + Exclude: + - 'bin/**/*' # todo? + - 'db/migrate/2020*.rb' + - 'db/migrate/2021*.rb' + - 'db/migrate/2022*.rb' + - 'db/migrate/2023*.rb' + - 'db/migrate/202405*.rb' + - 'db/migrate/202406*.rb' + - 'lib/tasks/deployment/2020*' + - 'lib/tasks/deployment/2021*' + - 'lib/tasks/deployment/2022*' + - 'lib/tasks/deployment/2023*' + +# Override Todos for these rules: +Lint/Debugger: # don't leave binding.pry or debugger + Enabled: true + Exclude: [] diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000000..d282c85535 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,7 @@ +# This configuration was generated by +# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` +# on 2024-10-22 00:37:02 UTC using RuboCop version 1.65.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. diff --git a/.standard.yml b/.standard.yml deleted file mode 100644 index 06d77c40d4..0000000000 --- a/.standard.yml +++ /dev/null @@ -1,3 +0,0 @@ -ignore: - - 'storage/**/*' - - 'lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake' diff --git a/Gemfile b/Gemfile index 3a8ae07cd6..208ede0730 100644 --- a/Gemfile +++ b/Gemfile @@ -64,7 +64,6 @@ group :development, :test do gem "bullet" # Detect and fix N+1 queries gem "byebug", platforms: %i[mri mingw x64_mingw] # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem "dotenv-rails" - gem "erb_lint", require: false gem "factory_bot_rails" gem "parallel_tests" gem "pry" @@ -73,7 +72,11 @@ group :development, :test do gem "rspec-rails" gem "rswag-specs" gem "shoulda-matchers" - gem "standard", "~> 1.40.0" + # linters + gem "erb_lint", require: false + gem "rubocop", require: false + gem "rubocop-performance", require: false + gem "standard", require: false end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 2db9cbdcac..c1ac0cd14f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -648,6 +648,8 @@ DEPENDENCIES rswag-api rswag-specs rswag-ui + rubocop + rubocop-performance sablon scout_apm selenium-webdriver @@ -656,7 +658,7 @@ DEPENDENCIES spring spring-commands-rspec sprockets-rails - standard (~> 1.40.0) + standard stimulus-rails strong_migrations traceroute diff --git a/bin/lint b/bin/lint index d82099237e..69dd304dd1 100755 --- a/bin/lint +++ b/bin/lint @@ -1,6 +1,7 @@ #!/usr/bin/env bash -bundle exec standardrb --fix --format progress +# bundle exec rubocop --autocorrect --format pacman +bundle exec rubocop --autocorrect --format worst bundle exec erblint --lint-all --autocorrect yarn lint:fix echo "Linting Factories" diff --git a/config/environments/development.rb b/config/environments/development.rb index 0ffa5ba8ac..91b26c73d9 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -90,4 +90,6 @@ # Raise error when a before_action's only/except options reference missing actions config.action_controller.raise_on_missing_callback_actions = false + + config.generators.apply_rubocop_autocorrect_after_generate! end diff --git a/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake b/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake index 1a42fe5cb6..09b7879e15 100644 --- a/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake +++ b/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake @@ -1,4 +1,4 @@ -require_relative '../data_post_processors/case_contact_populator' +require_relative "../data_post_processors/case_contact_populator" namespace :after_party do desc "Deployment task: populate_case_contact_contact_type" From f3b65424c4aea96b73b0ed518a3cc4b86b0e7e56 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Mon, 21 Oct 2024 21:59:25 -0400 Subject: [PATCH 02/22] add rubocop-rspec / rspec_rails --- .rubocop.yml | 37 ++ .rubocop_todo.yml | 1316 ++++++++++++++++++++++++++++++++++++++++++- Gemfile | 2 + Gemfile.lock | 7 + spec/spec_helper.rb | 4 + 5 files changed, 1365 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 44e2a21339..f5f23b0f0b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,6 +7,8 @@ require: - standard-custom - standard-performance - rubocop-performance + - rubocop-rspec + - rubocop-rspec_rails inherit_gem: standard: config/ruby-3.2.yml @@ -37,3 +39,38 @@ AllCops: Lint/Debugger: # don't leave binding.pry or debugger Enabled: true Exclude: [] +RSpec/Focus: # run ALL tests on CI + Enabled: true + Exclude: [] + +# RSPEC +RSpec/ExampleLength: + CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] + Max: 15 # could be lower; default is 5 + Exclude: + - 'spec/system/**/*' +RSpec/LetSetup: + Details: >- + Let bangs (!) lead to unnecessary database calls during test execution. + They can also obscure what setup is necessary for the test. + Instead of immediate execution in a let!, call the variable where it is necessary: that is, + where tests or other variables depend on it: in an example before `subject`, a before block, + or the let block of a dependant variable: + let(:some_needed_thing) { create(:bang) } + let(:dependent_thing) do + some_needed_thing # instead of let!(:some_needed_thing) above + create(:dependent_thing) + end +RSpec/MultipleExpectations: + Max: 10 # failures are aggregated by default (spec_helper.rb) + Exclude: + - 'spec/system/**/*' # async behaviors may require expecting things on page +RSpec/MultipleMemoizedHelpers: + Max: 20 +RSpec/NamedSubject: + Enabled: false +RSpec/NestedGroups: + Max: 5 +RSpec/NotToNot: + Enabled: false # consistency only, no difference in to_not/not_to + diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d282c85535..ec977d84c6 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,7 +1,1321 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-22 00:37:02 UTC using RuboCop version 1.65.1. +# on 2024-10-22 03:06:34 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. + +# Offense count: 53 +RSpec/AnyInstance: + Exclude: + - 'spec/controllers/emancipations_controller_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/presenters/case_contact_presenter_spec.rb' + - 'spec/requests/all_casa_admins/casa_admins_spec.rb' + - 'spec/requests/casa_admins_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/requests/case_assignments_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/emancipations_request_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/users/passwords_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/services/backfill_followupable_service_spec.rb' + - 'spec/services/followup_service_spec.rb' + - 'spec/services/preference_set_table_state_service_spec.rb' + - 'spec/system/supervisors/index_spec.rb' + - 'spec/views/case_contacts/index.html.erb_spec.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. +RSpec/BeEmpty: + Exclude: + - 'spec/models/case_court_report_context_spec.rb' + - 'spec/models/emancipation_option_spec.rb' + - 'spec/models/user_spec.rb' + +# Offense count: 63 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/BeEq: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/controllers/concerns/users/time_zone_spec.rb' + - 'spec/helpers/banner_helper_spec.rb' + - 'spec/helpers/case_contacts_helper_spec.rb' + - 'spec/helpers/emancipations_helper_spec.rb' + - 'spec/models/casa_admin_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/health_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/dashboard_policy_spec.rb' + - 'spec/requests/casa_admins_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/requests/checklist_items_spec.rb' + - 'spec/requests/contact_topics_spec.rb' + - 'spec/requests/supervisors_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/casa_case_change_service_spec.rb' + - 'spec/services/preference_set_table_state_service_spec.rb' + - 'spec/services/twilio_service_spec.rb' + - 'spec/values/case_contact_parameters_spec.rb' + - 'spec/views/all_casa_admins/patch_notes/index.html.erb_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/BeEql: + Exclude: + - 'spec/views/notifications/index.html.erb_spec.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: be, be_nil +RSpec/BeNil: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/helpers/sidebar_helper_spec.rb' + - 'spec/models/case_court_report_spec.rb' + +# Offense count: 2 +RSpec/BeforeAfterAll: + Exclude: + - 'spec/datatables/volunteer_datatable_spec.rb' + +# Offense count: 20 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: NegatedMatcher. +RSpec/ChangeByZero: + Exclude: + - 'spec/lib/importers/case_importer_spec.rb' + - 'spec/lib/importers/supervisor_importer_spec.rb' + - 'spec/lib/importers/volunteer_importer_spec.rb' + - 'spec/requests/additional_expenses_spec.rb' + - 'spec/requests/all_casa_admins/patch_notes_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/requests/case_groups_spec.rb' + - 'spec/requests/contact_topic_answers_spec.rb' + - 'spec/requests/contact_topics_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/imports_spec.rb' + - 'spec/requests/supervisor_volunteers_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/volunteer_birthday_reminder_service_spec.rb' + - 'spec/system/case_contacts/contact_topic_answers_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ContainExactly: + Exclude: + - 'spec/policies/casa_case_policy/scope_spec.rb' + +# Offense count: 10 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ContextMethod: + Exclude: + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/emancipation_category_spec.rb' + - 'spec/models/emancipation_option_spec.rb' + - 'spec/models/mileage_rate_spec.rb' + +# Offense count: 334 +# Configuration parameters: Prefixes, AllowedPatterns. +# Prefixes: when, with, without +RSpec/ContextWording: + Exclude: + - 'spec/callbacks/case_contact_metadata_callback_spec.rb' + - 'spec/components/sidebar/link_component_spec.rb' + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/controllers/concerns/accessible_spec.rb' + - 'spec/controllers/emancipations_controller_spec.rb' + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/helpers/followup_helper_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/helpers/phone_number_helper_spec.rb' + - 'spec/lib/importers/supervisor_importer_spec.rb' + - 'spec/lib/tasks/case_contact_types_reminder_spec.rb' + - 'spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb' + - 'spec/lib/tasks/no_contact_made_reminder_spec.rb' + - 'spec/lib/tasks/supervisor_weekly_digest_spec.rb' + - 'spec/mailers/previews/casa_admin_mailer_preview_spec.rb' + - 'spec/mailers/previews/devise_mailer_preview_spec.rb' + - 'spec/mailers/previews/supervisor_mailer_preview_spec.rb' + - 'spec/mailers/previews/volunteer_mailer_preview_spec.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/models/all_casa_admins/casa_org_metrics_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/contact_topic_spec.rb' + - 'spec/models/emancipation_category_spec.rb' + - 'spec/models/emancipation_option_spec.rb' + - 'spec/models/learning_hour_spec.rb' + - 'spec/models/mileage_rate_spec.rb' + - 'spec/models/placement_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/policies/casa_admin_policy_spec.rb' + - 'spec/policies/casa_case_policy_spec.rb' + - 'spec/policies/case_assignment_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/volunteer_policy_spec.rb' + - 'spec/requests/additional_expenses_spec.rb' + - 'spec/requests/casa_admins_spec.rb' + - 'spec/requests/casa_org_spec.rb' + - 'spec/requests/case_contact_reports_spec.rb' + - 'spec/requests/case_contacts/followups_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/contact_topic_answers_spec.rb' + - 'spec/requests/contact_type_groups_spec.rb' + - 'spec/requests/contact_types_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/dashboard_spec.rb' + - 'spec/requests/judges_spec.rb' + - 'spec/requests/learning_hours_spec.rb' + - 'spec/requests/missing_data_reports_spec.rb' + - 'spec/requests/reports_spec.rb' + - 'spec/requests/supervisors_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/additional_expense_params_service_spec.rb' + - 'spec/services/emancipation_checklist_reminder_service_spec.rb' + - 'spec/services/twilio_service_spec.rb' + - 'spec/services/volunteer_birthday_reminder_service_spec.rb' + - 'spec/system/all_casa_admins/patch_notes/index_spec.rb' + - 'spec/system/casa_cases/additional_index_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/emancipation/show_spec.rb' + - 'spec/system/casa_cases/show_more_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_contacts/followups/resolve_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/court_dates/view_spec.rb' + - 'spec/system/dashboard/show_spec.rb' + - 'spec/system/imports/index_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/reports/export_data_spec.rb' + - 'spec/system/reports/index_spec.rb' + - 'spec/system/sessions/new_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/system/supervisors/new_spec.rb' + - 'spec/system/users/edit_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/system/volunteers/index_spec.rb' + - 'spec/system/volunteers/new_spec.rb' + - 'spec/views/all_casa_admins/casa_orgs/show.html.erb_spec.rb' + - 'spec/views/casa_cases/new.html.erb_spec.rb' + - 'spec/views/casa_cases/show.html.erb_spec.rb' + - 'spec/views/casa_orgs/edit.html.erb_spec.rb' + - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' + - 'spec/views/case_court_reports/index.html.erb_spec.rb' + - 'spec/views/layouts/header.html.erb_spec.rb' + - 'spec/views/supervisors/new.html.erb_spec.rb' + - 'spec/views/volunteers/edit.html.erb_spec.rb' + - 'spec/views/volunteers/new.html.erb_spec.rb' + +# Offense count: 2 +# Configuration parameters: IgnoredMetadata. +RSpec/DescribeClass: + Exclude: + - 'spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb' + - 'spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb' + +# Offense count: 181 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants. +# SupportedStyles: described_class, explicit +RSpec/DescribedClass: + Exclude: + - 'spec/components/dropdown_menu_component_spec.rb' + - 'spec/components/modal/body_component_spec.rb' + - 'spec/components/modal/footer_component_spec.rb' + - 'spec/components/modal/group_component_spec.rb' + - 'spec/components/modal/header_component_spec.rb' + - 'spec/components/modal/open_button_component_spec.rb' + - 'spec/components/modal/open_link_component_spec.rb' + - 'spec/components/truncated_text_component_spec.rb' + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/helpers/phone_number_helper_spec.rb' + - 'spec/lib/importers/case_importer_spec.rb' + - 'spec/lib/importers/file_importer_spec.rb' + - 'spec/lib/importers/supervisor_importer_spec.rb' + - 'spec/lib/importers/volunteer_importer_spec.rb' + - 'spec/lib/tasks/case_contact_types_reminder_spec.rb' + - 'spec/lib/tasks/no_contact_made_reminder_spec.rb' + - 'spec/mailers/casa_admin_mailer_spec.rb' + - 'spec/mailers/learning_hours_mailer_spec.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/mailers/volunteer_mailer_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_assignment_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/contact_topic_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/models/emancipation_option_spec.rb' + - 'spec/models/followup_spec.rb' + - 'spec/models/health_spec.rb' + - 'spec/models/other_duty_spec.rb' + - 'spec/models/preference_set_spec.rb' + - 'spec/models/user_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/notifications/emancipation_checklist_reminder_notifier_spec.rb' + - 'spec/notifications/reimbursement_complete_notifier_spec.rb' + - 'spec/notifications/volunteer_birthday_notifier_spec.rb' + - 'spec/services/court_report_due_sms_reminder_service_spec.rb' + - 'spec/services/followup_service_spec.rb' + - 'spec/services/no_contact_made_sms_reminder_service_spec.rb' + - 'spec/services/placement_export_csv_service_spec.rb' + - 'spec/services/short_url_service_spec.rb' + - 'spec/services/sms_reminder_service_spec.rb' + - 'spec/services/twilio_service_spec.rb' + +# Offense count: 8 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect. +RSpec/EmptyExampleGroup: + Exclude: + - 'spec/decorators/android_app_association_decorator_spec.rb' + - 'spec/decorators/case_contacts/form_decorator_spec.rb' + - 'spec/decorators/patch_note_decorator_spec.rb' + - 'spec/factories/login_activities.rb' + - 'spec/helpers/contact_types_helper_spec.rb' + - 'spec/requests/api/v1/users/sessions_spec.rb' + - 'spec/views/supervisors/new.html.erb_spec.rb' + - 'spec/views/volunteers/new.html.erb_spec.rb' + +# Offense count: 20 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterExample: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/models/casa_admin_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/supervisor_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/contact_topic_policy_spec.rb' + - 'spec/policies/user_policy_spec.rb' + - 'spec/requests/api/v1/base_spec.rb' + - 'spec/requests/emancipations_request_spec.rb' + - 'spec/requests/mileage_rates_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterExampleGroup: + Exclude: + - 'spec/factories/login_activities.rb' + - 'spec/mailers/previews/volunteer_mailer_preview_spec.rb' + - 'spec/policies/casa_admin_policy_spec.rb' + - 'spec/policies/case_assignment_policy_spec.rb' + - 'spec/policies/other_duty_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/user_policy_spec.rb' + - 'spec/requests/users_spec.rb' + +# Offense count: 55 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterFinalLet: + Exclude: + - 'spec/controllers/concerns/users/time_zone_spec.rb' + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/helpers/mileage_rates_helper_spec.rb' + - 'spec/mailers/fund_request_mailer_spec.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/policies/casa_admin_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/volunteer_policy_spec.rb' + - 'spec/requests/all_casa_admins/casa_admins_spec.rb' + - 'spec/requests/all_casa_admins/sessions_spec.rb' + - 'spec/requests/api/v1/base_spec.rb' + - 'spec/requests/case_contact_reports_spec.rb' + - 'spec/requests/contact_topics_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/dashboard_spec.rb' + - 'spec/requests/learning_hours_spec.rb' + - 'spec/requests/mileage_rates_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/casa_case_change_service_spec.rb' + - 'spec/system/application/timeout_warning_spec.rb' + - 'spec/system/casa_admins/edit_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/devise/passwords/new_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + +# Offense count: 34 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterHook: + Exclude: + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/lib/tasks/supervisor_weekly_digest_spec.rb' + - 'spec/models/all_casa_admins/casa_org_metrics_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_court_report_context_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/policies/other_duty_policy_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/requests/preference_sets_spec.rb' + - 'spec/requests/supervisors_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/case_contacts_contact_dates_spec.rb' + - 'spec/support/shared_examples/shows_court_dates_links.rb' + - 'spec/system/application/timeout_warning_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/court_dates/new_spec.rb' + - 'spec/system/court_dates/view_spec.rb' + - 'spec/system/placements/destroy_spec.rb' + - 'spec/system/placements/edit_spec.rb' + - 'spec/system/placements/index_spec.rb' + - 'spec/system/placements/new_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterSubject: + Exclude: + - 'spec/datatables/reimbursement_datatable_spec.rb' + - 'spec/decorators/casa_case_decorator_spec.rb' + - 'spec/models/all_casa_admins/casa_org_metrics_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/models/learning_hour_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/contact_topic_policy_spec.rb' + - 'spec/requests/preference_sets_spec.rb' + - 'spec/services/additional_expense_params_service_spec.rb' + - 'spec/services/case_contacts_contact_dates_spec.rb' + - 'spec/services/emancipation_checklist_reminder_service_spec.rb' + - 'spec/services/mileage_export_csv_service_spec.rb' + +# Offense count: 9 +# Configuration parameters: Max, CountAsOne. +RSpec/ExampleLength: + Exclude: + - 'spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/mileage_report_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/other_duties_spec.rb' + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + - 'spec/views/supervisors/index.html.erb_spec.rb' + +# Offense count: 124 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples. +# DisallowedExamples: works +RSpec/ExampleWording: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/controllers/concerns/accessible_spec.rb' + - 'spec/controllers/concerns/organizational_spec.rb' + - 'spec/controllers/emancipations_controller_spec.rb' + - 'spec/datatables/reimbursement_datatable_spec.rb' + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/lib/tasks/case_contact_types_reminder_spec.rb' + - 'spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb' + - 'spec/lib/tasks/no_contact_made_reminder_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/emancipation_category_spec.rb' + - 'spec/models/followup_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/hearing_type_policy_spec.rb' + - 'spec/requests/all_casa_admins/casa_admins_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/requests/checklist_items_spec.rb' + - 'spec/requests/languages_spec.rb' + - 'spec/requests/supervisor_volunteers_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/services/court_report_due_sms_reminder_service_spec.rb' + - 'spec/services/emancipation_checklist_reminder_service_spec.rb' + - 'spec/services/no_contact_made_sms_reminder_service_spec.rb' + - 'spec/services/sms_reminder_service_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_groups/case_groups_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/supervisors/index_spec.rb' + - 'spec/views/casa_cases/new.html.erb_spec.rb' + - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' + - 'spec/views/reimbursements/index.html.erb_spec.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ExcessiveDocstringSpacing: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/mailers/casa_admin_mailer_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/contact_topic_spec.rb' + - 'spec/models/contact_type_spec.rb' + - 'spec/requests/casa_admins_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + +# Offense count: 7 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: method_call, block +RSpec/ExpectChange: + Exclude: + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/mileage_rates_spec.rb' + - 'spec/services/volunteer_birthday_reminder_service_spec.rb' + +# Offense count: 5 +RSpec/ExpectInHook: + Exclude: + - 'spec/policies/application_policy_spec.rb' + - 'spec/requests/all_casa_admins/casa_admins_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + +# Offense count: 1 +RSpec/ExpectInLet: + Exclude: + - 'spec/datatables/volunteer_datatable_spec.rb' + +# Offense count: 30 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, each, example +RSpec/HookArgument: + Exclude: + - 'spec/helpers/case_contacts_helper_spec.rb' + - 'spec/helpers/ui_helper_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/emancipation_category_spec.rb' + - 'spec/rails_helper.rb' + - 'spec/requests/all_casa_admins/patch_notes_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/services/court_report_due_sms_reminder_service_spec.rb' + - 'spec/services/no_contact_made_sms_reminder_service_spec.rb' + - 'spec/services/short_url_service_spec.rb' + - 'spec/services/sms_reminder_service_spec.rb' + - 'spec/support/rack_attack.rb' + - 'spec/system/supervisors/index_spec.rb' + - 'spec/views/all_casa_admins/patch_notes/index.html.erb_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. +RSpec/HooksBeforeExamples: + Exclude: + - 'spec/models/court_date_spec.rb' + +# Offense count: 14 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: is_expected, should +RSpec/ImplicitExpect: + Exclude: + - 'spec/models/address_spec.rb' + - 'spec/models/case_group_spec.rb' + - 'spec/models/checklist_item_spec.rb' + - 'spec/models/contact_topic_answer_spec.rb' + - 'spec/models/contact_topic_spec.rb' + - 'spec/models/hearing_type_spec.rb' + +# Offense count: 350 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: single_line_only, single_statement_only, disallow, require_implicit +RSpec/ImplicitSubject: + Exclude: + - 'spec/models/casa_case_spec.rb' + - 'spec/models/contact_type_spec.rb' + - 'spec/models/supervisor_spec.rb' + - 'spec/policies/additional_expense_policy_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/policies/bulk_court_date_policy_spec.rb' + - 'spec/policies/casa_admin_policy_spec.rb' + - 'spec/policies/casa_case_policy_spec.rb' + - 'spec/policies/casa_org_policy_spec.rb' + - 'spec/policies/case_assignment_policy_spec.rb' + - 'spec/policies/case_contact_policy_spec.rb' + - 'spec/policies/case_court_report_policy_spec.rb' + - 'spec/policies/checklist_item_policy_spec.rb' + - 'spec/policies/contact_topic_answer_policy_spec.rb' + - 'spec/policies/contact_topic_policy_spec.rb' + - 'spec/policies/contact_type_group_policy_spec.rb' + - 'spec/policies/contact_type_policy_spec.rb' + - 'spec/policies/dashboard_policy_spec.rb' + - 'spec/policies/followup_policy_spec.rb' + - 'spec/policies/hearing_type_policy_spec.rb' + - 'spec/policies/import_policy_spec.rb' + - 'spec/policies/judge_policy_spec.rb' + - 'spec/policies/language_policy_spec.rb' + - 'spec/policies/learning_hour_policy_spec.rb' + - 'spec/policies/notification_policy_spec.rb' + - 'spec/policies/other_duty_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/supervisor_volunteer_policy_spec.rb' + - 'spec/policies/user_policy_spec.rb' + - 'spec/policies/volunteer_policy_spec.rb' + +# Offense count: 156 +# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns. +RSpec/IndexedLet: + Exclude: + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/decorators/contact_type_decorator_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_assignment_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/contact_type_group_spec.rb' + - 'spec/models/contact_type_spec.rb' + - 'spec/models/hearing_type_spec.rb' + - 'spec/models/learning_hour_spec.rb' + - 'spec/models/learning_hour_topic_spec.rb' + - 'spec/models/learning_hour_type_spec.rb' + - 'spec/models/mileage_rate_spec.rb' + - 'spec/models/supervisor_volunteer_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/reimbursement_policy_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/requests/supervisor_volunteers_spec.rb' + - 'spec/services/case_contacts_contact_dates_spec.rb' + - 'spec/services/emancipation_checklist_reminder_service_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/reimbursements/reimbursements_spec.rb' + - 'spec/system/supervisors/index_spec.rb' + - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' + - 'spec/views/notifications/index.html.erb_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + +# Offense count: 69 +# Configuration parameters: AssignmentOnly. +RSpec/InstanceVariable: + Exclude: + - 'spec/components/modal/group_component_spec.rb' + - 'spec/components/sidebar/group_component_spec.rb' + - 'spec/controllers/application_controller_spec.rb' + - 'spec/helpers/case_contacts_helper_spec.rb' + - 'spec/helpers/ui_helper_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/system/casa_admins/edit_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: it_behaves_like, it_should_behave_like +RSpec/ItBehavesLike: + Exclude: + - 'spec/system/casa_admins/edit_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + +# Offense count: 59 +# This cop supports safe autocorrection (--autocorrect). +RSpec/LeadingSubject: + Exclude: + - 'spec/decorators/contact_type_decorator_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/followup_spec.rb' + - 'spec/models/supervisor_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/additional_expense_policy_spec.rb' + - 'spec/policies/bulk_court_date_policy_spec.rb' + - 'spec/policies/case_group_policy_spec.rb' + - 'spec/policies/contact_topic_answer_policy_spec.rb' + - 'spec/policies/patch_note_policy_spec.rb' + - 'spec/requests/additional_expenses_spec.rb' + - 'spec/requests/all_casa_admins/casa_orgs_spec.rb' + - 'spec/requests/all_casa_admins/dashboard_spec.rb' + - 'spec/requests/all_casa_admins/sessions_spec.rb' + - 'spec/requests/bulk_court_dates_spec.rb' + - 'spec/requests/casa_org_spec.rb' + - 'spec/requests/case_assignments_spec.rb' + - 'spec/requests/case_contacts/followups_spec.rb' + - 'spec/requests/case_contacts/form_spec.rb' + - 'spec/requests/case_contacts_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/case_groups_spec.rb' + - 'spec/requests/contact_topic_answers_spec.rb' + - 'spec/requests/emancipations_request_spec.rb' + - 'spec/requests/mileage_rates_spec.rb' + - 'spec/requests/supervisor_volunteers_spec.rb' + - 'spec/system/case_contacts/additional_expenses_spec.rb' + - 'spec/system/case_contacts/contact_topic_answers_spec.rb' + - 'spec/system/case_contacts/index_spec.rb' + - 'spec/system/case_contacts/new_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. +RSpec/LetBeforeExamples: + Exclude: + - 'spec/decorators/user_decorator_spec.rb' + +# Offense count: 145 +RSpec/LetSetup: + Exclude: + - 'spec/lib/importers/supervisor_importer_spec.rb' + - 'spec/lib/tasks/case_contact_types_reminder_spec.rb' + - 'spec/lib/tasks/no_contact_made_reminder_spec.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/models/casa_admin_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/models/language_spec.rb' + - 'spec/models/learning_hour_spec.rb' + - 'spec/models/missing_data_report_spec.rb' + - 'spec/models/patch_note_group_spec.rb' + - 'spec/models/patch_note_spec.rb' + - 'spec/models/patch_note_type_spec.rb' + - 'spec/models/placement_spec.rb' + - 'spec/models/placement_type_spec.rb' + - 'spec/models/supervisor_spec.rb' + - 'spec/models/user_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/notifications/reimbursement_complete_notifier_spec.rb' + - 'spec/requests/banners_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/requests/case_assignments_spec.rb' + - 'spec/requests/case_contact_reports_spec.rb' + - 'spec/requests/case_contacts/form_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/emancipation_checklists_spec.rb' + - 'spec/services/emancipation_checklist_reminder_service_spec.rb' + - 'spec/services/volunteer_birthday_reminder_service_spec.rb' + - 'spec/system/all_casa_admins/patch_notes/index_spec.rb' + - 'spec/system/banners/dismiss_spec.rb' + - 'spec/system/bulk_court_dates/new_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/emancipation/show_spec.rb' + - 'spec/system/casa_cases/new_spec.rb' + - 'spec/system/casa_cases/show_more_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_contacts/drafts_spec.rb' + - 'spec/system/case_contacts/followups/resolve_spec.rb' + - 'spec/system/case_contacts/index_spec.rb' + - 'spec/system/contact_types/edit_spec.rb' + - 'spec/system/contact_types/new_spec.rb' + - 'spec/system/court_dates/new_spec.rb' + - 'spec/system/court_dates/view_spec.rb' + - 'spec/system/emancipations/show_spec.rb' + - 'spec/system/learning_hours/index_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/sessions/new_spec.rb' + - 'spec/system/supervisors/index_spec.rb' + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + - 'spec/views/volunteers/index.html.erb_spec.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +RSpec/MatchArray: + Exclude: + - 'spec/models/casa_case_spec.rb' + - 'spec/models/emancipation_option_spec.rb' + - 'spec/models/user_spec.rb' + - 'spec/policies/hearing_type_policy_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/health_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/services/casa_case_change_service_spec.rb' + +# Offense count: 13 +RSpec/MessageChain: + Exclude: + - 'spec/models/casa_org_spec.rb' + - 'spec/requests/casa_admins_spec.rb' + - 'spec/requests/reimbursements_spec.rb' + - 'spec/views/layouts/header.html.erb_spec.rb' + +# Offense count: 34 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: have_received, receive +RSpec/MessageSpies: + Exclude: + - 'spec/decorators/casa_case_decorator_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/requests/all_casa_admins/casa_admins_spec.rb' + - 'spec/requests/all_casa_admins/casa_orgs_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/requests/case_contacts/followups_spec.rb' + - 'spec/requests/emancipations_request_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/services/backfill_followupable_service_spec.rb' + +# Offense count: 142 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: hash, symbol +RSpec/MetadataStyle: + Exclude: + - 'spec/policies/additional_expense_policy_spec.rb' + - 'spec/policies/case_contact_policy_spec.rb' + - 'spec/policies/contact_topic_answer_policy_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/support/capybara.rb' + - 'spec/system/all_casa_admins/patch_notes/index_spec.rb' + - 'spec/system/banners/dismiss_spec.rb' + - 'spec/system/banners/new_spec.rb' + - 'spec/system/bulk_court_dates/new_spec.rb' + - 'spec/system/casa_admins/edit_spec.rb' + - 'spec/system/casa_cases/additional_index_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/emancipation/show_spec.rb' + - 'spec/system/casa_cases/new_spec.rb' + - 'spec/system/casa_cases/show_more_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/casa_org/edit_spec.rb' + - 'spec/system/case_contacts/drafts_spec.rb' + - 'spec/system/case_contacts/followups/create_spec.rb' + - 'spec/system/case_contacts/followups/resolve_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/case_groups/case_groups_spec.rb' + - 'spec/system/components/truncated_text_component_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/court_dates/new_spec.rb' + - 'spec/system/court_dates/view_spec.rb' + - 'spec/system/dashboard/show_spec.rb' + - 'spec/system/emancipations/show_spec.rb' + - 'spec/system/imports/index_spec.rb' + - 'spec/system/learning_hours/index_spec.rb' + - 'spec/system/learning_hours/new_spec.rb' + - 'spec/system/learning_hours/volunteers/show_spec.rb' + - 'spec/system/mileage_rates/mileage_rates_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/placements/edit_spec.rb' + - 'spec/system/placements/new_spec.rb' + - 'spec/system/reimbursements/reimbursements_spec.rb' + - 'spec/system/reports/export_data_spec.rb' + - 'spec/system/reports/index_spec.rb' + - 'spec/system/static/index_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/system/supervisors/index_spec.rb' + - 'spec/system/users/edit_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/system/volunteers/index_spec.rb' + - 'spec/system/volunteers/new_spec.rb' + +# Offense count: 1 +RSpec/MissingExampleGroupArgument: + Exclude: + - 'spec/factories/login_activities.rb' + +# Offense count: 1 +RSpec/MissingExpectationTargetMethod: + Exclude: + - 'spec/lib/importers/file_importer_spec.rb' + +# Offense count: 1 +RSpec/MultipleDescribes: + Exclude: + - 'spec/views/templates/email_templates_spec.rb' + +# Offense count: 3 +# Configuration parameters: Max. +RSpec/MultipleExpectations: + Exclude: + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + +# Offense count: 18 +# Configuration parameters: AllowSubject, Max. +RSpec/MultipleMemoizedHelpers: + Exclude: + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/additional_expense_policy_spec.rb' + - 'spec/policies/contact_topic_answer_policy_spec.rb' + - 'spec/requests/case_contacts/form_spec.rb' + - 'spec/system/supervisors/index_spec.rb' + +# Offense count: 10 +# Configuration parameters: Max, AllowedGroups. +RSpec/NestedGroups: + Exclude: + - 'spec/models/case_contact_spec.rb' + +# Offense count: 11 +# Configuration parameters: AllowedPatterns. +# AllowedPatterns: ^expect_, ^assert_ +RSpec/NoExpectationExample: + Exclude: + - 'spec/components/sidebar/group_component_spec.rb' + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/system/casa_org/edit_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + +# Offense count: 24 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. +# SupportedStyles: inflected, explicit +RSpec/PredicateMatcher: + Exclude: + - 'spec/models/contact_type_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/system/case_contacts/followups/resolve_spec.rb' + +# Offense count: 89 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/ReceiveMessages: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/controllers/concerns/accessible_spec.rb' + - 'spec/controllers/emancipations_controller_spec.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/models/case_court_report_context_spec.rb' + - 'spec/views/all_casa_admins/casa_orgs/show.html.erb_spec.rb' + - 'spec/views/banners/new.html.erb_spec.rb' + - 'spec/views/casa_admins/edit.html.erb_spec.rb' + - 'spec/views/casa_cases/edit.html.erb_spec.rb' + - 'spec/views/casa_cases/new.html.erb_spec.rb' + - 'spec/views/casa_cases/show.html.erb_spec.rb' + - 'spec/views/court_dates/edit.html.erb_spec.rb' + - 'spec/views/court_dates/show.html.erb_spec.rb' + - 'spec/views/layouts/header.html.erb_spec.rb' + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + - 'spec/views/placements/edit.html.erb_spec.rb' + - 'spec/views/supervisors/edit.html.erb_spec.rb' + - 'spec/views/volunteers/edit.html.erb_spec.rb' + - 'spec/views/volunteers/index.html.erb_spec.rb' + +# Offense count: 75 +RSpec/RepeatedDescription: + Exclude: + - 'spec/decorators/user_decorator_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/policies/case_contact_policy_spec.rb' + - 'spec/policies/case_group_policy_spec.rb' + - 'spec/policies/dashboard_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/supervisor_volunteer_policy_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/system/sessions/new_spec.rb' + +# Offense count: 52 +RSpec/RepeatedExample: + Exclude: + - 'spec/helpers/sidebar_helper_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/policies/case_contact_policy_spec.rb' + - 'spec/policies/court_date_policy_spec.rb' + - 'spec/policies/dashboard_policy_spec.rb' + - 'spec/policies/placement_policy_spec.rb' + - 'spec/policies/reimbursement_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/supervisor_volunteer_policy_spec.rb' + - 'spec/services/deployment/backfill_case_contact_started_metadata_service_spec.rb' + - 'spec/views/volunteers/edit.html.erb_spec.rb' + +# Offense count: 2 +RSpec/RepeatedExampleGroupBody: + Exclude: + - 'spec/controllers/concerns/organizational_spec.rb' + +# Offense count: 8 +RSpec/RepeatedExampleGroupDescription: + Exclude: + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/controllers/concerns/organizational_spec.rb' + - 'spec/decorators/casa_case_decorator_spec.rb' + - 'spec/models/case_court_report_context_spec.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect. +RSpec/ScatteredLet: + Exclude: + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/learning_hour_spec.rb' + +# Offense count: 14 +# This cop supports safe autocorrection (--autocorrect). +RSpec/SortMetadata: + Exclude: + - 'spec/policies/additional_expense_policy_spec.rb' + - 'spec/policies/contact_topic_answer_policy_spec.rb' + - 'spec/support/capybara.rb' + - 'spec/system/banners/dismiss_spec.rb' + - 'spec/system/banners/new_spec.rb' + - 'spec/system/case_contacts/followups/create_spec.rb' + - 'spec/system/case_contacts/followups/resolve_spec.rb' + - 'spec/system/case_groups/case_groups_spec.rb' + - 'spec/system/learning_hours/new_spec.rb' + - 'spec/system/mileage_rates/mileage_rates_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/reports/index_spec.rb' + - 'spec/system/volunteers/index_spec.rb' + +# Offense count: 10 +# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata. +# Include: **/*_spec.rb +RSpec/SpecFilePathFormat: + Exclude: + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/controllers/concerns/accessible_spec.rb' + - 'spec/controllers/concerns/organizational_spec.rb' + - 'spec/controllers/concerns/users/time_zone_spec.rb' + - 'spec/decorators/placement_decorator_spec.rb' + - 'spec/helpers/court_orders_helper_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/languages_spec.rb' + - 'spec/requests/missing_data_reports_spec.rb' + - 'spec/requests/reimbursements_spec.rb' + +# Offense count: 1 +# Configuration parameters: Include. +# Include: **/*_spec*rb*, **/spec/**/* +RSpec/SpecFilePathSuffix: + Exclude: + - 'spec/models/user_reminder_time.rb' + +# Offense count: 9 +RSpec/StubbedMock: + Exclude: + - 'spec/decorators/casa_case_decorator_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/emancipations_request_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + +# Offense count: 2 +RSpec/SubjectDeclaration: + Exclude: + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/mailers/previews/devise_mailer_preview_spec.rb' + +# Offense count: 1 +RSpec/SubjectStub: + Exclude: + - 'spec/lib/importers/case_importer_spec.rb' + +# Offense count: 26 +# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. +RSpec/VerifiedDoubles: + Exclude: + - 'spec/components/form/hour_minute_duration_component_spec.rb' + - 'spec/decorators/casa_case_decorator_spec.rb' + - 'spec/helpers/banner_helper_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/requests/all_casa_admins/casa_admins_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/requests/case_contacts/followups_spec.rb' + - 'spec/requests/emancipations_request_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/reimbursements_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/followup_service_spec.rb' + +# Offense count: 6 +RSpec/VoidExpect: + Exclude: + - 'spec/system/supervisors/index_spec.rb' + +# Offense count: 11 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: ResponseMethods. +# ResponseMethods: response, last_response +RSpecRails/HaveHttpStatus: + Exclude: + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/requests/languages_spec.rb' + - 'spec/requests/users_spec.rb' + +# Offense count: 250 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Inferences. +RSpecRails/InferredSpecType: + Exclude: + - 'spec/controllers/application_controller_spec.rb' + - 'spec/controllers/concerns/accessible_spec.rb' + - 'spec/controllers/concerns/organizational_spec.rb' + - 'spec/controllers/concerns/users/time_zone_spec.rb' + - 'spec/controllers/emancipations_controller_spec.rb' + - 'spec/helpers/application_helper_spec.rb' + - 'spec/helpers/emancipations_helper_spec.rb' + - 'spec/helpers/learning_hours_helper_spec.rb' + - 'spec/helpers/preference_sets_helper_spec.rb' + - 'spec/helpers/volunteer_helper_spec.rb' + - 'spec/mailers/casa_admin_mailer_spec.rb' + - 'spec/mailers/fund_request_mailer_spec.rb' + - 'spec/mailers/learning_hours_mailer_spec.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/mailers/user_mailer_spec.rb' + - 'spec/mailers/volunteer_mailer_spec.rb' + - 'spec/models/additional_expense_spec.rb' + - 'spec/models/address_spec.rb' + - 'spec/models/all_casa_admin_spec.rb' + - 'spec/models/all_casa_admins/casa_org_metrics_spec.rb' + - 'spec/models/banner_spec.rb' + - 'spec/models/casa_admin_spec.rb' + - 'spec/models/casa_case_contact_type_spec.rb' + - 'spec/models/casa_case_emancipation_category_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/casa_cases_emancipation_option_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/case_assignment_spec.rb' + - 'spec/models/case_contact_contact_type_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/case_court_order_spec.rb' + - 'spec/models/case_court_report_context_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/case_group_membership_spec.rb' + - 'spec/models/case_group_spec.rb' + - 'spec/models/checklist_item_spec.rb' + - 'spec/models/contact_topic_answer_spec.rb' + - 'spec/models/contact_topic_spec.rb' + - 'spec/models/contact_type_group_spec.rb' + - 'spec/models/contact_type_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/models/emancipation_category_spec.rb' + - 'spec/models/emancipation_option_spec.rb' + - 'spec/models/followup_spec.rb' + - 'spec/models/health_spec.rb' + - 'spec/models/hearing_type_spec.rb' + - 'spec/models/judge_spec.rb' + - 'spec/models/language_spec.rb' + - 'spec/models/learning_hour_spec.rb' + - 'spec/models/learning_hour_topic_spec.rb' + - 'spec/models/learning_hour_type_spec.rb' + - 'spec/models/learning_hours_report_spec.rb' + - 'spec/models/login_activity_spec.rb' + - 'spec/models/mileage_rate_spec.rb' + - 'spec/models/mileage_report_spec.rb' + - 'spec/models/missing_data_report_spec.rb' + - 'spec/models/note_spec.rb' + - 'spec/models/other_duty_spec.rb' + - 'spec/models/patch_note_group_spec.rb' + - 'spec/models/patch_note_spec.rb' + - 'spec/models/patch_note_type_spec.rb' + - 'spec/models/placement_spec.rb' + - 'spec/models/placement_type_spec.rb' + - 'spec/models/preference_set_spec.rb' + - 'spec/models/sent_email_spec.rb' + - 'spec/models/sms_notification_event_spec.rb' + - 'spec/models/supervisor_spec.rb' + - 'spec/models/user_language_spec.rb' + - 'spec/models/user_reminder_time.rb' + - 'spec/models/user_sms_notification_event_spec.rb' + - 'spec/models/user_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/requests/additional_expenses_spec.rb' + - 'spec/requests/all_casa_admins/casa_orgs_spec.rb' + - 'spec/requests/all_casa_admins/dashboard_spec.rb' + - 'spec/requests/all_casa_admins/patch_notes_spec.rb' + - 'spec/requests/all_casa_admins/sessions_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/requests/android_app_associations_spec.rb' + - 'spec/requests/api/v1/base_spec.rb' + - 'spec/requests/api/v1/users/sessions_spec.rb' + - 'spec/requests/banners_spec.rb' + - 'spec/requests/bulk_court_dates_spec.rb' + - 'spec/requests/casa_admins_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/requests/casa_org_spec.rb' + - 'spec/requests/case_assignments_spec.rb' + - 'spec/requests/case_contact_reports_spec.rb' + - 'spec/requests/case_contacts/followups_spec.rb' + - 'spec/requests/case_contacts/form_spec.rb' + - 'spec/requests/case_contacts_spec.rb' + - 'spec/requests/case_court_orders_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/case_groups_spec.rb' + - 'spec/requests/checklist_items_spec.rb' + - 'spec/requests/contact_topic_answers_spec.rb' + - 'spec/requests/contact_topics_spec.rb' + - 'spec/requests/contact_type_groups_spec.rb' + - 'spec/requests/contact_types_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/dashboard_spec.rb' + - 'spec/requests/emancipation_checklists_spec.rb' + - 'spec/requests/emancipations_request_spec.rb' + - 'spec/requests/error_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/health_spec.rb' + - 'spec/requests/hearing_types_spec.rb' + - 'spec/requests/imports_spec.rb' + - 'spec/requests/judges_spec.rb' + - 'spec/requests/languages_spec.rb' + - 'spec/requests/learning_hours_reports_spec.rb' + - 'spec/requests/learning_hours_spec.rb' + - 'spec/requests/mileage_rates_spec.rb' + - 'spec/requests/missing_data_reports_spec.rb' + - 'spec/requests/notes_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/requests/other_duties_spec.rb' + - 'spec/requests/placement_reports_spec.rb' + - 'spec/requests/preference_sets_spec.rb' + - 'spec/requests/reimbursements_spec.rb' + - 'spec/requests/reports_spec.rb' + - 'spec/requests/static_spec.rb' + - 'spec/requests/supervisor_volunteers_spec.rb' + - 'spec/requests/supervisors_spec.rb' + - 'spec/requests/users/passwords_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/routing/all_casa_admins/patch_notes_routing_spec.rb' + - 'spec/system/all_casa_admins/all_casa_admin_spec.rb' + - 'spec/system/all_casa_admins/patch_notes/index_spec.rb' + - 'spec/system/all_casa_admins/sessions/new_spec.rb' + - 'spec/system/application/timeout_warning_spec.rb' + - 'spec/system/banners/dismiss_spec.rb' + - 'spec/system/banners/new_spec.rb' + - 'spec/system/bulk_court_dates/new_spec.rb' + - 'spec/system/casa_admins/edit_spec.rb' + - 'spec/system/casa_admins/index_spec.rb' + - 'spec/system/casa_admins/new_spec.rb' + - 'spec/system/casa_cases/additional_index_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/emancipation/show_spec.rb' + - 'spec/system/casa_cases/fund_requests/new_spec.rb' + - 'spec/system/casa_cases/index_spec.rb' + - 'spec/system/casa_cases/new_spec.rb' + - 'spec/system/casa_cases/show_more_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/casa_org/edit_spec.rb' + - 'spec/system/case_contacts/additional_expenses_spec.rb' + - 'spec/system/case_contacts/contact_topic_answers_spec.rb' + - 'spec/system/case_contacts/drafts_spec.rb' + - 'spec/system/case_contacts/edit_spec.rb' + - 'spec/system/case_contacts/followups/create_spec.rb' + - 'spec/system/case_contacts/followups/resolve_spec.rb' + - 'spec/system/case_contacts/index_spec.rb' + - 'spec/system/case_contacts/new_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/case_groups/case_groups_spec.rb' + - 'spec/system/checklist_items/destroy_spec.rb' + - 'spec/system/checklist_items/edit_spec.rb' + - 'spec/system/checklist_items/new_spec.rb' + - 'spec/system/components/truncated_text_component_spec.rb' + - 'spec/system/contact_types/edit_spec.rb' + - 'spec/system/contact_types/new_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/court_dates/new_spec.rb' + - 'spec/system/court_dates/view_spec.rb' + - 'spec/system/dashboard/show_spec.rb' + - 'spec/system/deep_link/deep_link_spec.rb' + - 'spec/system/devise/passwords/new_spec.rb' + - 'spec/system/emancipations/show_spec.rb' + - 'spec/system/hearing_types/new_spec.rb' + - 'spec/system/imports/index_spec.rb' + - 'spec/system/judges/new_spec.rb' + - 'spec/system/languages/languages_spec.rb' + - 'spec/system/learning_hours/edit_spec.rb' + - 'spec/system/learning_hours/index_spec.rb' + - 'spec/system/learning_hours/new_spec.rb' + - 'spec/system/learning_hours/volunteers/show_spec.rb' + - 'spec/system/mileage_rates/mileage_rates_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/placements/destroy_spec.rb' + - 'spec/system/placements/edit_spec.rb' + - 'spec/system/placements/index_spec.rb' + - 'spec/system/placements/new_spec.rb' + - 'spec/system/reimbursements/reimbursements_spec.rb' + - 'spec/system/reports/export_data_spec.rb' + - 'spec/system/reports/index_spec.rb' + - 'spec/system/sessions/destroy_spec.rb' + - 'spec/system/sessions/login_spec.rb' + - 'spec/system/sessions/new_spec.rb' + - 'spec/system/static/index_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/system/supervisors/index_spec.rb' + - 'spec/system/supervisors/new_spec.rb' + - 'spec/system/users/edit_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/system/volunteers/index_spec.rb' + - 'spec/system/volunteers/new_spec.rb' + - 'spec/system/volunteers/notes/edit_spec.rb' + - 'spec/views/all_casa_admins/casa_orgs/new.html.erb_spec.rb' + - 'spec/views/all_casa_admins/casa_orgs/show.html.erb_spec.rb' + - 'spec/views/all_casa_admins/patch_notes/index.html.erb_spec.rb' + - 'spec/views/banners/new.html.erb_spec.rb' + - 'spec/views/bulk_court_date/new.html.erb_spec.rb' + - 'spec/views/casa_admins/admins_table.html.erb_spec.rb' + - 'spec/views/casa_admins/edit.html.erb_spec.rb' + - 'spec/views/casa_cases/edit.html.erb_spec.rb' + - 'spec/views/casa_cases/index.html.erb_spec.rb' + - 'spec/views/casa_cases/new.html.erb_spec.rb' + - 'spec/views/casa_cases/show.html.erb_spec.rb' + - 'spec/views/casa_orgs/edit.html.erb_spec.rb' + - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' + - 'spec/views/case_contacts/index.html.erb_spec.rb' + - 'spec/views/case_court_reports/index.html.erb_spec.rb' + - 'spec/views/checklist_items/edit.html.erb_spec.rb' + - 'spec/views/checklist_items/new.html.erb_spec.rb' + - 'spec/views/court_dates/edit.html.erb_spec.rb' + - 'spec/views/court_dates/new.html.erb_spec.rb' + - 'spec/views/court_dates/show.html.erb_spec.rb' + - 'spec/views/devise/passwords/new.html.erb_spec.rb' + - 'spec/views/emancipations/show.html.erb_spec.rb' + - 'spec/views/hearing_types/edit.html.erb_spec.rb' + - 'spec/views/hearing_types/new.html.erb_spec.rb' + - 'spec/views/judges/new.html.erb_spec.rb' + - 'spec/views/layouts/application.html.erb_spec.rb' + - 'spec/views/layouts/footer.html.erb_spec.rb' + - 'spec/views/layouts/header.html.erb_spec.rb' + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + - 'spec/views/mileage_rates/index.html.erb_spec.rb' + - 'spec/views/notifications/index.html.erb_spec.rb' + - 'spec/views/other_duties/edit.html.erb_spec.rb' + - 'spec/views/other_duties/new.html.erb_spec.rb' + - 'spec/views/placements/edit.html.erb_spec.rb' + - 'spec/views/placements/index.html.erb_spec.rb' + - 'spec/views/placements/new.html.erb_spec.rb' + - 'spec/views/reimbursements/index.html.erb_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + - 'spec/views/supervisors/edit.html.erb_spec.rb' + - 'spec/views/supervisors/index.html.erb_spec.rb' + - 'spec/views/supervisors/new.html.erb_spec.rb' + - 'spec/views/templates/email_templates_spec.rb' + - 'spec/views/volunteers/edit.html.erb_spec.rb' + - 'spec/views/volunteers/index.html.erb_spec.rb' + - 'spec/views/volunteers/new.html.erb_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +RSpecRails/MinitestAssertions: + Exclude: + - 'spec/models/casa_case_spec.rb' + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect, EnforcedStyle. +# SupportedStyles: not_to, be_invalid +RSpecRails/NegationBeValid: + Exclude: + - 'spec/models/additional_expense_spec.rb' + - 'spec/models/case_assignment_spec.rb' + - 'spec/models/followup_spec.rb' diff --git a/Gemfile b/Gemfile index 208ede0730..1c5aa6f232 100644 --- a/Gemfile +++ b/Gemfile @@ -76,6 +76,8 @@ group :development, :test do gem "erb_lint", require: false gem "rubocop", require: false gem "rubocop-performance", require: false + gem "rubocop-rspec", require: false + gem "rubocop-rspec_rails", require: false gem "standard", require: false end diff --git a/Gemfile.lock b/Gemfile.lock index c1ac0cd14f..d742d278b8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -473,6 +473,11 @@ GEM rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (3.1.0) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) ruby-vips (2.2.2) ffi (~> 1.12) @@ -650,6 +655,8 @@ DEPENDENCIES rswag-ui rubocop rubocop-performance + rubocop-rspec + rubocop-rspec_rails sablon scout_apm selenium-webdriver diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fd672a2981..b35c581814 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -45,5 +45,9 @@ # --seed 1234 config.order = :random + config.define_derived_metadata do |meta| + meta[:aggregate_failures] = true + end + RSpec::Matchers.define_negated_matcher :not_change, :change end From 7355c993a448c7774ff223f68ab9a7a0ace612ad Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Mon, 21 Oct 2024 23:22:42 -0400 Subject: [PATCH 03/22] add rubocop-rails / standard-rails --- .rubocop.yml | 35 +++++ .rubocop_todo.yml | 334 +++++++++++++++++++++++++++++++++++++++++++++- Gemfile | 2 + Gemfile.lock | 10 ++ 4 files changed, 380 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index f5f23b0f0b..02f7becc79 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,6 +7,7 @@ require: - standard-custom - standard-performance - rubocop-performance + - rubocop-rails - rubocop-rspec - rubocop-rspec_rails @@ -14,6 +15,7 @@ inherit_gem: standard: config/ruby-3.2.yml standard-performance: config/base.yml standard-custom: config/base.yml + standard-rails: config/base.yml inherit_from: - .rubocop_todo.yml @@ -22,6 +24,7 @@ AllCops: NewCops: enable SuggestExtensions: false TargetRubyVersion: 3.2 + TargetRailsVersion: 7.2 Exclude: - 'bin/**/*' # todo? - 'db/migrate/2020*.rb' @@ -39,10 +42,39 @@ AllCops: Lint/Debugger: # don't leave binding.pry or debugger Enabled: true Exclude: [] + +Rails/Output: # Don't leave puts-debugging + Enabled: true + Exclude: [] + +Rails/FindEach: # each could severely affect the performance, use find_each + Enabled: true + Exclude: [] + +Rails/UniqBeforePluck: # uniq.pluck and not pluck.uniq + Enabled: true + Exclude: [] + RSpec/Focus: # run ALL tests on CI Enabled: true Exclude: [] +# RAILS +Rails/DefaultScope: + Enabled: true + Details: >- + Default scopes lead to unexpected behavior for future devs, use named scopes where needed. +Rails/OrderById: + Enabled: true + Details: >- + No guaranteed order by id, use timestamps (created_at/updated_at) or no order at all. +Rails/SaveBang: + Enabled: true + Include: + - 'spec/**/*' # TODO: enable everywhere? + Details: >- + Specs should fail if saved/updated record is invalid. + # RSPEC RSpec/ExampleLength: CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] @@ -74,3 +106,6 @@ RSpec/NestedGroups: RSpec/NotToNot: Enabled: false # consistency only, no difference in to_not/not_to +# TODO: I thought this was causing flaky specs but rubocop-rails says I'm wrong +Rails/RedundantTravelBack: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ec977d84c6..c8f75131ec 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-22 03:06:34 UTC using RuboCop version 1.65.1. +# on 2024-10-22 03:17:39 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -1319,3 +1319,335 @@ RSpecRails/NegationBeValid: - 'spec/models/additional_expense_spec.rb' - 'spec/models/case_assignment_spec.rb' - 'spec/models/followup_spec.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ActiveRecordAliases: + Exclude: + - 'lib/tasks/case_contact_types_reminder.rb' + - 'lib/tasks/no_contact_made_reminder.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/ActiveRecordCallbacksOrder: + Exclude: + - 'app/models/casa_org.rb' + - 'app/models/user.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ApplicationMailer: + Exclude: + - 'lib/mailers/debug_preview_mailer.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ApplicationRecord: + Exclude: + - 'lib/tasks/deployment/20240604121427_migrate_notifications.rake' + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. +Rails/Blank: + Exclude: + - 'app/helpers/phone_number_helper.rb' + - 'app/services/fdf_inputs_service.rb' + - 'app/validators/user_validator.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/CompactBlank: + Exclude: + - 'app/datatables/volunteer_datatable.rb' + +# Offense count: 71 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowToTime. +# SupportedStyles: strict, flexible +Rails/Date: + Exclude: + - 'app/decorators/casa_case_decorator.rb' + - 'app/decorators/case_assignment_decorator.rb' + - 'app/mailers/fund_request_mailer.rb' + - 'app/mailers/learning_hours_mailer.rb' + - 'app/mailers/supervisor_mailer.rb' + - 'app/models/casa_case.rb' + - 'app/models/learning_hour.rb' + - 'app/models/user.rb' + - 'db/seeds/db_populator.rb' + - 'lib/mailers/previews/devise_mailer_preview.rb' + - 'lib/mailers/previews/fund_request_mailer_preview.rb' + - 'lib/mailers/previews/volunteer_mailer_preview.rb' + - 'spec/mailers/learning_hours_mailer_spec.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/requests/bulk_court_dates_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/requests/case_contact_reports_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/new_spec.rb' + - 'spec/system/case_contacts/new_spec.rb' + - 'spec/system/learning_hours/edit_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/reports/index_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + +# Offense count: 4 +Rails/DefaultScope: + Exclude: + - 'app/models/casa_admin.rb' + - 'app/models/hearing_type.rb' + - 'app/models/judge.rb' + - 'app/models/learning_hour_type.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +Rails/DurationArithmetic: + Exclude: + - 'app/models/user.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/views/reimbursements/index.html.erb_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + +# Offense count: 56 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: slashes, arguments +Rails/FilePath: + Exclude: + - 'app/models/casa_org.rb' + - 'app/models/contact_topic.rb' + - 'config/application.rb' + - 'db/seeds.rb' + - 'lib/tasks/test_checker.rake' + - 'spec/factories/casa_orgs.rb' + - 'spec/factories/case_court_report_context.rb' + - 'spec/lib/importers/case_importer_spec.rb' + - 'spec/lib/importers/file_importer_spec.rb' + - 'spec/lib/importers/supervisor_importer_spec.rb' + - 'spec/lib/importers/volunteer_importer_spec.rb' + - 'spec/mailers/previews/casa_admin_mailer_preview_spec.rb' + - 'spec/mailers/previews/devise_mailer_preview_spec.rb' + - 'spec/mailers/previews/supervisor_mailer_preview_spec.rb' + - 'spec/mailers/previews/volunteer_mailer_preview_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/case_court_report_context_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/rails_helper.rb' + - 'spec/requests/casa_org_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/imports_spec.rb' + - 'spec/system/imports/index_spec.rb' + - 'spec/views/casa_orgs/edit.html.erb_spec.rb' + +# Offense count: 6 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods, AllowedPatterns. +# AllowedMethods: order, limit, select, lock +Rails/FindEach: + Exclude: + - 'app/models/case_contact.rb' + - 'db/seeds/db_populator.rb' + - 'lib/tasks/data_post_processors/contact_topic_populator.rb' + - 'lib/tasks/data_post_processors/contact_type_populator.rb' + - 'spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb' + - 'spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/IgnoredColumnsAssignment: + Exclude: + - 'app/models/casa_case.rb' + - 'app/models/mileage_rate.rb' + +# Offense count: 5 +# Configuration parameters: Include. +# Include: app/controllers/**/*.rb, app/mailers/**/*.rb +Rails/LexicallyScopedActionFilter: + Exclude: + - 'app/controllers/all_casa_admins/sessions_controller.rb' + - 'app/controllers/api/v1/base_controller.rb' + - 'app/controllers/case_contacts_controller.rb' + - 'app/controllers/placements_controller.rb' + - 'app/controllers/users/sessions_controller.rb' + +# Offense count: 8 +Rails/OrderById: + Exclude: + - 'app/datatables/volunteer_datatable.rb' + - 'app/models/learning_hours_report.rb' + - 'app/services/case_contacts_export_csv_service.rb' + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/models/casa_case_spec.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Include. +# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb +Rails/Output: + Exclude: + - 'app/services/volunteer_birthday_reminder_service.rb' + - 'db/seeds.rb' + +# Offense count: 16 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/Pluck: + Exclude: + - 'app/services/casa_case_change_service.rb' + - 'spec/datatables/supervisor_datatable_spec.rb' + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/contact_topic_spec.rb' + - 'spec/requests/all_casa_admins/casa_orgs_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: conservative, aggressive +Rails/PluckInWhere: + Exclude: + - 'app/models/casa_case.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Rails/Presence: + Exclude: + - 'app/controllers/case_contacts/form_controller.rb' + - 'app/models/case_court_report_context.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Rails/RedundantForeignKey: + Exclude: + - 'app/models/note.rb' + - 'app/models/other_duty.rb' + - 'app/models/supervisor.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/RedundantPresenceValidationOnBelongsTo: + Exclude: + - 'app/models/case_assignment.rb' + +# Offense count: 9 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/RootPathnameMethods: + Exclude: + - 'app/services/fdf_inputs_service.rb' + - 'lib/tasks/test_checker.rake' + - 'spec/mailers/previews/casa_admin_mailer_preview_spec.rb' + - 'spec/mailers/previews/devise_mailer_preview_spec.rb' + - 'spec/mailers/previews/supervisor_mailer_preview_spec.rb' + - 'spec/mailers/previews/volunteer_mailer_preview_spec.rb' + - 'spec/rails_helper.rb' + - 'spec/views/templates/email_templates_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Rails/RootPublicPath: + Exclude: + - 'app/models/casa_org.rb' + +# Offense count: 95 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowImplicitReturn, AllowedReceivers. +Rails/SaveBang: + Exclude: + - 'spec/decorators/case_contact_decorator_spec.rb' + - 'spec/decorators/user_decorator_spec.rb' + - 'spec/factories/casa_cases.rb' + - 'spec/factories/court_dates.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/models/additional_expense_spec.rb' + - 'spec/models/casa_admin_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/case_assignment_spec.rb' + - 'spec/models/contact_type_spec.rb' + - 'spec/models/supervisor_volunteer_spec.rb' + - 'spec/models/user_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/case_assignment_policy_spec.rb' + - 'spec/requests/casa_org_spec.rb' + - 'spec/requests/hearing_types_spec.rb' + - 'spec/requests/learning_hours_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/services/preference_set_table_state_service_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/users/edit_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/views/all_casa_admins/patch_notes/index.html.erb_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + +# Offense count: 39 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: strict, flexible +Rails/TimeZone: + Exclude: + - 'app/controllers/casa_cases_controller.rb' + - 'app/controllers/checklist_items_controller.rb' + - 'app/controllers/court_dates_controller.rb' + - 'app/controllers/reimbursements_controller.rb' + - 'app/helpers/banner_helper.rb' + - 'app/models/concerns/CasaCase/validations.rb' + - 'db/seeds/db_populator.rb' + - 'lib/tasks/deployment/99991023145114_store_deploy_time.rake' + - 'lib/tasks/supervisor_weekly_digest.rb' + - 'spec/datatables/reimbursement_datatable_spec.rb' + - 'spec/decorators/casa_case_decorator_spec.rb' + - 'spec/decorators/user_decorator_spec.rb' + - 'spec/factories/healths.rb' + - 'spec/factories/users.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/requests/casa_cases_spec.rb' + - 'spec/system/checklist_items/destroy_spec.rb' + - 'spec/system/checklist_items/edit_spec.rb' + - 'spec/system/checklist_items/new_spec.rb' + +# Offense count: 14 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/UniqueValidationWithoutIndex: + Exclude: + - 'app/models/casa_case_contact_type.rb' + - 'app/models/casa_case_emancipation_category.rb' + - 'app/models/casa_org.rb' + - 'app/models/case_assignment.rb' + - 'app/models/case_contact_contact_type.rb' + - 'app/models/case_group.rb' + - 'app/models/contact_type.rb' + - 'app/models/contact_type_group.rb' + - 'app/models/hearing_type.rb' + - 'app/models/judge.rb' + - 'app/models/language.rb' + - 'app/models/learning_hour_topic.rb' + - 'app/models/learning_hour_type.rb' + - 'app/models/supervisor_volunteer.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/Validation: + Exclude: + - 'app/models/banner.rb' + - 'app/models/case_group.rb' + - 'app/models/concerns/CasaCase/validations.rb' + - 'app/models/health.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/WhereEquals: + Exclude: + - 'app/models/volunteer.rb' diff --git a/Gemfile b/Gemfile index 1c5aa6f232..cc5a640be7 100644 --- a/Gemfile +++ b/Gemfile @@ -76,9 +76,11 @@ group :development, :test do gem "erb_lint", require: false gem "rubocop", require: false gem "rubocop-performance", require: false + gem "rubocop-rails", require: false gem "rubocop-rspec", require: false gem "rubocop-rspec_rails", require: false gem "standard", require: false + gem "standard-rails", require: false end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index d742d278b8..a90e83bfdf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -473,6 +473,11 @@ GEM rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.26.2) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.52.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rspec (3.1.0) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) @@ -531,6 +536,9 @@ GEM standard-performance (1.4.0) lint_roller (~> 1.1) rubocop-performance (~> 1.21.0) + standard-rails (1.2.0) + lint_roller (~> 1.0) + rubocop-rails (~> 2.26.0) stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.1) @@ -655,6 +663,7 @@ DEPENDENCIES rswag-ui rubocop rubocop-performance + rubocop-rails rubocop-rspec rubocop-rspec_rails sablon @@ -666,6 +675,7 @@ DEPENDENCIES spring-commands-rspec sprockets-rails standard + standard-rails stimulus-rails strong_migrations traceroute From e89e600500a10fd377f789f018073bdefdcc39e2 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Mon, 21 Oct 2024 23:28:51 -0400 Subject: [PATCH 04/22] add rubocop-capybara --- .rubocop.yml | 1 + .rubocop_todo.yml | 171 +++++++++++++++++++++++++++++++++++++++++++++- Gemfile | 1 + Gemfile.lock | 3 + 4 files changed, 175 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 02f7becc79..4c56931f69 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,6 +6,7 @@ require: - standard - standard-custom - standard-performance + - rubocop-capybara - rubocop-performance - rubocop-rails - rubocop-rspec diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c8f75131ec..7c2e8230b7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,180 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-22 03:17:39 UTC using RuboCop version 1.65.1. +# on 2024-10-22 03:27:52 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. +# Offense count: 50 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: link_or_button, strict +Capybara/ClickLinkOrButtonStyle: + Exclude: + - 'spec/system/all_casa_admins/all_casa_admin_spec.rb' + - 'spec/system/casa_admins/new_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_contacts/followups/create_spec.rb' + - 'spec/system/case_contacts/followups/resolve_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/court_dates/new_spec.rb' + - 'spec/system/imports/index_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/placements/edit_spec.rb' + - 'spec/system/placements/new_spec.rb' + - 'spec/system/reports/export_data_spec.rb' + +# Offense count: 14 +# This cop supports safe autocorrection (--autocorrect). +Capybara/CurrentPathExpectation: + Exclude: + - 'spec/system/all_casa_admins/all_casa_admin_spec.rb' + - 'spec/system/deep_link/deep_link_spec.rb' + - 'spec/system/reports/export_data_spec.rb' + - 'spec/system/sessions/destroy_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/system/volunteers/notes/edit_spec.rb' + +# Offense count: 216 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: have_no, not_to +Capybara/NegationMatcher: + Exclude: + - 'spec/components/badge_component_spec.rb' + - 'spec/components/dropdown_menu_component_spec.rb' + - 'spec/components/modal/body_component_spec.rb' + - 'spec/components/modal/footer_component_spec.rb' + - 'spec/components/modal/group_component_spec.rb' + - 'spec/components/modal/header_component_spec.rb' + - 'spec/components/modal/open_button_component_spec.rb' + - 'spec/components/modal/open_link_component_spec.rb' + - 'spec/components/notification_component_spec.rb' + - 'spec/components/sidebar/group_component_spec.rb' + - 'spec/components/sidebar/link_component_spec.rb' + - 'spec/components/truncated_text_component_spec.rb' + - 'spec/system/all_casa_admins/sessions/new_spec.rb' + - 'spec/system/banners/dismiss_spec.rb' + - 'spec/system/banners/new_spec.rb' + - 'spec/system/casa_admins/edit_spec.rb' + - 'spec/system/casa_cases/additional_index_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/new_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_contacts/drafts_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/case_groups/case_groups_spec.rb' + - 'spec/system/checklist_items/destroy_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/dashboard/show_spec.rb' + - 'spec/system/devise/passwords/new_spec.rb' + - 'spec/system/emancipations/show_spec.rb' + - 'spec/system/notifications/index_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/placements/destroy_spec.rb' + - 'spec/system/reports/index_spec.rb' + - 'spec/system/sessions/new_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/system/users/edit_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/system/volunteers/new_spec.rb' + - 'spec/views/banners/new.html.erb_spec.rb' + - 'spec/views/casa_admins/edit.html.erb_spec.rb' + - 'spec/views/casa_cases/edit.html.erb_spec.rb' + - 'spec/views/casa_cases/index.html.erb_spec.rb' + - 'spec/views/casa_cases/show.html.erb_spec.rb' + - 'spec/views/casa_orgs/edit.html.erb_spec.rb' + - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' + - 'spec/views/layouts/header.html.erb_spec.rb' + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + - 'spec/views/reimbursements/index.html.erb_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + - 'spec/views/supervisors/edit.html.erb_spec.rb' + - 'spec/views/supervisors/index.html.erb_spec.rb' + - 'spec/views/volunteers/edit.html.erb_spec.rb' + - 'spec/views/volunteers/index.html.erb_spec.rb' + +# Offense count: 110 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: DefaultSelector. +Capybara/RSpec/HaveSelector: + Exclude: + - 'spec/system/all_casa_admins/patch_notes/index_spec.rb' + - 'spec/system/banners/new_spec.rb' + - 'spec/system/casa_cases/additional_index_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/casa_org/edit_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/imports/index_spec.rb' + - 'spec/system/languages/languages_spec.rb' + - 'spec/system/learning_hours/index_spec.rb' + - 'spec/system/reimbursements/reimbursements_spec.rb' + - 'spec/system/supervisors/new_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/system/volunteers/new_spec.rb' + - 'spec/views/all_casa_admins/casa_orgs/new.html.erb_spec.rb' + - 'spec/views/casa_cases/edit.html.erb_spec.rb' + - 'spec/views/casa_orgs/edit.html.erb_spec.rb' + - 'spec/views/case_court_reports/index.html.erb_spec.rb' + - 'spec/views/checklist_items/edit.html.erb_spec.rb' + - 'spec/views/checklist_items/new.html.erb_spec.rb' + - 'spec/views/court_dates/edit.html.erb_spec.rb' + - 'spec/views/court_dates/new.html.erb_spec.rb' + - 'spec/views/hearing_types/edit.html.erb_spec.rb' + - 'spec/views/hearing_types/new.html.erb_spec.rb' + - 'spec/views/judges/new.html.erb_spec.rb' + - 'spec/views/placements/edit.html.erb_spec.rb' + - 'spec/views/placements/index.html.erb_spec.rb' + - 'spec/views/placements/new.html.erb_spec.rb' + - 'spec/views/volunteers/index.html.erb_spec.rb' + +# Offense count: 1 +Capybara/SpecificActions: + Exclude: + - 'spec/system/casa_cases/edit_spec.rb' + +# Offense count: 25 +# This cop supports safe autocorrection (--autocorrect). +Capybara/SpecificFinders: + Exclude: + - 'spec/system/all_casa_admins/sessions/new_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/new_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/casa_org/edit_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/case_groups/case_groups_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/deep_link/deep_link_spec.rb' + - 'spec/system/learning_hours/edit_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/sessions/login_spec.rb' + - 'spec/system/sessions/new_spec.rb' + +# Offense count: 24 +Capybara/SpecificMatcher: + Exclude: + - 'spec/components/modal/open_button_component_spec.rb' + - 'spec/components/sidebar/link_component_spec.rb' + - 'spec/system/casa_cases/additional_index_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/views/all_casa_admins/casa_orgs/new.html.erb_spec.rb' + - 'spec/views/checklist_items/edit.html.erb_spec.rb' + - 'spec/views/checklist_items/new.html.erb_spec.rb' + - 'spec/views/hearing_types/edit.html.erb_spec.rb' + - 'spec/views/hearing_types/new.html.erb_spec.rb' + - 'spec/views/judges/new.html.erb_spec.rb' + +# Offense count: 10 +Capybara/VisibilityMatcher: + Exclude: + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/components/truncated_text_component_spec.rb' + # Offense count: 53 RSpec/AnyInstance: Exclude: diff --git a/Gemfile b/Gemfile index cc5a640be7..b6bca860b0 100644 --- a/Gemfile +++ b/Gemfile @@ -75,6 +75,7 @@ group :development, :test do # linters gem "erb_lint", require: false gem "rubocop", require: false + gem "rubocop-capybara", require: false gem "rubocop-performance", require: false gem "rubocop-rails", require: false gem "rubocop-rspec", require: false diff --git a/Gemfile.lock b/Gemfile.lock index a90e83bfdf..f7290110b2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -470,6 +470,8 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.32.1) parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) @@ -662,6 +664,7 @@ DEPENDENCIES rswag-specs rswag-ui rubocop + rubocop-capybara rubocop-performance rubocop-rails rubocop-rspec From ab5f8f2d6cb668bcc69718f5d9762aac175afc6e Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Mon, 21 Oct 2024 23:39:40 -0400 Subject: [PATCH 05/22] add rubocop-factory_bot --- .rubocop.yml | 6 +++++ .rubocop_todo.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++- Gemfile | 1 + Gemfile.lock | 3 +++ 4 files changed, 67 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4c56931f69..4ce2f6bfe2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,6 +7,7 @@ require: - standard-custom - standard-performance - rubocop-capybara + - rubocop-factory_bot - rubocop-performance - rubocop-rails - rubocop-rspec @@ -60,6 +61,11 @@ RSpec/Focus: # run ALL tests on CI Enabled: true Exclude: [] +# Custom Rules: +# FACTORY BOT +FactoryBot/ConsistentParenthesesStyle: + Enabled: false # they are just method calls, let other method call rules handle this + # RAILS Rails/DefaultScope: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7c2e8230b7..5920368da5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-22 03:27:52 UTC using RuboCop version 1.65.1. +# on 2024-10-22 03:38:17 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -175,6 +175,62 @@ Capybara/VisibilityMatcher: - 'spec/system/case_court_reports/index_spec.rb' - 'spec/system/components/truncated_text_component_spec.rb' +# Offense count: 18 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, NonImplicitAssociationMethodNames. +# SupportedStyles: explicit, implicit +FactoryBot/AssociationStyle: + Exclude: + - 'spec/factories/addresses.rb' + - 'spec/factories/banners.rb' + - 'spec/factories/case_contacts.rb' + - 'spec/factories/checklist_items.rb' + - 'spec/factories/followups.rb' + - 'spec/factories/login_activities.rb' + - 'spec/factories/notes.rb' + - 'spec/factories/notifications.rb' + - 'spec/factories/placements.rb' + - 'spec/factories/sent_emails.rb' + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AutoCorrect, Include, EnforcedStyle, ExplicitOnly. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +# SupportedStyles: create_list, n_times +FactoryBot/CreateList: + Exclude: + - 'spec/system/static/index_spec.rb' + - 'spec/system/volunteers/index_spec.rb' + - 'spec/views/all_casa_admins/patch_notes/index.html.erb_spec.rb' + +# Offense count: 13 +# Configuration parameters: Include. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +FactoryBot/FactoryAssociationWithStrategy: + Exclude: + - 'spec/factories/casa_case_emancipation_categories.rb' + - 'spec/factories/casa_cases_emancipation_options.rb' + - 'spec/factories/case_assignments.rb' + - 'spec/factories/case_group_memberships.rb' + - 'spec/factories/emancipation_options.rb' + - 'spec/factories/patch_notes.rb' + - 'spec/factories/supervisor_volunteer.rb' + - 'spec/factories/volunteers.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +FactoryBot/FactoryClassName: + Exclude: + - 'spec/factories/notifications.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +FactoryBot/RedundantFactoryOption: + Exclude: + - 'spec/factories/sent_emails.rb' + # Offense count: 53 RSpec/AnyInstance: Exclude: diff --git a/Gemfile b/Gemfile index b6bca860b0..7d0608f359 100644 --- a/Gemfile +++ b/Gemfile @@ -76,6 +76,7 @@ group :development, :test do gem "erb_lint", require: false gem "rubocop", require: false gem "rubocop-capybara", require: false + gem "rubocop-factory_bot", require: false gem "rubocop-performance", require: false gem "rubocop-rails", require: false gem "rubocop-rspec", require: false diff --git a/Gemfile.lock b/Gemfile.lock index f7290110b2..df867d028e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -472,6 +472,8 @@ GEM parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) @@ -665,6 +667,7 @@ DEPENDENCIES rswag-ui rubocop rubocop-capybara + rubocop-factory_bot rubocop-performance rubocop-rails rubocop-rspec From 2831d217c1e0473c85c7f7e5e7e3bcdaca95f4d4 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 00:11:31 -0400 Subject: [PATCH 06/22] formatting --- .rubocop.yml | 81 ++++++++++++++++++++++++++++----------------- bin/lint | 3 +- spec/spec_helper.rb | 2 +- 3 files changed, 52 insertions(+), 34 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 4ce2f6bfe2..3130e66d90 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,7 @@ +# https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard +# Todo generated via `bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` +# We may want to remove the todo file and use --disable-uncorrectable to generate todo comments instead + inherit_mode: merge: - Exclude @@ -20,15 +24,16 @@ inherit_gem: standard-rails: config/base.yml inherit_from: +<% unless ENV['BYPASS_RUBOCOP_TODO'] %> - .rubocop_todo.yml +<% end %> AllCops: + ExtraDetails: true NewCops: enable SuggestExtensions: false - TargetRubyVersion: 3.2 - TargetRailsVersion: 7.2 Exclude: - - 'bin/**/*' # todo? + - 'bin/**/*' - 'db/migrate/2020*.rb' - 'db/migrate/2021*.rb' - 'db/migrate/2022*.rb' @@ -40,79 +45,93 @@ AllCops: - 'lib/tasks/deployment/2022*' - 'lib/tasks/deployment/2023*' -# Override Todos for these rules: -Lint/Debugger: # don't leave binding.pry or debugger +# OVERRIDE rubocop-todo.yml for these rules: +Lint/Debugger: + # Don't leave binding.pry or debugger Enabled: true Exclude: [] -Rails/Output: # Don't leave puts-debugging +Rails/Output: + # Don't leave puts-debugging Enabled: true Exclude: [] -Rails/FindEach: # each could severely affect the performance, use find_each +Rails/FindEach: + # each could severely affect performance, use find_each Enabled: true Exclude: [] -Rails/UniqBeforePluck: # uniq.pluck and not pluck.uniq +Rails/UniqBeforePluck: + # uniq.pluck and not pluck.uniq Enabled: true Exclude: [] -RSpec/Focus: # run ALL tests on CI +RSpec/Focus: + # run ALL tests on CI Enabled: true Exclude: [] -# Custom Rules: -# FACTORY BOT +# TODO: +Rails/RedundantTravelBack: + # I thought this caused flaky specs (PR #6054) but rubocop-rails thinks I'm wrong + Enabled: false + +# CUSTOMIZED RULES +# FactoryBot FactoryBot/ConsistentParenthesesStyle: - Enabled: false # they are just method calls, let other method call rules handle this + # build/create are just method calls, no FactoryBot-specific rules needed + Enabled: false -# RAILS +# Rails Rails/DefaultScope: Enabled: true Details: >- - Default scopes lead to unexpected behavior for future devs, use named scopes where needed. + Default scopes lead to unexpected behavior for future devs. + Rails/OrderById: Enabled: true - Details: >- - No guaranteed order by id, use timestamps (created_at/updated_at) or no order at all. + Rails/SaveBang: Enabled: true Include: - - 'spec/**/*' # TODO: enable everywhere? + - 'spec/**/*' Details: >- - Specs should fail if saved/updated record is invalid. + Specs should fail if setup record is invalid. -# RSPEC +# RSpec RSpec/ExampleLength: CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] Max: 15 # could be lower; default is 5 Exclude: - 'spec/system/**/*' + RSpec/LetSetup: Details: >- - Let bangs (!) lead to unnecessary database calls during test execution. - They can also obscure what setup is necessary for the test. - Instead of immediate execution in a let!, call the variable where it is necessary: that is, - where tests or other variables depend on it: in an example before `subject`, a before block, - or the let block of a dependant variable: - let(:some_needed_thing) { create(:bang) } + + let! leads to unnecessary database calls and obscures necessary setup. + + Instead, call a let var in the example, before block, or let block of a variable that depends on it: + let(:nececessary_thing) { create(:thing) } let(:dependent_thing) do - some_needed_thing # instead of let!(:some_needed_thing) above + nececessary_thing create(:dependent_thing) end + RSpec/MultipleExpectations: - Max: 10 # failures are aggregated by default (spec_helper.rb) + # failures are aggregated by default (spec_helper.rb) + Max: 10 Exclude: - 'spec/system/**/*' # async behaviors may require expecting things on page + RSpec/MultipleMemoizedHelpers: Max: 20 + RSpec/NamedSubject: Enabled: false + RSpec/NestedGroups: Max: 5 + RSpec/NotToNot: - Enabled: false # consistency only, no difference in to_not/not_to + Enabled: false # consistency only, no difference between to_not/not_to -# TODO: I thought this was causing flaky specs but rubocop-rails says I'm wrong -Rails/RedundantTravelBack: - Enabled: false diff --git a/bin/lint b/bin/lint index 69dd304dd1..12d48f9c3e 100755 --- a/bin/lint +++ b/bin/lint @@ -1,7 +1,6 @@ #!/usr/bin/env bash -# bundle exec rubocop --autocorrect --format pacman -bundle exec rubocop --autocorrect --format worst +bundle exec rubocop --autocorrect --extra-details bundle exec erblint --lint-all --autocorrect yarn lint:fix echo "Linting Factories" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b35c581814..ff24be772c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -46,7 +46,7 @@ config.order = :random config.define_derived_metadata do |meta| - meta[:aggregate_failures] = true + meta[:aggregate_failures] = true unless meta[:type] == :system end RSpec::Matchers.define_negated_matcher :not_change, :change From ee4152551e813ce52084a8ab6ace6da4a638cbaa Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 13:31:06 -0400 Subject: [PATCH 07/22] actually override todos as stated in comment --- .rubocop.yml | 16 ++++++++++++- .rubocop_todo.yml | 24 +------------------ app/models/case_contact.rb | 2 +- .../volunteer_birthday_reminder_service.rb | 2 +- db/seeds.rb | 4 ++-- db/seeds/db_populator.rb | 2 +- .../contact_topic_populator.rb | 2 +- .../contact_type_populator.rb | 2 +- .../contact_topic_populator_spec.rb | 2 +- .../contact_type_populator_spec.rb | 2 +- 10 files changed, 25 insertions(+), 33 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3130e66d90..480210e83b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -50,26 +50,41 @@ Lint/Debugger: # Don't leave binding.pry or debugger Enabled: true Exclude: [] + inherit_mode: + override: + - Exclude Rails/Output: # Don't leave puts-debugging Enabled: true Exclude: [] + inherit_mode: + override: + - Exclude Rails/FindEach: # each could severely affect performance, use find_each Enabled: true Exclude: [] + inherit_mode: + override: + - Exclude Rails/UniqBeforePluck: # uniq.pluck and not pluck.uniq Enabled: true Exclude: [] + inherit_mode: + override: + - Exclude RSpec/Focus: # run ALL tests on CI Enabled: true Exclude: [] + inherit_mode: + override: + - Exclude # TODO: Rails/RedundantTravelBack: @@ -134,4 +149,3 @@ RSpec/NestedGroups: RSpec/NotToNot: Enabled: false # consistency only, no difference between to_not/not_to - diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5920368da5..3fc569385b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-22 03:38:17 UTC using RuboCop version 1.65.1. +# on 2024-10-22 17:30:18 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -1672,19 +1672,6 @@ Rails/FilePath: - 'spec/system/imports/index_spec.rb' - 'spec/views/casa_orgs/edit.html.erb_spec.rb' -# Offense count: 6 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowedMethods, AllowedPatterns. -# AllowedMethods: order, limit, select, lock -Rails/FindEach: - Exclude: - - 'app/models/case_contact.rb' - - 'db/seeds/db_populator.rb' - - 'lib/tasks/data_post_processors/contact_topic_populator.rb' - - 'lib/tasks/data_post_processors/contact_type_populator.rb' - - 'spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb' - - 'spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb' - # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/IgnoredColumnsAssignment: @@ -1712,15 +1699,6 @@ Rails/OrderById: - 'spec/datatables/volunteer_datatable_spec.rb' - 'spec/models/casa_case_spec.rb' -# Offense count: 3 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Include. -# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb -Rails/Output: - Exclude: - - 'app/services/volunteer_birthday_reminder_service.rb' - - 'db/seeds.rb' - # Offense count: 16 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/Pluck: diff --git a/app/models/case_contact.rb b/app/models/case_contact.rb index fd270be55d..ec7286e180 100644 --- a/app/models/case_contact.rb +++ b/app/models/case_contact.rb @@ -243,7 +243,7 @@ def has_casa_case_transitioned def contact_groups_with_types hash = Hash.new { |h, k| h[k] = [] } - contact_types.includes(:contact_type_group).each do |contact_type| + contact_types.includes(:contact_type_group).find_each do |contact_type| hash[contact_type.contact_type_group.name] << contact_type.name end hash diff --git a/app/services/volunteer_birthday_reminder_service.rb b/app/services/volunteer_birthday_reminder_service.rb index e20fb178f9..d419de2347 100644 --- a/app/services/volunteer_birthday_reminder_service.rb +++ b/app/services/volunteer_birthday_reminder_service.rb @@ -7,7 +7,7 @@ def send_reminders .deliver(volunteer.supervisor) end else - puts "Volunteer Birthday Reminder Rake task skipped. Today is not the 15th of the month." + Rails.logger.info { "Volunteer Birthday Reminder Rake task skipped. Today is not the 15th of the month." } end end end diff --git a/db/seeds.rb b/db/seeds.rb index e26550defb..f8808d9346 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -120,7 +120,7 @@ def report_object_counts def log(message) return if Rails.env.test? - puts message + Rails.logger.debug { message } end def create_org_related_data(db_populator, casa_org, options) @@ -144,6 +144,6 @@ def create_org_related_data(db_populator, casa_org, options) begin load(Rails.root.join("db", "seeds", "emancipation_options_prune.rb")) rescue => e - puts "Caught error during db seed emancipation_options_prune, continuing. Message: #{e}" + Rails.logger.error { "Caught error during db seed emancipation_options_prune, continuing. Message: #{e}" } end load(Rails.root.join("db", "seeds", "placement_data.rb")) diff --git a/db/seeds/db_populator.rb b/db/seeds/db_populator.rb index a5080cd4a7..262ee7c9f2 100644 --- a/db/seeds/db_populator.rb +++ b/db/seeds/db_populator.rb @@ -86,7 +86,7 @@ def create_users(casa_org, options) create_users_of_type.call(Supervisor, options.supervisor_count) create_users_of_type.call(Volunteer, options.volunteer_count) supervisors = Supervisor.all.to_a - Volunteer.all.each { |v| v.supervisor = supervisors.sample(random: rng) } + Volunteer.find_each { |v| v.supervisor = supervisors.sample(random: rng) } end # Create other duties (Volunteer only) diff --git a/lib/tasks/data_post_processors/contact_topic_populator.rb b/lib/tasks/data_post_processors/contact_topic_populator.rb index 675fc7f1bd..69728b77c6 100644 --- a/lib/tasks/data_post_processors/contact_topic_populator.rb +++ b/lib/tasks/data_post_processors/contact_topic_populator.rb @@ -1,6 +1,6 @@ module ContactTopicPopulator def self.populate - CasaOrg.all.each do |casa_org| + CasaOrg.find_each do |casa_org| ContactTopic.generate_for_org!(casa_org) casa_org.contact_topics.each do |topic| diff --git a/lib/tasks/data_post_processors/contact_type_populator.rb b/lib/tasks/data_post_processors/contact_type_populator.rb index ac77d32a4a..821b6f2711 100644 --- a/lib/tasks/data_post_processors/contact_type_populator.rb +++ b/lib/tasks/data_post_processors/contact_type_populator.rb @@ -1,6 +1,6 @@ module ContactTypePopulator def self.populate - CasaOrg.all.each do |casa_org| + CasaOrg.find_each do |casa_org| ContactTypeGroup.generate_for_org!(casa_org) end end diff --git a/spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb b/spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb index 6cb5217bd4..b82c1bd020 100644 --- a/spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb +++ b/spec/lib/tasks/data_post_processors/contact_topic_populator_spec.rb @@ -47,7 +47,7 @@ expect(case_one.case_contacts.map(&:contact_topic_answers).flatten.size).to eq(9) expect(case_two.case_contacts.map(&:contact_topic_answers).flatten.size).to eq(9) - CaseContact.all.each do |case_contact| + CaseContact.find_each do |case_contact| expect(case_contact.contact_topic_answers.size).to eq(3) end end diff --git a/spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb b/spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb index 6ad384b43a..c7758fa185 100644 --- a/spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb +++ b/spec/lib/tasks/data_post_processors/contact_type_populator_spec.rb @@ -9,7 +9,7 @@ it "creates the expected contact groups and contact types for each existing organization" do ContactTypePopulator.populate - CasaOrg.all.each do |org| + CasaOrg.find_each do |org| casa_group = org.contact_type_groups.find_by(name: "CASA") expect(casa_group.contact_types.pluck(:name)).to contain_exactly("Youth", "Supervisor") From 677d9120b46e5a23f8f7ea24e0ad5a74de58a5d5 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 13:34:56 -0400 Subject: [PATCH 08/22] restore file that should have been ignored --- .../20201005203405_populate_case_contact_contact_type.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake b/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake index 09b7879e15..1a42fe5cb6 100644 --- a/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake +++ b/lib/tasks/deployment/20201005203405_populate_case_contact_contact_type.rake @@ -1,4 +1,4 @@ -require_relative "../data_post_processors/case_contact_populator" +require_relative '../data_post_processors/case_contact_populator' namespace :after_party do desc "Deployment task: populate_case_contact_contact_type" From 36f708fb5405697cbaeb53d018a50db84b2bce0e Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 14:07:09 -0400 Subject: [PATCH 09/22] typo --- .rubocop.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 480210e83b..d77cb9e66b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -126,9 +126,9 @@ RSpec/LetSetup: let! leads to unnecessary database calls and obscures necessary setup. Instead, call a let var in the example, before block, or let block of a variable that depends on it: - let(:nececessary_thing) { create(:thing) } + let(:necessary_thing) { create(:thing) } let(:dependent_thing) do - nececessary_thing + necessary_thing create(:dependent_thing) end @@ -148,4 +148,5 @@ RSpec/NestedGroups: Max: 5 RSpec/NotToNot: - Enabled: false # consistency only, no difference between to_not/not_to + # consistency only, no difference between to_not/not_to (these days) + Enabled: false From 2b0c4acc038288694903c01511c02f3777fff2f6 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 14:07:09 -0400 Subject: [PATCH 10/22] typo --- .rubocop.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index d77cb9e66b..f8745e7ec3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,17 @@ # Todo generated via `bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` # We may want to remove the todo file and use --disable-uncorrectable to generate todo comments instead +# To see which todos to work one next, you can run: +# BY FILE: +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format worst +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop path/to/worst_offender.rb -A +# BY OFFENSE COUNT: +# BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format offenses +# Other useful options: +# --display-only-safe-correctable - Only output safe correctable (-a) offense messages. +# --display-only-correctable - Only output correctable (-A) offense messages. +# --disable-uncorrectable - Used with autocorrect to annotate any offenses that do not support autocorrect with rubocop:todo comments. + inherit_mode: merge: - Exclude From 57ae1d7b94acec3a13bdc4032a55bb0f2e38267a Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 14:07:09 -0400 Subject: [PATCH 11/22] better comment, remove todo in config --- .rubocop.yml | 31 +++++++++++++++++++++---------- .rubocop_todo.yml | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 11 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f8745e7ec3..a3fe81e689 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,21 @@ +# Config adapted from: # https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard -# Todo generated via `bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# We may want to remove the todo file and use --disable-uncorrectable to generate todo comments instead + +# To fix the file with the most offenses: +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format worst +# - Remove the file from the rubocop_todo.yml +# - Run `bundle exec rubocop -A` +# OR +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop path/to/worst_offender.rb -A + +# If you want to fix one rule instead: +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format offenses +# - add --display-only-safe-correctable to see only safe autocorrect-able offenses +# - OR --display-only-correctable to see all autocorrect-able offenses +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop -A --only Department/Cop + +# After fixes, regenerate the todo file with: +# - bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit # To see which todos to work one next, you can run: # BY FILE: @@ -29,6 +44,7 @@ require: - rubocop-rspec_rails inherit_gem: + pundit: config/rubocop-rspec.yml standard: config/ruby-3.2.yml standard-performance: config/base.yml standard-custom: config/base.yml @@ -56,7 +72,7 @@ AllCops: - 'lib/tasks/deployment/2022*' - 'lib/tasks/deployment/2023*' -# OVERRIDE rubocop-todo.yml for these rules: +# OVERRIDE .rubocop_todo.yml for these rules: Lint/Debugger: # Don't leave binding.pry or debugger Enabled: true @@ -90,18 +106,13 @@ Rails/UniqBeforePluck: - Exclude RSpec/Focus: - # run ALL tests on CI + # ensure all tests run on CI Enabled: true Exclude: [] inherit_mode: override: - Exclude -# TODO: -Rails/RedundantTravelBack: - # I thought this caused flaky specs (PR #6054) but rubocop-rails thinks I'm wrong - Enabled: false - # CUSTOMIZED RULES # FactoryBot FactoryBot/ConsistentParenthesesStyle: @@ -112,7 +123,7 @@ FactoryBot/ConsistentParenthesesStyle: Rails/DefaultScope: Enabled: true Details: >- - Default scopes lead to unexpected behavior for future devs. + Default scopes lead to unexpected behavior for future developers. Rails/OrderById: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3fc569385b..61ff96949f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-22 17:30:18 UTC using RuboCop version 1.65.1. +# on 2024-10-23 02:16:38 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -1739,6 +1739,44 @@ Rails/RedundantPresenceValidationOnBelongsTo: Exclude: - 'app/models/case_assignment.rb' +# Offense count: 38 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include. +# Include: spec/**/*.rb, test/**/*.rb +Rails/RedundantTravelBack: + Exclude: + - 'spec/callbacks/case_contact_metadata_callback_spec.rb' + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/lib/importers/case_importer_spec.rb' + - 'spec/lib/tasks/supervisor_weekly_digest_spec.rb' + - 'spec/models/casa_case_spec.rb' + - 'spec/models/case_court_report_context_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/requests/banners_spec.rb' + - 'spec/requests/case_contact_reports_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/court_dates_spec.rb' + - 'spec/requests/health_spec.rb' + - 'spec/requests/imports_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/services/case_contacts_contact_dates_spec.rb' + - 'spec/services/deployment/backfill_case_contact_started_metadata_service_spec.rb' + - 'spec/services/emancipation_checklist_reminder_service_spec.rb' + - 'spec/services/volunteer_birthday_reminder_service_spec.rb' + - 'spec/support/shared_examples/shows_court_dates_links.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/court_dates/edit_spec.rb' + - 'spec/system/court_dates/new_spec.rb' + - 'spec/system/court_dates/view_spec.rb' + - 'spec/system/placements/destroy_spec.rb' + - 'spec/system/placements/edit_spec.rb' + - 'spec/system/placements/index_spec.rb' + - 'spec/system/placements/new_spec.rb' + # Offense count: 9 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/RootPathnameMethods: From 5724279485868bd42347a7378b0be73d0473a292 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 23:08:53 -0400 Subject: [PATCH 12/22] CI / readme / git hook --- .github/workflows/ruby_lint.yml | 4 ++-- .rubocop.yml | 5 +---- README.md | 4 ++-- bin/git_hooks/lint | 6 +++--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ruby_lint.yml b/.github/workflows/ruby_lint.yml index 9b06082abe..d9e7407079 100644 --- a/.github/workflows/ruby_lint.yml +++ b/.github/workflows/ruby_lint.yml @@ -1,4 +1,4 @@ -name: standardrb lint +name: rubocop lint on: push: @@ -30,4 +30,4 @@ jobs: bundler-cache: true - name: lint - run: bundle exec standardrb + run: bundle exec rubocop diff --git a/.rubocop.yml b/.rubocop.yml index a3fe81e689..67fbd6ad6a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,9 +3,6 @@ # To fix the file with the most offenses: # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format worst -# - Remove the file from the rubocop_todo.yml -# - Run `bundle exec rubocop -A` -# OR # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop path/to/worst_offender.rb -A # If you want to fix one rule instead: @@ -15,7 +12,7 @@ # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop -A --only Department/Cop # After fixes, regenerate the todo file with: -# - bundle exec rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit +# - bundle exec rubocop --regenerate-todo # To see which todos to work one next, you can run: # BY FILE: diff --git a/README.md b/README.md index 5d6590fc86..4fc2f5c41f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![rspec](https://github.com/rubyforgood/casa/workflows/rspec/badge.svg)](https://github.com/rubyforgood/casa/actions/workflows/rspec.yml) [![erb lint](https://github.com/rubyforgood/casa/actions/workflows/erb_lint.yml/badge.svg)](https://github.com/rubyforgood/casa/actions/workflows/erb_lint.yml) -[![standardrb lint](https://github.com/rubyforgood/casa/actions/workflows/ruby_lint.yml/badge.svg)](https://github.com/rubyforgood/casa/actions/workflows/ruby_lint.yml) +[![rubocop lint](https://github.com/rubyforgood/casa/actions/workflows/ruby_lint.yml/badge.svg)](https://github.com/rubyforgood/casa/actions/workflows/ruby_lint.yml) [![brakeman](https://github.com/rubyforgood/casa/workflows/brakeman/badge.svg)](https://github.com/rubyforgood/casa/actions/workflows/security.yml) [![yarn lint](https://github.com/rubyforgood/casa/actions/workflows/yarn_lint_and_test.yml/badge.svg)](https://github.com/rubyforgood/casa/actions/workflows/yarn_lint_and_test.yml) @@ -189,7 +189,7 @@ Test coverage is run by simplecov on all builds and aggregated by CodeClimate Run `bin/lint` to run all linters and fix issues. This will run: -1. `bundle exec standardrb --fix` auto-fix Ruby linting issues [more linter info](https://github.com/testdouble/standard) +1. `bundle exec rubocop --autocorrect` auto-fix Ruby linting issues [more linter info](https://docs.rubocop.org/rubocop/1.67/index.html) 1. `bundle exec erblint --lint-all --autocorrect` [ERB linter](https://github.com/Shopify/erb-lint) 1. `yarn lint:fix` to run the [JS linter](https://standardjs.com/index.html) and fix issues 1. `rake factory_bot:lint` if you have been editing factories and want to find factories and traits which produce invalid objects diff --git a/bin/git_hooks/lint b/bin/git_hooks/lint index 2c0218a4bb..65a6520e80 100755 --- a/bin/git_hooks/lint +++ b/bin/git_hooks/lint @@ -101,7 +101,7 @@ if test $js_changed_count -gt 0; then fi if test $rb_changed_count -gt 0; then - log info "Linting via standardrb" + log info "Linting via rubocop" cd $repo_root @@ -109,8 +109,8 @@ if test $rb_changed_count -gt 0; then log error "Command bundle could not be found" exit 1 else - if ! bundle exec standardrb --fix ; then - log error "Standard linting failed, could not fix 1 or more issues\n See above output for more details" + if ! bundle exec rubocop --autocorrect --extra-details ; then + log error "Rubocop linting failed, could not fix 1 or more issues\n See above output for more details" exit 1 fi fi From e4b0867dcf5892ae2984e41b6191326fe31096bb Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Tue, 22 Oct 2024 23:29:37 -0400 Subject: [PATCH 13/22] remove inline todo/disable comments --- .github/workflows/ruby_lint.yml | 2 +- .rubocop_todo.yml | 45 +++++++++++-------- bin/bundle | 13 +----- bin/lint | 2 +- .../20200329050100_create_casa_cases.rb | 1 - .../20200329062155_devise_create_users.rb | 1 - db/migrate/20200329064203_add_role_to_user.rb | 1 - ...71025_change_casa_case_teen_to_required.rb | 1 - ...327_change_casa_case_number_to_required.rb | 1 - ...26_add_unique_index_on_case_case_number.rb | 1 - ...0329074655_create_supervisor_volunteers.rb | 1 - .../20200329081206_create_case_assignments.rb | 1 - spec/models/case_contact_report_spec.rb | 4 +- .../placement_export_csv_service_spec.rb | 2 +- 14 files changed, 32 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ruby_lint.yml b/.github/workflows/ruby_lint.yml index d9e7407079..f9c547609a 100644 --- a/.github/workflows/ruby_lint.yml +++ b/.github/workflows/ruby_lint.yml @@ -30,4 +30,4 @@ jobs: bundler-cache: true - name: lint - run: bundle exec rubocop + run: bundle exec rubocop --ignore-disable-comments diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 61ff96949f..39ae1f7f28 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-23 02:16:38 UTC using RuboCop version 1.65.1. +# on 2024-10-23 03:26:08 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -231,6 +231,19 @@ FactoryBot/RedundantFactoryOption: Exclude: - 'spec/factories/sent_emails.rb' +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'spec/models/case_contact_report_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Performance/Count: + Exclude: + - 'spec/models/case_contact_report_spec.rb' + # Offense count: 53 RSpec/AnyInstance: Exclude: @@ -1070,7 +1083,7 @@ RSpec/MultipleExpectations: Exclude: - 'spec/views/layouts/sidebar.html.erb_spec.rb' -# Offense count: 18 +# Offense count: 19 # Configuration parameters: AllowSubject, Max. RSpec/MultipleMemoizedHelpers: Exclude: @@ -1131,33 +1144,19 @@ RSpec/ReceiveMessages: - 'spec/views/volunteers/edit.html.erb_spec.rb' - 'spec/views/volunteers/index.html.erb_spec.rb' -# Offense count: 75 +# Offense count: 24 RSpec/RepeatedDescription: Exclude: - 'spec/decorators/user_decorator_spec.rb' - 'spec/models/case_contact_report_spec.rb' - 'spec/models/case_court_report_spec.rb' - - 'spec/policies/application_policy_spec.rb' - - 'spec/policies/case_contact_policy_spec.rb' - - 'spec/policies/case_group_policy_spec.rb' - - 'spec/policies/dashboard_policy_spec.rb' - - 'spec/policies/supervisor_policy_spec.rb' - - 'spec/policies/supervisor_volunteer_policy_spec.rb' - 'spec/requests/all_casa_admins_spec.rb' - 'spec/system/sessions/new_spec.rb' -# Offense count: 52 +# Offense count: 6 RSpec/RepeatedExample: Exclude: - 'spec/helpers/sidebar_helper_spec.rb' - - 'spec/policies/application_policy_spec.rb' - - 'spec/policies/case_contact_policy_spec.rb' - - 'spec/policies/court_date_policy_spec.rb' - - 'spec/policies/dashboard_policy_spec.rb' - - 'spec/policies/placement_policy_spec.rb' - - 'spec/policies/reimbursement_policy_spec.rb' - - 'spec/policies/supervisor_policy_spec.rb' - - 'spec/policies/supervisor_volunteer_policy_spec.rb' - 'spec/services/deployment/backfill_case_contact_started_metadata_service_spec.rb' - 'spec/views/volunteers/edit.html.erb_spec.rb' @@ -1183,12 +1182,20 @@ RSpec/ScatteredLet: - 'spec/models/casa_case_spec.rb' - 'spec/models/learning_hour_spec.rb' -# Offense count: 14 +# Offense count: 23 # This cop supports safe autocorrection (--autocorrect). RSpec/SortMetadata: Exclude: - 'spec/policies/additional_expense_policy_spec.rb' + - 'spec/policies/casa_admin_policy_spec.rb' + - 'spec/policies/casa_case_policy_spec.rb' + - 'spec/policies/case_court_report_policy_spec.rb' + - 'spec/policies/case_group_policy_spec.rb' + - 'spec/policies/checklist_item_policy_spec.rb' - 'spec/policies/contact_topic_answer_policy_spec.rb' + - 'spec/policies/placement_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/volunteer_policy_spec.rb' - 'spec/support/capybara.rb' - 'spec/system/banners/dismiss_spec.rb' - 'spec/system/banners/new_spec.rb' diff --git a/bin/bundle b/bin/bundle index d62fdae15f..75d223fc7a 100755 --- a/bin/bundle +++ b/bin/bundle @@ -21,17 +21,12 @@ m = Module.new do ENV['BUNDLER_VERSION'] end - # rubocop:todo Metrics/PerceivedComplexity - # rubocop:todo Metrics/MethodLength - def cli_arg_version # rubocop:todo Metrics/CyclomaticComplexity + def cli_arg_version return unless invoked_as_script? # don't want to hijack other binstubs unless 'update'.start_with?(ARGV.first || ' ') return - # rubocop:todo Style/CommentedKeyword end # must be running `bundle update` - # rubocop:enable Style/CommentedKeyword - bundler_version = nil update_index = nil ARGV.each_with_index do |a, i| @@ -45,8 +40,6 @@ m = Module.new do end bundler_version end - # rubocop:enable Metrics/MethodLength - # rubocop:enable Metrics/PerceivedComplexity def gemfile gemfile = ENV['BUNDLE_GEMFILE'] @@ -101,8 +94,7 @@ m = Module.new do activate_bundler end - # rubocop:todo Metrics/MethodLength - def activate_bundler # rubocop:todo Metrics/AbcSize + def activate_bundler gem_error = activation_error_handling do gem 'bundler', bundler_requirement end @@ -118,7 +110,6 @@ m = Module.new do warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`" exit 42 end - # rubocop:enable Metrics/MethodLength def activation_error_handling yield diff --git a/bin/lint b/bin/lint index 12d48f9c3e..a4a256c0e2 100755 --- a/bin/lint +++ b/bin/lint @@ -1,6 +1,6 @@ #!/usr/bin/env bash -bundle exec rubocop --autocorrect --extra-details +bundle exec rubocop --autocorrect --ignore-disable-comments --extra-details bundle exec erblint --lint-all --autocorrect yarn lint:fix echo "Linting Factories" diff --git a/db/migrate/20200329050100_create_casa_cases.rb b/db/migrate/20200329050100_create_casa_cases.rb index 077969b7c0..448c7fbef4 100644 --- a/db/migrate/20200329050100_create_casa_cases.rb +++ b/db/migrate/20200329050100_create_casa_cases.rb @@ -8,4 +8,3 @@ def change end end end -# rubocop:enable Style/Documentation diff --git a/db/migrate/20200329062155_devise_create_users.rb b/db/migrate/20200329062155_devise_create_users.rb index efb90bdb6e..e168d7eced 100644 --- a/db/migrate/20200329062155_devise_create_users.rb +++ b/db/migrate/20200329062155_devise_create_users.rb @@ -41,4 +41,3 @@ def change # add_index :users, :unlock_token, unique: true end end -# rubocop:enable Style/Documentation diff --git a/db/migrate/20200329064203_add_role_to_user.rb b/db/migrate/20200329064203_add_role_to_user.rb index 9202aaf8e4..7f8b9d0376 100644 --- a/db/migrate/20200329064203_add_role_to_user.rb +++ b/db/migrate/20200329064203_add_role_to_user.rb @@ -3,4 +3,3 @@ def change add_column :users, :role, :string, null: false, default: "volunteer" end end -# rubocop:enable Style/Documentation diff --git a/db/migrate/20200329071025_change_casa_case_teen_to_required.rb b/db/migrate/20200329071025_change_casa_case_teen_to_required.rb index 81ae7124e0..0ffae686ce 100644 --- a/db/migrate/20200329071025_change_casa_case_teen_to_required.rb +++ b/db/migrate/20200329071025_change_casa_case_teen_to_required.rb @@ -3,4 +3,3 @@ def change change_column :casa_cases, :teen_program_eligible, :boolean, null: false, default: false end end -# rubocop:enable Style/Documentation diff --git a/db/migrate/20200329071327_change_casa_case_number_to_required.rb b/db/migrate/20200329071327_change_casa_case_number_to_required.rb index f01f0f3b2e..84f766619d 100644 --- a/db/migrate/20200329071327_change_casa_case_number_to_required.rb +++ b/db/migrate/20200329071327_change_casa_case_number_to_required.rb @@ -3,4 +3,3 @@ def change change_column :casa_cases, :case_number, :string, null: false end end -# rubocop:enable Style/Documentation diff --git a/db/migrate/20200329071626_add_unique_index_on_case_case_number.rb b/db/migrate/20200329071626_add_unique_index_on_case_case_number.rb index a661fe2532..f440687cbb 100644 --- a/db/migrate/20200329071626_add_unique_index_on_case_case_number.rb +++ b/db/migrate/20200329071626_add_unique_index_on_case_case_number.rb @@ -3,4 +3,3 @@ def change add_index :casa_cases, :case_number, unique: true end end -# rubocop:enable Style/Documentation diff --git a/db/migrate/20200329074655_create_supervisor_volunteers.rb b/db/migrate/20200329074655_create_supervisor_volunteers.rb index 7bd0f56904..cd5be1b678 100644 --- a/db/migrate/20200329074655_create_supervisor_volunteers.rb +++ b/db/migrate/20200329074655_create_supervisor_volunteers.rb @@ -8,4 +8,3 @@ def change end end end -# rubocop:enable Style/Documentation diff --git a/db/migrate/20200329081206_create_case_assignments.rb b/db/migrate/20200329081206_create_case_assignments.rb index 9ba58c45c5..a45e87d1f9 100644 --- a/db/migrate/20200329081206_create_case_assignments.rb +++ b/db/migrate/20200329081206_create_case_assignments.rb @@ -9,4 +9,3 @@ def change end end end -# rubocop:enable Style/Documentation diff --git a/spec/models/case_contact_report_spec.rb b/spec/models/case_contact_report_spec.rb index 4141c42a6b..523fa07a91 100644 --- a/spec/models/case_contact_report_spec.rb +++ b/spec/models/case_contact_report_spec.rb @@ -384,7 +384,6 @@ end context "with court topics" do - # rubocop:disable Layout/ExtraSpacing let(:report) { described_class.new(filtered_csv_cols: {court_topics: "true"}) } let(:csv) { CSV.parse(report.to_csv, headers: true) } @@ -405,7 +404,7 @@ headers = csv.headers expect(headers).not_to include(unused_topic.question) expect(headers).to include(used_topic_1.question, used_topic_2.question) - expect(headers.select { |header| header == used_topic_1.question }.size).to be 1 # rubocop:disable Performance/Count + expect(headers.select { |header| header == used_topic_1.question }.size).to be 1 end it "includes topic answers in csv rows" do @@ -433,6 +432,5 @@ expect(csv.first.fields).not_to include("Ans Contact 1 Topic 1", "Ans Contact 1 Topic 2") end end - # rubocop:enable Layout/ExtraSpacing end end diff --git a/spec/services/placement_export_csv_service_spec.rb b/spec/services/placement_export_csv_service_spec.rb index dd2d986820..ab84e37c7f 100644 --- a/spec/services/placement_export_csv_service_spec.rb +++ b/spec/services/placement_export_csv_service_spec.rb @@ -6,7 +6,7 @@ casa_org = create(:casa_org, name: "Fake Name", display_name: "Fake Display Name") placement_type = create(:placement_type, casa_org: casa_org) creator = create(:user) - placement = create(:placement, creator: creator, placement_type: placement_type) # rubocop:disable Lint/UselessAssignment + create(:placement, creator: creator, placement_type: placement_type) csv_headers = "Casa Org,Casa Case Number,Placement Type,Placement Started At,Created At,Creator Name\n" result = PlacementExportCsvService.new(casa_org: casa_org).perform From 68f7baab0420696868401ea743d76f1da3000c92 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Wed, 23 Oct 2024 00:51:24 -0400 Subject: [PATCH 14/22] yaml linting --- .rubocop.yml | 12 ++++++------ .yamllint.yml | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 67fbd6ad6a..1bff6caaf4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,4 @@ +--- # Config adapted from: # https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard @@ -47,10 +48,11 @@ inherit_gem: standard-custom: config/base.yml standard-rails: config/base.yml -inherit_from: +# yamllint disable <% unless ENV['BYPASS_RUBOCOP_TODO'] %> - - .rubocop_todo.yml +inherit_from: .rubocop_todo.yml <% end %> +# yamllint enable AllCops: ExtraDetails: true @@ -140,11 +142,9 @@ RSpec/ExampleLength: - 'spec/system/**/*' RSpec/LetSetup: - Details: >- - + Details: >+ let! leads to unnecessary database calls and obscures necessary setup. - - Instead, call a let var in the example, before block, or let block of a variable that depends on it: + Instead, call a let var in the example, before block, or let block of a variable that depends on it- let(:necessary_thing) { create(:thing) } let(:dependent_thing) do necessary_thing diff --git a/.yamllint.yml b/.yamllint.yml index 90e6330084..7fa97e2903 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -1,6 +1,8 @@ extends: default ignore-from-file: .gitignore +ignore: + - .rubocop_todo.yml # generated by rubocop rules: document-start: From 26a5fda21b489c5e0df0371bb5e75fd56b40f8a1 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Wed, 23 Oct 2024 00:56:11 -0400 Subject: [PATCH 15/22] remove duplicate comment --- .rubocop.yml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1bff6caaf4..d06ad67296 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,7 @@ # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format worst # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop path/to/worst_offender.rb -A -# If you want to fix one rule instead: +# If you want to fix by rule instead: # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format offenses # - add --display-only-safe-correctable to see only safe autocorrect-able offenses # - OR --display-only-correctable to see all autocorrect-able offenses @@ -15,17 +15,6 @@ # After fixes, regenerate the todo file with: # - bundle exec rubocop --regenerate-todo -# To see which todos to work one next, you can run: -# BY FILE: -# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format worst -# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop path/to/worst_offender.rb -A -# BY OFFENSE COUNT: -# BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format offenses -# Other useful options: -# --display-only-safe-correctable - Only output safe correctable (-a) offense messages. -# --display-only-correctable - Only output correctable (-A) offense messages. -# --disable-uncorrectable - Used with autocorrect to annotate any offenses that do not support autocorrect with rubocop:todo comments. - inherit_mode: merge: - Exclude From 79985371fb5093791be30ed5c0c2fdc0e52796c4 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Wed, 23 Oct 2024 00:58:30 -0400 Subject: [PATCH 16/22] yamllint config ignore --- .rubocop.yml | 8 +++----- .yamllint.yml | 6 ++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index d06ad67296..7e06571ca9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,3 @@ ---- # Config adapted from: # https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard @@ -37,11 +36,10 @@ inherit_gem: standard-custom: config/base.yml standard-rails: config/base.yml -# yamllint disable +inherit_from: <% unless ENV['BYPASS_RUBOCOP_TODO'] %> -inherit_from: .rubocop_todo.yml + - .rubocop_todo.yml <% end %> -# yamllint enable AllCops: ExtraDetails: true @@ -133,7 +131,7 @@ RSpec/ExampleLength: RSpec/LetSetup: Details: >+ let! leads to unnecessary database calls and obscures necessary setup. - Instead, call a let var in the example, before block, or let block of a variable that depends on it- + Instead, call a let var in the example, before block, or let block of a variable that depends on it. let(:necessary_thing) { create(:thing) } let(:dependent_thing) do necessary_thing diff --git a/.yamllint.yml b/.yamllint.yml index 7fa97e2903..4393aab89e 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -1,8 +1,10 @@ extends: default -ignore-from-file: .gitignore ignore: - - .rubocop_todo.yml # generated by rubocop + - .rubocop_todo.yml # generated by rubocop + - .rubocop.yml # <% ... %> breaks yamllint, cannot be comment-disabled + - .git + - node_modules rules: document-start: From 6291c184fb49a30006bfc4453c40db1a1920244c Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Wed, 23 Oct 2024 13:24:24 -0400 Subject: [PATCH 17/22] proofreading copy/comments --- .rubocop.yml | 76 +++++++++++----------- .rubocop_todo.yml | 149 +++++++++++++++++++++++++++++++++++++++++++- spec/spec_helper.rb | 1 + 3 files changed, 187 insertions(+), 39 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 7e06571ca9..4fca33317d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,11 +7,11 @@ # If you want to fix by rule instead: # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format offenses -# - add --display-only-safe-correctable to see only safe autocorrect-able offenses -# - OR --display-only-correctable to see all autocorrect-able offenses # - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop -A --only Department/Cop -# After fixes, regenerate the todo file with: +# add --display-only-safe-correctable or --display-only-correctable to filter on autocorrect-able offenses + +# ! NOTE: After fixes are complete, update .rubocop_todo.yml (You do not have to fix every offense in the file): # - bundle exec rubocop --regenerate-todo inherit_mode: @@ -43,6 +43,7 @@ inherit_from: AllCops: ExtraDetails: true + DocumentationBaseURL: https://docs.rubocop.org/rubocop NewCops: enable SuggestExtensions: false Exclude: @@ -59,57 +60,51 @@ AllCops: - 'lib/tasks/deployment/2023*' # OVERRIDE .rubocop_todo.yml for these rules: -Lint/Debugger: - # Don't leave binding.pry or debugger +Lint/Debugger: # Don't leave binding.pry or debugger Enabled: true Exclude: [] inherit_mode: override: - Exclude -Rails/Output: - # Don't leave puts-debugging +Rails/Output: # Don't leave puts-debugging, use Rails.logger for logging Enabled: true Exclude: [] inherit_mode: override: - Exclude -Rails/FindEach: - # each could severely affect performance, use find_each +Rails/FindEach: # each could severely affect performance, use find_each Enabled: true Exclude: [] inherit_mode: override: - Exclude -Rails/UniqBeforePluck: - # uniq.pluck and not pluck.uniq +Rails/UniqBeforePluck: # uniq.pluck/distinct.pluck not pluck.uniq Enabled: true Exclude: [] inherit_mode: override: - Exclude -RSpec/Focus: - # ensure all tests run on CI +RSpec/Focus: # Ensure all tests run on CI Enabled: true Exclude: [] inherit_mode: override: - Exclude -# CUSTOMIZED RULES -# FactoryBot +# CUSTOM RULES (keep these simple please! see https://en.wikipedia.org/wiki/Law_of_triviality) FactoryBot/ConsistentParenthesesStyle: - # build/create are just method calls, no FactoryBot-specific rules needed + # build/create are just method calls, let base rubocop handle them (allows variation by context)! Enabled: false -# Rails Rails/DefaultScope: Enabled: true - Details: >- - Default scopes lead to unexpected behavior for future developers. + Details: |- + + Default scopes lead to unexpected behavior for future developers! Rails/OrderById: Enabled: true @@ -118,41 +113,46 @@ Rails/SaveBang: Enabled: true Include: - 'spec/**/*' - Details: >- - Specs should fail if setup record is invalid. + Details: |- + + Specs `should fail` if a setup record is invalid. -# RSpec RSpec/ExampleLength: CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] - Max: 15 # could be lower; default is 5 + Max: 15 Exclude: - 'spec/system/**/*' RSpec/LetSetup: - Details: >+ - let! leads to unnecessary database calls and obscures necessary setup. - Instead, call a let var in the example, before block, or let block of a variable that depends on it. - let(:necessary_thing) { create(:thing) } + # Only here for the extra details as let! use is extremely common... counter-examples? not so common! + Details: |- + + Using let! obscures test setup and leads to extra database calls. + Instead of `let!(:unreferenced_thing) { create(:thing) }` + Do shared setup in a before block: + before do + `create(:thing)` + end + OR do the setup in the example itself: + it "does something" do + `create(:thing)` + subject + ... + end + OR when needed for a another let variable, call in the let block of the dependant variable: + let(:necessary_thing) { `create(:thing)` } let(:dependent_thing) do - necessary_thing + `necessary_thing` create(:dependent_thing) end RSpec/MultipleExpectations: - # failures are aggregated by default (spec_helper.rb) - Max: 10 + Max: 10 # Allow because we can aggregate failures by default (spec_helper.rb) Exclude: - - 'spec/system/**/*' # async behaviors may require expecting things on page + - 'spec/system/**/*' # expensive per example & async behaviors require expect calls as setup RSpec/MultipleMemoizedHelpers: Max: 20 -RSpec/NamedSubject: - Enabled: false - RSpec/NestedGroups: Max: 5 - -RSpec/NotToNot: - # consistency only, no difference between to_not/not_to (these days) - Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 39ae1f7f28..24f3b39e87 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-23 03:26:08 UTC using RuboCop version 1.65.1. +# on 2024-10-23 17:21:24 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -1093,6 +1093,59 @@ RSpec/MultipleMemoizedHelpers: - 'spec/requests/case_contacts/form_spec.rb' - 'spec/system/supervisors/index_spec.rb' +# Offense count: 321 +# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. +# SupportedStyles: always, named_only +RSpec/NamedSubject: + Exclude: + - 'spec/datatables/supervisor_datatable_spec.rb' + - 'spec/datatables/volunteer_datatable_spec.rb' + - 'spec/decorators/contact_type_decorator_spec.rb' + - 'spec/helpers/court_dates_helper_spec.rb' + - 'spec/lib/tasks/supervisor_weekly_digest_spec.rb' + - 'spec/models/all_casa_admins/casa_org_metrics_spec.rb' + - 'spec/models/casa_admin_spec.rb' + - 'spec/models/case_contact_report_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/contact_type_group_spec.rb' + - 'spec/models/contact_type_spec.rb' + - 'spec/models/court_date_spec.rb' + - 'spec/models/followup_spec.rb' + - 'spec/models/supervisor_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/policies/casa_case_policy_spec.rb' + - 'spec/policies/court_date_policy_spec.rb' + - 'spec/policies/placement_policy_spec.rb' + - 'spec/requests/additional_expenses_spec.rb' + - 'spec/requests/all_casa_admins/casa_admins_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/requests/banners_spec.rb' + - 'spec/requests/bulk_court_dates_spec.rb' + - 'spec/requests/case_groups_spec.rb' + - 'spec/requests/contact_topic_answers_spec.rb' + - 'spec/requests/preference_sets_spec.rb' + - 'spec/requests/supervisor_volunteers_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/additional_expense_params_service_spec.rb' + - 'spec/services/casa_case_change_service_spec.rb' + - 'spec/services/case_contacts_contact_dates_spec.rb' + - 'spec/services/followup_export_csv_service_spec.rb' + - 'spec/services/inactive_messages_service_spec.rb' + - 'spec/services/mileage_export_csv_service_spec.rb' + - 'spec/services/preference_set_table_state_service_spec.rb' + - 'spec/system/case_contacts/additional_expenses_spec.rb' + - 'spec/system/case_contacts/contact_topic_answers_spec.rb' + - 'spec/system/case_contacts/index_spec.rb' + - 'spec/system/case_contacts/new_spec.rb' + - 'spec/values/banner_parameters_spec.rb' + - 'spec/values/case_contact_parameters_spec.rb' + - 'spec/values/volunteer_parameters_spec.rb' + - 'spec/views/layouts/application.html.erb_spec.rb' + - 'spec/views/volunteers/index.html.erb_spec.rb' + # Offense count: 10 # Configuration parameters: Max, AllowedGroups. RSpec/NestedGroups: @@ -1109,6 +1162,100 @@ RSpec/NoExpectationExample: - 'spec/system/casa_org/edit_spec.rb' - 'spec/system/supervisors/edit_spec.rb' +# Offense count: 254 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: not_to, to_not +RSpec/NotToNot: + Exclude: + - 'spec/components/modal/header_component_spec.rb' + - 'spec/components/modal/open_button_component_spec.rb' + - 'spec/components/modal/open_link_component_spec.rb' + - 'spec/components/truncated_text_component_spec.rb' + - 'spec/config/initializers/rack_attack_spec.rb' + - 'spec/helpers/notifications_helper_spec.rb' + - 'spec/lib/importers/case_importer_spec.rb' + - 'spec/lib/importers/supervisor_importer_spec.rb' + - 'spec/lib/importers/volunteer_importer_spec.rb' + - 'spec/mailers/casa_admin_mailer_spec.rb' + - 'spec/mailers/supervisor_mailer_spec.rb' + - 'spec/mailers/volunteer_mailer_spec.rb' + - 'spec/models/banner_spec.rb' + - 'spec/models/casa_org_spec.rb' + - 'spec/models/case_contact_spec.rb' + - 'spec/models/case_court_report_spec.rb' + - 'spec/models/case_group_spec.rb' + - 'spec/models/emancipation_option_spec.rb' + - 'spec/models/followup_spec.rb' + - 'spec/models/learning_hour_spec.rb' + - 'spec/models/learning_hour_topic_spec.rb' + - 'spec/models/learning_hour_type_spec.rb' + - 'spec/models/mileage_rate_spec.rb' + - 'spec/models/other_duty_spec.rb' + - 'spec/models/placement_spec.rb' + - 'spec/models/volunteer_spec.rb' + - 'spec/policies/application_policy_spec.rb' + - 'spec/policies/bulk_court_date_policy_spec.rb' + - 'spec/policies/casa_admin_policy_spec.rb' + - 'spec/policies/casa_case_policy_spec.rb' + - 'spec/policies/casa_org_policy_spec.rb' + - 'spec/policies/case_assignment_policy_spec.rb' + - 'spec/policies/checklist_item_policy_spec.rb' + - 'spec/policies/contact_topic_policy_spec.rb' + - 'spec/policies/contact_type_group_policy_spec.rb' + - 'spec/policies/contact_type_policy_spec.rb' + - 'spec/policies/hearing_type_policy_spec.rb' + - 'spec/policies/import_policy_spec.rb' + - 'spec/policies/judge_policy_spec.rb' + - 'spec/policies/notification_policy_spec.rb' + - 'spec/policies/reimbursement_policy_spec.rb' + - 'spec/policies/supervisor_policy_spec.rb' + - 'spec/policies/supervisor_volunteer_policy_spec.rb' + - 'spec/requests/all_casa_admins/patch_notes_spec.rb' + - 'spec/requests/all_casa_admins_spec.rb' + - 'spec/requests/casa_admins_spec.rb' + - 'spec/requests/case_court_reports_spec.rb' + - 'spec/requests/contact_topics_spec.rb' + - 'spec/requests/fund_requests_spec.rb' + - 'spec/requests/imports_spec.rb' + - 'spec/requests/mileage_rates_spec.rb' + - 'spec/requests/notes_spec.rb' + - 'spec/requests/notifications_spec.rb' + - 'spec/requests/other_duties_spec.rb' + - 'spec/requests/supervisors_spec.rb' + - 'spec/requests/users_spec.rb' + - 'spec/requests/volunteers_spec.rb' + - 'spec/services/backfill_followupable_service_spec.rb' + - 'spec/services/emancipation_checklist_reminder_service_spec.rb' + - 'spec/system/all_casa_admins/sessions/new_spec.rb' + - 'spec/system/banners/new_spec.rb' + - 'spec/system/casa_cases/additional_index_spec.rb' + - 'spec/system/casa_cases/edit_spec.rb' + - 'spec/system/casa_cases/show_spec.rb' + - 'spec/system/casa_org/edit_spec.rb' + - 'spec/system/case_contacts/drafts_spec.rb' + - 'spec/system/case_court_reports/index_spec.rb' + - 'spec/system/case_groups/case_groups_spec.rb' + - 'spec/system/devise/passwords/new_spec.rb' + - 'spec/system/emancipations/show_spec.rb' + - 'spec/system/other_duties/new_spec.rb' + - 'spec/system/reports/index_spec.rb' + - 'spec/system/sessions/new_spec.rb' + - 'spec/system/supervisors/edit_spec.rb' + - 'spec/system/volunteers/edit_spec.rb' + - 'spec/system/volunteers/new_spec.rb' + - 'spec/values/case_contact_parameters_spec.rb' + - 'spec/views/casa_cases/edit.html.erb_spec.rb' + - 'spec/views/casa_cases/index.html.erb_spec.rb' + - 'spec/views/casa_orgs/edit.html.erb_spec.rb' + - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' + - 'spec/views/layouts/header.html.erb_spec.rb' + - 'spec/views/layouts/sidebar.html.erb_spec.rb' + - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' + - 'spec/views/supervisors/edit.html.erb_spec.rb' + - 'spec/views/supervisors/index.html.erb_spec.rb' + - 'spec/views/volunteers/edit.html.erb_spec.rb' + # Offense count: 24 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ff24be772c..585e6c6b4f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -45,6 +45,7 @@ # --seed 1234 config.order = :random + # Aggregate failures by default. Not as useful for system specs, they need to fail fast. config.define_derived_metadata do |meta| meta[:aggregate_failures] = true unless meta[:type] == :system end From d2b90cb0bc1a74f7cf12e0a70e696c3bf351cb5e Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Wed, 23 Oct 2024 14:27:44 -0400 Subject: [PATCH 18/22] don't ignore comment disables, details change --- .github/workflows/ruby_lint.yml | 2 +- .rubocop.yml | 1 - bin/lint | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruby_lint.yml b/.github/workflows/ruby_lint.yml index f9c547609a..d9e7407079 100644 --- a/.github/workflows/ruby_lint.yml +++ b/.github/workflows/ruby_lint.yml @@ -30,4 +30,4 @@ jobs: bundler-cache: true - name: lint - run: bundle exec rubocop --ignore-disable-comments + run: bundle exec rubocop diff --git a/.rubocop.yml b/.rubocop.yml index 4fca33317d..886d510a0b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -42,7 +42,6 @@ inherit_from: <% end %> AllCops: - ExtraDetails: true DocumentationBaseURL: https://docs.rubocop.org/rubocop NewCops: enable SuggestExtensions: false diff --git a/bin/lint b/bin/lint index a4a256c0e2..12d48f9c3e 100755 --- a/bin/lint +++ b/bin/lint @@ -1,6 +1,6 @@ #!/usr/bin/env bash -bundle exec rubocop --autocorrect --ignore-disable-comments --extra-details +bundle exec rubocop --autocorrect --extra-details bundle exec erblint --lint-all --autocorrect yarn lint:fix echo "Linting Factories" From f3ef50a6430d55efb440de9b0bbcae2bc6a78f10 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Wed, 23 Oct 2024 14:34:58 -0400 Subject: [PATCH 19/22] don't exclude bin/ --- .rubocop.yml | 1 - .rubocop_todo.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 886d510a0b..139297a361 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -46,7 +46,6 @@ AllCops: NewCops: enable SuggestExtensions: false Exclude: - - 'bin/**/*' - 'db/migrate/2020*.rb' - 'db/migrate/2021*.rb' - 'db/migrate/2022*.rb' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 24f3b39e87..87cd7f2da2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-23 17:21:24 UTC using RuboCop version 1.65.1. +# on 2024-10-23 18:34:23 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new From 2047af0596d6eb3de194927f7d2933464034e57b Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Fri, 25 Oct 2024 22:56:00 -0400 Subject: [PATCH 20/22] remove Rails/OrderById --- .rubocop.yml | 3 --- .rubocop_todo.yml | 11 +---------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 139297a361..d92c88078c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -104,9 +104,6 @@ Rails/DefaultScope: Default scopes lead to unexpected behavior for future developers! -Rails/OrderById: - Enabled: true - Rails/SaveBang: Enabled: true Include: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 87cd7f2da2..1aae340c6f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-23 18:34:23 UTC using RuboCop version 1.65.1. +# on 2024-10-26 02:55:00 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -1844,15 +1844,6 @@ Rails/LexicallyScopedActionFilter: - 'app/controllers/placements_controller.rb' - 'app/controllers/users/sessions_controller.rb' -# Offense count: 8 -Rails/OrderById: - Exclude: - - 'app/datatables/volunteer_datatable.rb' - - 'app/models/learning_hours_report.rb' - - 'app/services/case_contacts_export_csv_service.rb' - - 'spec/datatables/volunteer_datatable_spec.rb' - - 'spec/models/casa_case_spec.rb' - # Offense count: 16 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/Pluck: From e46cb3cdc4a5047b9010fa8623ea352f4e188b72 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Mon, 4 Nov 2024 12:09:11 -0500 Subject: [PATCH 21/22] disable NamedSubject, LeadingSubject, NotToNot --- .rubocop.yml | 12 +++ .rubocop_todo.yml | 186 +--------------------------------------------- 2 files changed, 13 insertions(+), 185 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index d92c88078c..f2a0502d62 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -118,6 +118,10 @@ RSpec/ExampleLength: Exclude: - 'spec/system/**/*' +RSpec/LeadingSubject: + # Too many existing examples, style preference only + Enabled: false + RSpec/LetSetup: # Only here for the extra details as let! use is extremely common... counter-examples? not so common! Details: |- @@ -149,5 +153,13 @@ RSpec/MultipleExpectations: RSpec/MultipleMemoizedHelpers: Max: 20 +RSpec/NamedSubject: + # Too many existing examples for a slight gain in readability + Enabled: false + RSpec/NestedGroups: Max: 5 + +RSpec/NotToNot: + # consistency only, no difference between to_not/not_to + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1aae340c6f..08f5a5e3fc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-10-26 02:55:00 UTC using RuboCop version 1.65.1. +# on 2024-11-04 17:07:58 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -869,43 +869,6 @@ RSpec/ItBehavesLike: - 'spec/system/casa_admins/edit_spec.rb' - 'spec/system/supervisors/edit_spec.rb' -# Offense count: 59 -# This cop supports safe autocorrection (--autocorrect). -RSpec/LeadingSubject: - Exclude: - - 'spec/decorators/contact_type_decorator_spec.rb' - - 'spec/models/casa_case_spec.rb' - - 'spec/models/case_contact_report_spec.rb' - - 'spec/models/case_contact_spec.rb' - - 'spec/models/followup_spec.rb' - - 'spec/models/supervisor_spec.rb' - - 'spec/models/volunteer_spec.rb' - - 'spec/policies/additional_expense_policy_spec.rb' - - 'spec/policies/bulk_court_date_policy_spec.rb' - - 'spec/policies/case_group_policy_spec.rb' - - 'spec/policies/contact_topic_answer_policy_spec.rb' - - 'spec/policies/patch_note_policy_spec.rb' - - 'spec/requests/additional_expenses_spec.rb' - - 'spec/requests/all_casa_admins/casa_orgs_spec.rb' - - 'spec/requests/all_casa_admins/dashboard_spec.rb' - - 'spec/requests/all_casa_admins/sessions_spec.rb' - - 'spec/requests/bulk_court_dates_spec.rb' - - 'spec/requests/casa_org_spec.rb' - - 'spec/requests/case_assignments_spec.rb' - - 'spec/requests/case_contacts/followups_spec.rb' - - 'spec/requests/case_contacts/form_spec.rb' - - 'spec/requests/case_contacts_spec.rb' - - 'spec/requests/case_court_reports_spec.rb' - - 'spec/requests/case_groups_spec.rb' - - 'spec/requests/contact_topic_answers_spec.rb' - - 'spec/requests/emancipations_request_spec.rb' - - 'spec/requests/mileage_rates_spec.rb' - - 'spec/requests/supervisor_volunteers_spec.rb' - - 'spec/system/case_contacts/additional_expenses_spec.rb' - - 'spec/system/case_contacts/contact_topic_answers_spec.rb' - - 'spec/system/case_contacts/index_spec.rb' - - 'spec/system/case_contacts/new_spec.rb' - # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AutoCorrect. @@ -1093,59 +1056,6 @@ RSpec/MultipleMemoizedHelpers: - 'spec/requests/case_contacts/form_spec.rb' - 'spec/system/supervisors/index_spec.rb' -# Offense count: 321 -# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. -# SupportedStyles: always, named_only -RSpec/NamedSubject: - Exclude: - - 'spec/datatables/supervisor_datatable_spec.rb' - - 'spec/datatables/volunteer_datatable_spec.rb' - - 'spec/decorators/contact_type_decorator_spec.rb' - - 'spec/helpers/court_dates_helper_spec.rb' - - 'spec/lib/tasks/supervisor_weekly_digest_spec.rb' - - 'spec/models/all_casa_admins/casa_org_metrics_spec.rb' - - 'spec/models/casa_admin_spec.rb' - - 'spec/models/case_contact_report_spec.rb' - - 'spec/models/case_contact_spec.rb' - - 'spec/models/case_court_report_spec.rb' - - 'spec/models/contact_type_group_spec.rb' - - 'spec/models/contact_type_spec.rb' - - 'spec/models/court_date_spec.rb' - - 'spec/models/followup_spec.rb' - - 'spec/models/supervisor_spec.rb' - - 'spec/models/volunteer_spec.rb' - - 'spec/policies/application_policy_spec.rb' - - 'spec/policies/casa_case_policy_spec.rb' - - 'spec/policies/court_date_policy_spec.rb' - - 'spec/policies/placement_policy_spec.rb' - - 'spec/requests/additional_expenses_spec.rb' - - 'spec/requests/all_casa_admins/casa_admins_spec.rb' - - 'spec/requests/all_casa_admins_spec.rb' - - 'spec/requests/banners_spec.rb' - - 'spec/requests/bulk_court_dates_spec.rb' - - 'spec/requests/case_groups_spec.rb' - - 'spec/requests/contact_topic_answers_spec.rb' - - 'spec/requests/preference_sets_spec.rb' - - 'spec/requests/supervisor_volunteers_spec.rb' - - 'spec/requests/users_spec.rb' - - 'spec/requests/volunteers_spec.rb' - - 'spec/services/additional_expense_params_service_spec.rb' - - 'spec/services/casa_case_change_service_spec.rb' - - 'spec/services/case_contacts_contact_dates_spec.rb' - - 'spec/services/followup_export_csv_service_spec.rb' - - 'spec/services/inactive_messages_service_spec.rb' - - 'spec/services/mileage_export_csv_service_spec.rb' - - 'spec/services/preference_set_table_state_service_spec.rb' - - 'spec/system/case_contacts/additional_expenses_spec.rb' - - 'spec/system/case_contacts/contact_topic_answers_spec.rb' - - 'spec/system/case_contacts/index_spec.rb' - - 'spec/system/case_contacts/new_spec.rb' - - 'spec/values/banner_parameters_spec.rb' - - 'spec/values/case_contact_parameters_spec.rb' - - 'spec/values/volunteer_parameters_spec.rb' - - 'spec/views/layouts/application.html.erb_spec.rb' - - 'spec/views/volunteers/index.html.erb_spec.rb' - # Offense count: 10 # Configuration parameters: Max, AllowedGroups. RSpec/NestedGroups: @@ -1162,100 +1072,6 @@ RSpec/NoExpectationExample: - 'spec/system/casa_org/edit_spec.rb' - 'spec/system/supervisors/edit_spec.rb' -# Offense count: 254 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: not_to, to_not -RSpec/NotToNot: - Exclude: - - 'spec/components/modal/header_component_spec.rb' - - 'spec/components/modal/open_button_component_spec.rb' - - 'spec/components/modal/open_link_component_spec.rb' - - 'spec/components/truncated_text_component_spec.rb' - - 'spec/config/initializers/rack_attack_spec.rb' - - 'spec/helpers/notifications_helper_spec.rb' - - 'spec/lib/importers/case_importer_spec.rb' - - 'spec/lib/importers/supervisor_importer_spec.rb' - - 'spec/lib/importers/volunteer_importer_spec.rb' - - 'spec/mailers/casa_admin_mailer_spec.rb' - - 'spec/mailers/supervisor_mailer_spec.rb' - - 'spec/mailers/volunteer_mailer_spec.rb' - - 'spec/models/banner_spec.rb' - - 'spec/models/casa_org_spec.rb' - - 'spec/models/case_contact_spec.rb' - - 'spec/models/case_court_report_spec.rb' - - 'spec/models/case_group_spec.rb' - - 'spec/models/emancipation_option_spec.rb' - - 'spec/models/followup_spec.rb' - - 'spec/models/learning_hour_spec.rb' - - 'spec/models/learning_hour_topic_spec.rb' - - 'spec/models/learning_hour_type_spec.rb' - - 'spec/models/mileage_rate_spec.rb' - - 'spec/models/other_duty_spec.rb' - - 'spec/models/placement_spec.rb' - - 'spec/models/volunteer_spec.rb' - - 'spec/policies/application_policy_spec.rb' - - 'spec/policies/bulk_court_date_policy_spec.rb' - - 'spec/policies/casa_admin_policy_spec.rb' - - 'spec/policies/casa_case_policy_spec.rb' - - 'spec/policies/casa_org_policy_spec.rb' - - 'spec/policies/case_assignment_policy_spec.rb' - - 'spec/policies/checklist_item_policy_spec.rb' - - 'spec/policies/contact_topic_policy_spec.rb' - - 'spec/policies/contact_type_group_policy_spec.rb' - - 'spec/policies/contact_type_policy_spec.rb' - - 'spec/policies/hearing_type_policy_spec.rb' - - 'spec/policies/import_policy_spec.rb' - - 'spec/policies/judge_policy_spec.rb' - - 'spec/policies/notification_policy_spec.rb' - - 'spec/policies/reimbursement_policy_spec.rb' - - 'spec/policies/supervisor_policy_spec.rb' - - 'spec/policies/supervisor_volunteer_policy_spec.rb' - - 'spec/requests/all_casa_admins/patch_notes_spec.rb' - - 'spec/requests/all_casa_admins_spec.rb' - - 'spec/requests/casa_admins_spec.rb' - - 'spec/requests/case_court_reports_spec.rb' - - 'spec/requests/contact_topics_spec.rb' - - 'spec/requests/fund_requests_spec.rb' - - 'spec/requests/imports_spec.rb' - - 'spec/requests/mileage_rates_spec.rb' - - 'spec/requests/notes_spec.rb' - - 'spec/requests/notifications_spec.rb' - - 'spec/requests/other_duties_spec.rb' - - 'spec/requests/supervisors_spec.rb' - - 'spec/requests/users_spec.rb' - - 'spec/requests/volunteers_spec.rb' - - 'spec/services/backfill_followupable_service_spec.rb' - - 'spec/services/emancipation_checklist_reminder_service_spec.rb' - - 'spec/system/all_casa_admins/sessions/new_spec.rb' - - 'spec/system/banners/new_spec.rb' - - 'spec/system/casa_cases/additional_index_spec.rb' - - 'spec/system/casa_cases/edit_spec.rb' - - 'spec/system/casa_cases/show_spec.rb' - - 'spec/system/casa_org/edit_spec.rb' - - 'spec/system/case_contacts/drafts_spec.rb' - - 'spec/system/case_court_reports/index_spec.rb' - - 'spec/system/case_groups/case_groups_spec.rb' - - 'spec/system/devise/passwords/new_spec.rb' - - 'spec/system/emancipations/show_spec.rb' - - 'spec/system/other_duties/new_spec.rb' - - 'spec/system/reports/index_spec.rb' - - 'spec/system/sessions/new_spec.rb' - - 'spec/system/supervisors/edit_spec.rb' - - 'spec/system/volunteers/edit_spec.rb' - - 'spec/system/volunteers/new_spec.rb' - - 'spec/values/case_contact_parameters_spec.rb' - - 'spec/views/casa_cases/edit.html.erb_spec.rb' - - 'spec/views/casa_cases/index.html.erb_spec.rb' - - 'spec/views/casa_orgs/edit.html.erb_spec.rb' - - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' - - 'spec/views/layouts/header.html.erb_spec.rb' - - 'spec/views/layouts/sidebar.html.erb_spec.rb' - - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' - - 'spec/views/supervisors/edit.html.erb_spec.rb' - - 'spec/views/supervisors/index.html.erb_spec.rb' - - 'spec/views/volunteers/edit.html.erb_spec.rb' - # Offense count: 24 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. From 0e9e1b799ee51049a35aba76e663b2f522a11820 Mon Sep 17 00:00:00 2001 From: Jon Roberts Date: Thu, 14 Nov 2024 23:02:06 -0500 Subject: [PATCH 22/22] disable InferredSpecType considered deprecated, config to be removed by rspec-rails --- .rubocop.yml | 3 + .rubocop_todo.yml | 254 +--------------------------------------------- 2 files changed, 4 insertions(+), 253 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f2a0502d62..76ffcf29f3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -163,3 +163,6 @@ RSpec/NestedGroups: RSpec/NotToNot: # consistency only, no difference between to_not/not_to Enabled: false + +RSpecRails/InferredSpecType: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 08f5a5e3fc..fd157d4004 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` -# on 2024-11-04 17:07:58 UTC using RuboCop version 1.65.1. +# on 2024-11-15 04:00:21 UTC using RuboCop version 1.65.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -1247,258 +1247,6 @@ RSpecRails/HaveHttpStatus: - 'spec/requests/languages_spec.rb' - 'spec/requests/users_spec.rb' -# Offense count: 250 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Inferences. -RSpecRails/InferredSpecType: - Exclude: - - 'spec/controllers/application_controller_spec.rb' - - 'spec/controllers/concerns/accessible_spec.rb' - - 'spec/controllers/concerns/organizational_spec.rb' - - 'spec/controllers/concerns/users/time_zone_spec.rb' - - 'spec/controllers/emancipations_controller_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/helpers/emancipations_helper_spec.rb' - - 'spec/helpers/learning_hours_helper_spec.rb' - - 'spec/helpers/preference_sets_helper_spec.rb' - - 'spec/helpers/volunteer_helper_spec.rb' - - 'spec/mailers/casa_admin_mailer_spec.rb' - - 'spec/mailers/fund_request_mailer_spec.rb' - - 'spec/mailers/learning_hours_mailer_spec.rb' - - 'spec/mailers/supervisor_mailer_spec.rb' - - 'spec/mailers/user_mailer_spec.rb' - - 'spec/mailers/volunteer_mailer_spec.rb' - - 'spec/models/additional_expense_spec.rb' - - 'spec/models/address_spec.rb' - - 'spec/models/all_casa_admin_spec.rb' - - 'spec/models/all_casa_admins/casa_org_metrics_spec.rb' - - 'spec/models/banner_spec.rb' - - 'spec/models/casa_admin_spec.rb' - - 'spec/models/casa_case_contact_type_spec.rb' - - 'spec/models/casa_case_emancipation_category_spec.rb' - - 'spec/models/casa_case_spec.rb' - - 'spec/models/casa_cases_emancipation_option_spec.rb' - - 'spec/models/casa_org_spec.rb' - - 'spec/models/case_assignment_spec.rb' - - 'spec/models/case_contact_contact_type_spec.rb' - - 'spec/models/case_contact_report_spec.rb' - - 'spec/models/case_contact_spec.rb' - - 'spec/models/case_court_order_spec.rb' - - 'spec/models/case_court_report_context_spec.rb' - - 'spec/models/case_court_report_spec.rb' - - 'spec/models/case_group_membership_spec.rb' - - 'spec/models/case_group_spec.rb' - - 'spec/models/checklist_item_spec.rb' - - 'spec/models/contact_topic_answer_spec.rb' - - 'spec/models/contact_topic_spec.rb' - - 'spec/models/contact_type_group_spec.rb' - - 'spec/models/contact_type_spec.rb' - - 'spec/models/court_date_spec.rb' - - 'spec/models/emancipation_category_spec.rb' - - 'spec/models/emancipation_option_spec.rb' - - 'spec/models/followup_spec.rb' - - 'spec/models/health_spec.rb' - - 'spec/models/hearing_type_spec.rb' - - 'spec/models/judge_spec.rb' - - 'spec/models/language_spec.rb' - - 'spec/models/learning_hour_spec.rb' - - 'spec/models/learning_hour_topic_spec.rb' - - 'spec/models/learning_hour_type_spec.rb' - - 'spec/models/learning_hours_report_spec.rb' - - 'spec/models/login_activity_spec.rb' - - 'spec/models/mileage_rate_spec.rb' - - 'spec/models/mileage_report_spec.rb' - - 'spec/models/missing_data_report_spec.rb' - - 'spec/models/note_spec.rb' - - 'spec/models/other_duty_spec.rb' - - 'spec/models/patch_note_group_spec.rb' - - 'spec/models/patch_note_spec.rb' - - 'spec/models/patch_note_type_spec.rb' - - 'spec/models/placement_spec.rb' - - 'spec/models/placement_type_spec.rb' - - 'spec/models/preference_set_spec.rb' - - 'spec/models/sent_email_spec.rb' - - 'spec/models/sms_notification_event_spec.rb' - - 'spec/models/supervisor_spec.rb' - - 'spec/models/user_language_spec.rb' - - 'spec/models/user_reminder_time.rb' - - 'spec/models/user_sms_notification_event_spec.rb' - - 'spec/models/user_spec.rb' - - 'spec/models/volunteer_spec.rb' - - 'spec/requests/additional_expenses_spec.rb' - - 'spec/requests/all_casa_admins/casa_orgs_spec.rb' - - 'spec/requests/all_casa_admins/dashboard_spec.rb' - - 'spec/requests/all_casa_admins/patch_notes_spec.rb' - - 'spec/requests/all_casa_admins/sessions_spec.rb' - - 'spec/requests/all_casa_admins_spec.rb' - - 'spec/requests/android_app_associations_spec.rb' - - 'spec/requests/api/v1/base_spec.rb' - - 'spec/requests/api/v1/users/sessions_spec.rb' - - 'spec/requests/banners_spec.rb' - - 'spec/requests/bulk_court_dates_spec.rb' - - 'spec/requests/casa_admins_spec.rb' - - 'spec/requests/casa_cases_spec.rb' - - 'spec/requests/casa_org_spec.rb' - - 'spec/requests/case_assignments_spec.rb' - - 'spec/requests/case_contact_reports_spec.rb' - - 'spec/requests/case_contacts/followups_spec.rb' - - 'spec/requests/case_contacts/form_spec.rb' - - 'spec/requests/case_contacts_spec.rb' - - 'spec/requests/case_court_orders_spec.rb' - - 'spec/requests/case_court_reports_spec.rb' - - 'spec/requests/case_groups_spec.rb' - - 'spec/requests/checklist_items_spec.rb' - - 'spec/requests/contact_topic_answers_spec.rb' - - 'spec/requests/contact_topics_spec.rb' - - 'spec/requests/contact_type_groups_spec.rb' - - 'spec/requests/contact_types_spec.rb' - - 'spec/requests/court_dates_spec.rb' - - 'spec/requests/dashboard_spec.rb' - - 'spec/requests/emancipation_checklists_spec.rb' - - 'spec/requests/emancipations_request_spec.rb' - - 'spec/requests/error_spec.rb' - - 'spec/requests/fund_requests_spec.rb' - - 'spec/requests/health_spec.rb' - - 'spec/requests/hearing_types_spec.rb' - - 'spec/requests/imports_spec.rb' - - 'spec/requests/judges_spec.rb' - - 'spec/requests/languages_spec.rb' - - 'spec/requests/learning_hours_reports_spec.rb' - - 'spec/requests/learning_hours_spec.rb' - - 'spec/requests/mileage_rates_spec.rb' - - 'spec/requests/missing_data_reports_spec.rb' - - 'spec/requests/notes_spec.rb' - - 'spec/requests/notifications_spec.rb' - - 'spec/requests/other_duties_spec.rb' - - 'spec/requests/placement_reports_spec.rb' - - 'spec/requests/preference_sets_spec.rb' - - 'spec/requests/reimbursements_spec.rb' - - 'spec/requests/reports_spec.rb' - - 'spec/requests/static_spec.rb' - - 'spec/requests/supervisor_volunteers_spec.rb' - - 'spec/requests/supervisors_spec.rb' - - 'spec/requests/users/passwords_spec.rb' - - 'spec/requests/users_spec.rb' - - 'spec/requests/volunteers_spec.rb' - - 'spec/routing/all_casa_admins/patch_notes_routing_spec.rb' - - 'spec/system/all_casa_admins/all_casa_admin_spec.rb' - - 'spec/system/all_casa_admins/patch_notes/index_spec.rb' - - 'spec/system/all_casa_admins/sessions/new_spec.rb' - - 'spec/system/application/timeout_warning_spec.rb' - - 'spec/system/banners/dismiss_spec.rb' - - 'spec/system/banners/new_spec.rb' - - 'spec/system/bulk_court_dates/new_spec.rb' - - 'spec/system/casa_admins/edit_spec.rb' - - 'spec/system/casa_admins/index_spec.rb' - - 'spec/system/casa_admins/new_spec.rb' - - 'spec/system/casa_cases/additional_index_spec.rb' - - 'spec/system/casa_cases/edit_spec.rb' - - 'spec/system/casa_cases/emancipation/show_spec.rb' - - 'spec/system/casa_cases/fund_requests/new_spec.rb' - - 'spec/system/casa_cases/index_spec.rb' - - 'spec/system/casa_cases/new_spec.rb' - - 'spec/system/casa_cases/show_more_spec.rb' - - 'spec/system/casa_cases/show_spec.rb' - - 'spec/system/casa_org/edit_spec.rb' - - 'spec/system/case_contacts/additional_expenses_spec.rb' - - 'spec/system/case_contacts/contact_topic_answers_spec.rb' - - 'spec/system/case_contacts/drafts_spec.rb' - - 'spec/system/case_contacts/edit_spec.rb' - - 'spec/system/case_contacts/followups/create_spec.rb' - - 'spec/system/case_contacts/followups/resolve_spec.rb' - - 'spec/system/case_contacts/index_spec.rb' - - 'spec/system/case_contacts/new_spec.rb' - - 'spec/system/case_court_reports/index_spec.rb' - - 'spec/system/case_groups/case_groups_spec.rb' - - 'spec/system/checklist_items/destroy_spec.rb' - - 'spec/system/checklist_items/edit_spec.rb' - - 'spec/system/checklist_items/new_spec.rb' - - 'spec/system/components/truncated_text_component_spec.rb' - - 'spec/system/contact_types/edit_spec.rb' - - 'spec/system/contact_types/new_spec.rb' - - 'spec/system/court_dates/edit_spec.rb' - - 'spec/system/court_dates/new_spec.rb' - - 'spec/system/court_dates/view_spec.rb' - - 'spec/system/dashboard/show_spec.rb' - - 'spec/system/deep_link/deep_link_spec.rb' - - 'spec/system/devise/passwords/new_spec.rb' - - 'spec/system/emancipations/show_spec.rb' - - 'spec/system/hearing_types/new_spec.rb' - - 'spec/system/imports/index_spec.rb' - - 'spec/system/judges/new_spec.rb' - - 'spec/system/languages/languages_spec.rb' - - 'spec/system/learning_hours/edit_spec.rb' - - 'spec/system/learning_hours/index_spec.rb' - - 'spec/system/learning_hours/new_spec.rb' - - 'spec/system/learning_hours/volunteers/show_spec.rb' - - 'spec/system/mileage_rates/mileage_rates_spec.rb' - - 'spec/system/notifications/index_spec.rb' - - 'spec/system/other_duties/new_spec.rb' - - 'spec/system/placements/destroy_spec.rb' - - 'spec/system/placements/edit_spec.rb' - - 'spec/system/placements/index_spec.rb' - - 'spec/system/placements/new_spec.rb' - - 'spec/system/reimbursements/reimbursements_spec.rb' - - 'spec/system/reports/export_data_spec.rb' - - 'spec/system/reports/index_spec.rb' - - 'spec/system/sessions/destroy_spec.rb' - - 'spec/system/sessions/login_spec.rb' - - 'spec/system/sessions/new_spec.rb' - - 'spec/system/static/index_spec.rb' - - 'spec/system/supervisors/edit_spec.rb' - - 'spec/system/supervisors/index_spec.rb' - - 'spec/system/supervisors/new_spec.rb' - - 'spec/system/users/edit_spec.rb' - - 'spec/system/volunteers/edit_spec.rb' - - 'spec/system/volunteers/index_spec.rb' - - 'spec/system/volunteers/new_spec.rb' - - 'spec/system/volunteers/notes/edit_spec.rb' - - 'spec/views/all_casa_admins/casa_orgs/new.html.erb_spec.rb' - - 'spec/views/all_casa_admins/casa_orgs/show.html.erb_spec.rb' - - 'spec/views/all_casa_admins/patch_notes/index.html.erb_spec.rb' - - 'spec/views/banners/new.html.erb_spec.rb' - - 'spec/views/bulk_court_date/new.html.erb_spec.rb' - - 'spec/views/casa_admins/admins_table.html.erb_spec.rb' - - 'spec/views/casa_admins/edit.html.erb_spec.rb' - - 'spec/views/casa_cases/edit.html.erb_spec.rb' - - 'spec/views/casa_cases/index.html.erb_spec.rb' - - 'spec/views/casa_cases/new.html.erb_spec.rb' - - 'spec/views/casa_cases/show.html.erb_spec.rb' - - 'spec/views/casa_orgs/edit.html.erb_spec.rb' - - 'spec/views/case_contacts/case_contact.html.erb_spec.rb' - - 'spec/views/case_contacts/index.html.erb_spec.rb' - - 'spec/views/case_court_reports/index.html.erb_spec.rb' - - 'spec/views/checklist_items/edit.html.erb_spec.rb' - - 'spec/views/checklist_items/new.html.erb_spec.rb' - - 'spec/views/court_dates/edit.html.erb_spec.rb' - - 'spec/views/court_dates/new.html.erb_spec.rb' - - 'spec/views/court_dates/show.html.erb_spec.rb' - - 'spec/views/devise/passwords/new.html.erb_spec.rb' - - 'spec/views/emancipations/show.html.erb_spec.rb' - - 'spec/views/hearing_types/edit.html.erb_spec.rb' - - 'spec/views/hearing_types/new.html.erb_spec.rb' - - 'spec/views/judges/new.html.erb_spec.rb' - - 'spec/views/layouts/application.html.erb_spec.rb' - - 'spec/views/layouts/footer.html.erb_spec.rb' - - 'spec/views/layouts/header.html.erb_spec.rb' - - 'spec/views/layouts/sidebar.html.erb_spec.rb' - - 'spec/views/mileage_rates/index.html.erb_spec.rb' - - 'spec/views/notifications/index.html.erb_spec.rb' - - 'spec/views/other_duties/edit.html.erb_spec.rb' - - 'spec/views/other_duties/new.html.erb_spec.rb' - - 'spec/views/placements/edit.html.erb_spec.rb' - - 'spec/views/placements/index.html.erb_spec.rb' - - 'spec/views/placements/new.html.erb_spec.rb' - - 'spec/views/reimbursements/index.html.erb_spec.rb' - - 'spec/views/supervisor_mailer/weekly_digest.html.erb_spec.rb' - - 'spec/views/supervisors/edit.html.erb_spec.rb' - - 'spec/views/supervisors/index.html.erb_spec.rb' - - 'spec/views/supervisors/new.html.erb_spec.rb' - - 'spec/views/templates/email_templates_spec.rb' - - 'spec/views/volunteers/edit.html.erb_spec.rb' - - 'spec/views/volunteers/index.html.erb_spec.rb' - - 'spec/views/volunteers/new.html.erb_spec.rb' - # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). RSpecRails/MinitestAssertions: