Skip to content

Commit

Permalink
created a todo list to ignore for now, to be fixed in future
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahcrack committed Nov 18, 2024
1 parent 2649c4e commit c6abf19
Show file tree
Hide file tree
Showing 317 changed files with 2,476 additions and 1,971 deletions.
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
inherit_from: .rubocop_todo.yml

require:
- rubocop-rspec
- rubocop-capybara
Expand Down Expand Up @@ -108,3 +110,8 @@ Rails/TimeZone:

Rails/Date:
Enabled: false

AllCops:
Exclude:
- "node_modules/**/*"
- "vendor/**/*"
241 changes: 241 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-11-18 15:25:34 UTC using RuboCop version 1.68.0.
# 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: 41
# This cop supports safe autocorrection (--autocorrect).
Capybara/CurrentPathExpectation:
Enabled: false

# Offense count: 1
Capybara/VisibilityMatcher:
Exclude:
- 'features/step_definitions/candidates/schools/filtering_steps.rb'

# Offense count: 1
# Configuration parameters: DebuggerMethods, DebuggerRequires.
Lint/Debugger:
Exclude:
- 'features/step_definitions/common_steps.rb'

# Offense count: 88
RSpec/AnyInstance:
Enabled: false

# Offense count: 616
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false

# Offense count: 73
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Max: 31

# Offense count: 4
RSpec/ExpectInHook:
Exclude:
- 'spec/controllers/candidates/registrations/sign_ins_controller_spec.rb'
- 'spec/jobs/notify_job_spec.rb'
- 'spec/services/bookings/gitis/school_experience_spec.rb'

# Offense count: 36
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
RSpec/IndexedLet:
Exclude:
- 'spec/helpers/candidates/school_helper_spec.rb'
- 'spec/jobs/cron/identify_closed_schools_job_spec.rb'
- 'spec/models/bookings/data/gias_reconciler_spec.rb'
- 'spec/models/bookings/data/school_updater_spec.rb'
- 'spec/models/bookings/placement_request_spec.rb'
- 'spec/models/candidates/school_search_spec.rb'
- 'spec/models/schools/attendance_spec.rb'
- 'spec/services/schools/dfe_sign_in_api/role_checked_organisations_spec.rb'

# Offense count: 89
# Configuration parameters: AssignmentOnly.
RSpec/InstanceVariable:
Enabled: false

# Offense count: 72
RSpec/LetSetup:
Enabled: false

# Offense count: 4
RSpec/MessageChain:
Exclude:
- 'spec/models/bookings/placement_date_spec.rb'
- 'spec/services/candidates/registrations/dbs_requirments_checker_spec.rb'

# Offense count: 21
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Exclude:
- 'spec/controllers/schools/sessions_controller_spec.rb'
- 'spec/jobs/cron/identify_closed_schools_job_spec.rb'
- 'spec/lib/notify/notify_sync_spec.rb'
- 'spec/models/bookings/booking_spec.rb'
- 'spec/models/bookings/school_search_spec.rb'
- 'spec/services/schools/dfe_sign_in_api/user_invite_spec.rb'
- 'spec/validators/website_validator_spec.rb'

# Offense count: 2
RSpec/MultipleDescribes:
Exclude:
- 'spec/jobs/notify_job_spec.rb'
- 'spec/notify/notify_despatchers/notify_spec.rb'

# Offense count: 164
RSpec/MultipleExpectations:
Max: 11

# Offense count: 362
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 15

# Offense count: 1285
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Enabled: false

# Offense count: 706
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 6

# Offense count: 4
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/features/candidates/api_registrations_spec.rb'
- 'spec/services/bookings/gitis/school_experience_spec.rb'

# Offense count: 2
RSpec/OverwritingSetup:
Exclude:
- 'spec/forms/schools/placement_dates/placement_detail_spec.rb'
- 'spec/models/schools/change_school_spec.rb'

# Offense count: 6
RSpec/PendingWithoutReason:
Exclude:
- 'spec/controllers/healthchecks_controller_spec.rb'

# Offense count: 10
RSpec/RepeatedDescription:
Exclude:
- 'spec/controllers/schools/placement_requests_controller_spec.rb'
- 'spec/views/candidates/registrations/personal_informations/_form.html.erb_spec.rb'

# Offense count: 5
RSpec/RepeatedExample:
Exclude:
- 'spec/models/bookings/school_search_spec.rb'
- 'spec/services/bookings/gitis/missing_contact_spec.rb'

