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/.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..76ffcf29f3 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,168 @@ +# Config adapted from: +# https://evilmartians.com/chronicles/rubocoping-with-legacy-bring-your-ruby-code-up-to-standard + +# To fix the file with the most offenses: +# - 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 by rule instead: +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop --format offenses +# - BYPASS_RUBOCOP_TODO=1 bundle exec rubocop -A --only Department/Cop + +# 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: + merge: + - Exclude + +require: + - standard + - standard-custom + - standard-performance + - rubocop-capybara + - rubocop-factory_bot + - rubocop-performance + - rubocop-rails + - rubocop-rspec + - 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 + standard-rails: config/base.yml + +inherit_from: +<% unless ENV['BYPASS_RUBOCOP_TODO'] %> + - .rubocop_todo.yml +<% end %> + +AllCops: + DocumentationBaseURL: https://docs.rubocop.org/rubocop + NewCops: enable + SuggestExtensions: false + Exclude: + - '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 .rubocop_todo.yml for these rules: +Lint/Debugger: # Don't leave binding.pry or debugger + Enabled: true + Exclude: [] + inherit_mode: + override: + - Exclude + +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 + Enabled: true + Exclude: [] + inherit_mode: + override: + - Exclude + +Rails/UniqBeforePluck: # uniq.pluck/distinct.pluck not pluck.uniq + Enabled: true + Exclude: [] + inherit_mode: + override: + - Exclude + +RSpec/Focus: # Ensure all tests run on CI + Enabled: true + Exclude: [] + inherit_mode: + override: + - Exclude + +# CUSTOM RULES (keep these simple please! see https://en.wikipedia.org/wiki/Law_of_triviality) +FactoryBot/ConsistentParenthesesStyle: + # build/create are just method calls, let base rubocop handle them (allows variation by context)! + Enabled: false + +Rails/DefaultScope: + Enabled: true + Details: |- + + Default scopes lead to unexpected behavior for future developers! + +Rails/SaveBang: + Enabled: true + Include: + - 'spec/**/*' + Details: |- + + Specs `should fail` if a setup record is invalid. + +RSpec/ExampleLength: + CountAsOne: ['array', 'hash', 'heredoc', 'method_call'] + Max: 15 + 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: |- + + 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` + create(:dependent_thing) + end + +RSpec/MultipleExpectations: + Max: 10 # Allow because we can aggregate failures by default (spec_helper.rb) + Exclude: + - 'spec/system/**/*' # expensive per example & async behaviors require expect calls as setup + +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 + +RSpecRails/InferredSpecType: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000000..fd157d4004 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,1603 @@ +# This configuration was generated by +# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit` +# 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 +# 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: 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: 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: + - '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: 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: 19 +# 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: 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/requests/all_casa_admins_spec.rb' + - 'spec/system/sessions/new_spec.rb' + +# Offense count: 6 +RSpec/RepeatedExample: + Exclude: + - 'spec/helpers/sidebar_helper_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: 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' + - '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: 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' + +# 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: 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: 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: 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: + 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/.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/.yamllint.yml b/.yamllint.yml index 90e6330084..4393aab89e 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -1,6 +1,10 @@ extends: default -ignore-from-file: .gitignore +ignore: + - .rubocop_todo.yml # generated by rubocop + - .rubocop.yml # <% ... %> breaks yamllint, cannot be comment-disabled + - .git + - node_modules rules: document-start: diff --git a/Gemfile b/Gemfile index 3a8ae07cd6..7d0608f359 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,17 @@ 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-capybara", require: false + gem "rubocop-factory_bot", 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 2db9cbdcac..df867d028e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -470,9 +470,23 @@ 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-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) + 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) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) ruby-vips (2.2.2) ffi (~> 1.12) @@ -526,6 +540,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) @@ -648,6 +665,13 @@ DEPENDENCIES rswag-api rswag-specs rswag-ui + rubocop + rubocop-capybara + rubocop-factory_bot + rubocop-performance + rubocop-rails + rubocop-rspec + rubocop-rspec_rails sablon scout_apm selenium-webdriver @@ -656,7 +680,8 @@ DEPENDENCIES spring spring-commands-rspec sprockets-rails - standard (~> 1.40.0) + standard + standard-rails stimulus-rails strong_migrations traceroute 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/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/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/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 diff --git a/bin/lint b/bin/lint index d82099237e..12d48f9c3e 100755 --- a/bin/lint +++ b/bin/lint @@ -1,6 +1,6 @@ #!/usr/bin/env bash -bundle exec standardrb --fix --format progress +bundle exec rubocop --autocorrect --extra-details 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/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/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") 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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fd672a2981..585e6c6b4f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -45,5 +45,10 @@ # --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 + RSpec::Matchers.define_negated_matcher :not_change, :change end