Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 1 addition & 109 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit`
# on 2026-07-28 13:09:10 UTC using RuboCop version 1.88.2.
# on 2026-07-28 13:24:16 UTC using RuboCop version 1.88.2.
# 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
Expand Down Expand Up @@ -28,12 +28,6 @@ Lint/AmbiguousBlockAssociation:
- 'spec/models/feedback_spec.rb'
- 'spec/services/three_month_email_service_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperator:
Exclude:
- 'spec/controllers/admin/workshops_controller_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowSafeAssignment.
Expand Down Expand Up @@ -62,12 +56,6 @@ Lint/MissingSuper:
Exclude:
- 'app/components/event_card_component.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/RedundantStringCoercion:
Exclude:
- 'spec/features/admin/sponsor_spec.rb'

# Offense count: 1
# Configuration parameters: AllowKeywordBlockArguments.
Lint/UnderscorePrefixedVariableName:
Expand Down Expand Up @@ -273,12 +261,6 @@ RSpec/AnyInstance:
- 'spec/controllers/member/details_controller_spec.rb'
- 'spec/support/helpers/login_helpers.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/BeEmpty:
Exclude:
- 'spec/presenters/event_presenter_spec.rb'

# Offense count: 25
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/BeEq:
Expand All @@ -294,13 +276,6 @@ RSpec/BeEq:
- 'spec/presenters/workshop_presenter_spec.rb'
- 'spec/support/shared_examples/behaves_like_an_invitation_route.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: NegatedMatcher.
RSpec/ChangeByZero:
Exclude:
- 'spec/controllers/admin/sponsors_controller_spec.rb'

# Offense count: 67
# This cop supports safe autocorrection (--autocorrect).
RSpec/ContextMethod:
Expand Down Expand Up @@ -515,14 +490,6 @@ RSpec/InstanceVariable:
- 'spec/features/admin/add_user_to_workshop_spec.rb'
- 'spec/features/member_feedback_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/models/workshop_spec.rb'

# Offense count: 1
RSpec/LeakyConstantDeclaration:
Exclude:
Expand Down Expand Up @@ -773,14 +740,6 @@ Rails/Blank:
- 'app/controllers/application_controller.rb'
- 'lib/omniauth/strategies/codebar.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Rails/FilePath:
Exclude:
- 'spec/controllers/admin/sponsors_controller_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Expand Down Expand Up @@ -870,71 +829,19 @@ Rails/UniqueValidationWithoutIndex:
- 'app/models/workshop_invitation.rb'
- 'app/models/workshop_sponsor.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Keywords, RequireColon.
# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE
Style/CommentAnnotation:
Exclude:
- 'spec/services/invitation_manager_spec.rb'

# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
Style/DefWithParentheses:
Exclude:
- 'app/helpers/email_header_helper.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/ExpandPathArguments:
Exclude:
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: braces, no_braces
Style/HashAsLastArrayItem:
Exclude:
- 'app/models/sponsor.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: InverseMethods, InverseBlocks.
Style/InverseMethods:
Exclude:
- 'app/controllers/admin/chapters_controller.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: line_count_dependent, lambda, literal
Style/Lambda:
Exclude:
- 'app/models/workshop_invitation.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/LineEndConcatenation:
Exclude:
- 'spec/presenters/address_presenter_spec.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: both, prefix, postfix
Style/NegatedIf:
Exclude:
- 'lib/tasks/setup.rake'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedOctalStyle.
# SupportedOctalStyles: zero_with_o, zero_only
Style/NumericLiteralPrefix:
Exclude:
- 'spec/features/admin/workshops_spec.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
Expand All @@ -958,21 +865,6 @@ Style/RedundantInterpolation:
- 'script/benchmark_events.rb'
- 'spec/features/admin/sponsor_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleReturnValues.
Style/RedundantReturn:
Exclude:
- 'lib/omniauth/strategies/codebar.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/email_header_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module EmailHeaderHelper
class SkippedEmail
def deliver_now() = self
def deliver_later() = self
def deliver() = self
def deliver!() = self
def deliver_now = self
def deliver_later = self
def deliver = self
def deliver! = self
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/models/sponsor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Sponsor < ApplicationRecord
class_name: 'Sponsorship', inverse_of: :sponsor
has_many :events, through: :event_sponsorships
has_many :workshop_sponsors, lambda {
includes([workshop: :chapter])
includes([{ workshop: :chapter }])
.joins(:workshop)
.order('workshops.date_and_time desc')
},
Expand Down
2 changes: 1 addition & 1 deletion app/models/workshop_invitation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class WorkshopInvitation < ApplicationRecord
scope :last_six_months, -> { joins(:workshop).where(workshops: { date_and_time: 6.months.ago...Time.zone.now }) }
scope :not_reminded, -> { where(reminded_at: nil) }
scope :on_waiting_list, -> { joins(:waiting_list) }
scope :with_notes_and_their_authors, -> {
scope :with_notes_and_their_authors, lambda {
includes(member: [{ member_notes: :author }, :attendance_warnings]).includes(:overrider)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/omniauth/strategies/codebar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def callback_phase
rescue StandardError => e
return if env['omniauth.error']

return fail!(:unknown_error, e)
fail!(:unknown_error, e)
end

private
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/setup.rake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace :setup do
end

def check_postgresql
if !system('which psql > /dev/null 2>&1')
unless system('which psql > /dev/null 2>&1')
error('PostgreSQL', 'psql not found',
'Install: brew install postgresql && brew services start postgresql (macOS)' \
' or see docs/development-setup.md')
Expand Down Expand Up @@ -128,7 +128,7 @@ namespace :setup do
end

def check_github_credentials
if !File.exist?('mise.local.toml')
unless File.exist?('mise.local.toml')
error('GitHub OAuth', 'mise.local.toml not found',
'Copy: cp mise.local.toml.example mise.local.toml, then edit with your GitHub app credentials.')
return
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/admin/sponsors_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
let(:member1) { Fabricate(:member) }
let(:address) { Fabricate(:address) }
let(:admin) { Fabricate(:chapter_organiser) }
let(:avatar) { Rack::Test::UploadedFile.new(Rails.root.join('app', 'assets', 'images', 'logo.png'), 'image/png') }
let(:avatar) { Rack::Test::UploadedFile.new(Rails.root.join('app/assets/images/logo.png'), 'image/png') }
let(:sponsor) { Fabricate(:sponsor) }

describe 'POST #create' do
Expand All @@ -15,7 +15,7 @@
address: address, avatar: avatar, members: [1, 2]
}
}
end.to change(Sponsor, :count).by(0)
end.not_to change(Sponsor, :count)
end

it "Doesn't allow regular users to create sponsors" do
Expand All @@ -28,7 +28,7 @@
address: address, avatar: avatar
}
}
end.to change(Sponsor, :count).by(0)
end.not_to change(Sponsor, :count)
end

context 'Allows chapter organisers to create sponsors with' do
Expand Down Expand Up @@ -98,7 +98,7 @@
address: '', avatar: '', members: []
}
}
end.to change(Sponsor, :count).by(0)
end.not_to change(Sponsor, :count)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/admin/workshops_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
it 'should successfully delete the workshop' do
expect do
delete :destroy, params: { id: workshop.id }
end.to change { Workshop.count }.by -1
end.to change { Workshop.count }.by(-1)
end

it 'should display workshop deleted successfully related flash message' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin/sponsor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@

within '#sponsorships' do
expect(page).to have_text('Events')
expect(page).to have_text("#{gold_event.to_s} - GOLD")
expect(page).to have_text("#{gold_event} - GOLD")
expect(page).to have_text("#{silver_event} - SILVER")
expect(page).to have_text("#{standard_event} - Standard")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/admin/workshops_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
context '#creation' do
context 'creating a workshop' do
around do |example|
travel_to Time.zone.local(2020, 12, 01, 0, 0, 0)
travel_to Time.zone.local(2020, 12, 0o1, 0, 0, 0)
example.run
travel_back
end
Expand Down
4 changes: 2 additions & 2 deletions spec/models/workshop_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@
end

context 'with rsvp_open' do
it_should_behave_like 'date_time_fields_must_be_paired', 'rsvp_open'
it_behaves_like 'date_time_fields_must_be_paired', 'rsvp_open'
end

context 'with rsvp_close' do
it_should_behave_like 'date_time_fields_must_be_paired', 'rsvp_close'
it_behaves_like 'date_time_fields_must_be_paired', 'rsvp_close'
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/presenters/event_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

describe '#organisers' do
it 'when there are no organisers' do
expect(event.organisers).to match_array([])
expect(event.organisers).to be_empty
end

it 'when there are organisers' do
Expand Down
2 changes: 1 addition & 1 deletion spec/services/invitation_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
end

describe '#send_workshop_waiting_list_reminders', :wip do
# Note: This test is WIP because the method is async
# NOTE: This test is WIP because the method is async
it 'emails everyone that hasn\'t already been reminded from the workshop\'s waitinglist' do
workshop = Fabricate(:workshop)
invitations = Fabricate.times(2, :waitinglist_invitation, workshop: workshop)
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
end

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require File.expand_path('../config/environment', __dir__)
require 'rspec/rails'

# Block all external HTTP requests in tests; allows localhost for Capybara
Expand Down Expand Up @@ -70,7 +70,7 @@
config.before(:each) do
# Stub all Flodesk API endpoints globally so tests don't make external requests
# when fabricating members (which trigger Subscription.after_create callback)
WebMock.stub_request(:any, %r{api\.flodesk\.com})
WebMock.stub_request(:any, /api\.flodesk\.com/)
.to_return(status: 200, body: '{"status":"active","segments":[]}', headers: { 'Content-Type' => 'application/json' })

DatabaseCleaner.strategy = :transaction
Expand Down