# Offense count: 2
RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/services/candidates/registrations/dbs_requirments_checker_spec.rb'

# Offense count: 14
RSpec/RepeatedExampleGroupDescription:
Exclude:
- 'spec/controllers/healthchecks_controller_spec.rb'
- 'spec/lib/conversions_spec.rb'
- 'spec/models/bookings/booking_spec.rb'
- 'spec/models/bookings/schools_phase_spec.rb'
- 'spec/models/cookie_preference_spec.rb'
- 'spec/presenters/candidates/school_presenter_spec.rb'
- 'spec/services/candidates/registrations/subject_and_date_information_spec.rb'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AutoCorrect.
RSpec/ScatteredSetup:
Exclude:
- 'spec/controllers/schools/placement_requests_controller_spec.rb'

# Offense count: 5
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
# Include: **/*_spec.rb
RSpec/SpecFilePathFormat:
Exclude:
- 'spec/controllers/features_controller_spec.rb'
- 'spec/controllers/schools/contact_us_spec.rb'
- 'spec/controllers/schools/switch_controller_spec.rb'
- 'spec/jobs/cron/send_entity_table_checks_to_bigquery_spec.rb'
- 'spec/notify/notify_email/candidate_booking_feedback_spec.rb'

# Offense count: 1
RSpec/StubbedMock:
Exclude:
- 'spec/services/bookings/reminder_spec.rb'

# Offense count: 50
RSpec/SubjectStub:
Exclude:
- 'spec/forms/schools/placement_dates/placement_detail_spec.rb'
- 'spec/lib/notify/notify_sync_spec.rb'
- 'spec/models/bookings/data/gias_data_file_spec.rb'
- 'spec/models/bookings/placement_request_spec.rb'
- 'spec/models/bookings/school_search_spec.rb'
- 'spec/models/bookings/school_spec.rb'
- 'spec/models/bookings/school_sync_spec.rb'
- 'spec/presenters/candidates/placement_presenter_spec.rb'
- 'spec/services/candidates/registrations/subject_and_date_information_spec.rb'
- 'spec/services/schools/dfe_sign_in_api/client_spec.rb'
- 'spec/services/schools/dfe_sign_in_api/organisation_spec.rb'
- 'spec/services/schools/dfe_sign_in_api/organisations_spec.rb'
- 'spec/services/schools/dfe_sign_in_api/roles_spec.rb'
- 'spec/support/registration_step_shared_examples.rb'

# Offense count: 43
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Enabled: false

# Offense count: 36
# Configuration parameters: Database, Include.
# SupportedDatabases: mysql, postgresql
# Include: db/**/*.rb
Rails/BulkChangeTable:
Enabled: false

# Offense count: 8
# Configuration parameters: Database, Include.
# SupportedDatabases: mysql
# Include: db/**/*.rb
Rails/NotNullColumn:
Exclude:
- 'db/migrate/20190131110800_add_importable_fields_to_bookings_schools.rb'
- 'db/migrate/20190205091721_add_bookings_school_type_id_to_bookings_schools.rb'
- 'db/migrate/20190225114124_add_availability_to_placement_requests.rb'
- 'db/migrate/20190417081149_add_bookings_school_id_to_schools_school_profile.rb'
- 'db/migrate/20190426154201_link_bookings_placement_dates_to_bookings_schools.rb'
- 'db/migrate/20190524133255_add_cancelled_by_to_cancellations.rb'

# Offense count: 12
# Configuration parameters: Include.
# Include: db/**/*.rb
Rails/ReversibleMigration:
Exclude:
- 'db/migrate/20190125085522_make_bookings_schools_fees_default_to_zero.rb'
- 'db/migrate/20190125144531_make_subject_and_phase_names_not_nullable.rb'
- 'db/migrate/20190225092622_remove_access_needs_and_access_needs_details_from_candidates_registrations_placmenet_requests.rb'
- 'db/migrate/20190418180420_allow_bookings_placement_requests_availability_to_be_null.rb'
- 'db/migrate/20190426154201_link_bookings_placement_dates_to_bookings_schools.rb'
- 'db/migrate/20190510173936_allow_null_for_bookings_profiles_experience_details.rb'
- 'db/migrate/20190628082805_set_bookings_schools_enabeld_flag_to_false_by_default.rb'
- 'db/migrate/20190724092556_make_bookings_school_contact_email_not_null.rb'
- 'db/migrate/20190820073225_make_bookings_profile_dbs_required_nullable.rb'
- 'db/migrate/20191031105854_remove_column_default_from_bookings_placement_dates_subject_specific.rb'
2 changes: 1 addition & 1 deletion app/models/bookings/booking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def populate_contact_details
delegate :status, to: :bookings_placement_request

def placement_start_date_with_duration
if bookings_placement_request&.placement_date&.present?
if bookings_placement_request&.placement_date.present?
[date.to_formatted_s(:govuk), 'for', duration_days].join(' ')
else
date.to_formatted_s(:govuk)
Expand Down
2 changes: 1 addition & 1 deletion app/models/bookings/data/school_mass_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def cleanup_website(urn, url)
return nil if url_with_prefix =~ /@/

# skip urls that don't look sensible
unless url_with_prefix.match?(/^(http|https):\/\/[a-z0-9]+([\-.]{1}[a-z0-9]+)*\.[a-z]{2,10}(:[0-9]{1,5})?(\/.*)?$/ix)
unless url_with_prefix.match?(/^(http|https):\/\/[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,10}(:[0-9]{1,5})?(\/.*)?$/ix)
Rails.logger.info "invalid website for #{urn}, #{url}"
return nil
end
Expand Down
2 changes: 1 addition & 1 deletion app/services/bookings/gitis/school_experience.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def from_cancellation(cancellation, status)
date: (cancellation.booking || cancellation.placement_request.placement_date)&.date,
urn: cancellation.school_urn,
school_name: cancellation.school_name,
teaching_subject_name: (cancellation.booking&.bookings_subject&.name || cancellation.placement_request.subject_first_choice),
teaching_subject_name: cancellation.booking&.bookings_subject&.name || cancellation.placement_request.subject_first_choice,
duration: (cancellation.booking || cancellation.placement_request.placement_date)&.duration,
status: status
)
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/filter_active_job_logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

unless Rails.env.development?
class ActiveJob::Logging::LogSubscriber
# activejob-5.2.3/lib/active_job/logging.rb
# activejob-5.2.3/lib/active_job/logging.rb

private

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class AddUniqueIndexToBookingsSchoolsSubjects < ActiveRecord::Migration[5.2]
def change
add_index :bookings_schools_subjects,
%i{bookings_school_id bookings_subject_id},
%i[bookings_school_id bookings_subject_id],
unique: true,
name: "index_bookings_schools_subjects_school_id_and_subject_id"
end
Expand Down
2 changes: 1 addition & 1 deletion db/migrate/20190205164245_create_delayed_jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def self.up
table.timestamps null: true
end

add_index :delayed_jobs, [:priority, :run_at], name: "delayed_jobs_priority"
add_index :delayed_jobs, %i[priority run_at], name: "delayed_jobs_priority"
end

def self.down
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class CreateSchoolsSchoolProfiles < ActiveRecord::Migration[5.2]
def change
create_table :schools_school_profiles do |t|

t.timestamps
t.integer :urn, null: false
t.string :candidate_requirement_dbs_requirement
Expand Down
6 changes: 3 additions & 3 deletions db/migrate/20190430134049_remove_phases_subjects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ def change
t.bigint "bookings_subject_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["bookings_phase_id"], name: "index_schools_on_boarding_phase_subjects_on_bookings_phase_id"
t.index ["bookings_subject_id"], name: "index_schools_on_boarding_phase_subjects_on_bookings_subject_id"
t.index ["schools_school_profile_id"], name: "index_phase_subjects_on_school_profile_id"
t.index %w[bookings_phase_id], name: "index_schools_on_boarding_phase_subjects_on_bookings_phase_id"
t.index %w[bookings_subject_id], name: "index_schools_on_boarding_phase_subjects_on_bookings_subject_id"
t.index %w[schools_school_profile_id], name: "index_phase_subjects_on_school_profile_id"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def change
add_column :bookings_bookings, :placement_details, :text, null: true

add_column :bookings_bookings, :contact_name, :string, null: true
add_column :bookings_bookings, :contact_number, :string, null: true
add_column :bookings_bookings, :contact_number, :string, null: true
add_column :bookings_bookings, :contact_email, :string, null: true
add_column :bookings_bookings, :location, :text, null: true

Expand Down
Loading

0 comments on commit c6abf19

Please sign in to comment.