Skip to content

Commit

Permalink
More updates, annotated models and CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kigster committed Feb 16, 2024
1 parent ac7b9fe commit afa5556
Show file tree
Hide file tree
Showing 44 changed files with 751 additions and 353 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5.8 # Not needed with a .ruby-version file
ruby-version: 3.3.0
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- run: |
gem install bundler --version 1.17.3 -N
bundle _1.17.3_ install -j 12
bundle install -j 12
bundle exec rubocop --format progress -P
11 changes: 5 additions & 6 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:13
image: postgres:15
ports:
- 5432:5432
env:
Expand All @@ -27,18 +27,17 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5.8 # Not needed with a .ruby-version file
ruby-version: 3.3.0
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- run: |
gem update --system 3.2.3 || true
gem install bundler --version 1.17.3 -N
bundle _1.17.3_ install -j 12
gem update --system || true
install -j 12
- run: |
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake db:test:prepare
- run: |
bundle exec rspec
bundle exec rspec -b
234 changes: 210 additions & 24 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-05-02 03:13:36 UTC using RuboCop version 1.27.0.
# on 2024-02-16 22:39:17 UTC using RuboCop version 1.60.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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowSafeAssignment.
Lint/AssignmentInCondition:
Exclude:
- 'app/controllers/passwords_controller.rb'
- 'app/controllers/ticket_requests_controller.rb'

# Offense count: 1
Lint/ShadowingOuterLocalVariable:
Expand All @@ -24,61 +24,247 @@ Lint/UnmodifiedReduceAccumulator:
- 'app/helpers/shifts_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessAssignment:
Exclude:
- 'config/unicorn.rb'

# Offense count: 20
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
# Offense count: 19
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 62

# Offense count: 21
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
# Offense count: 3
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 255
Max: 55

# Offense count: 2
# Offense count: 3
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 157
Max: 156

# Offense count: 4
# Configuration parameters: IgnoredMethods.
# Offense count: 5
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 13

# Offense count: 25
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# Offense count: 24
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 59
Max: 58

# Offense count: 1
# Configuration parameters: CountComments, CountAsOne.
Metrics/ModuleLength:
Max: 114

# Offense count: 3
# Configuration parameters: IgnoredMethods.
# Offense count: 4
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 15

# Offense count: 6
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'spec/support/factory_bot.rb'
- 'spec/support/time_extensions.rb'

# Offense count: 74
# Offense count: 15
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Exclude:
- 'spec/controllers/events_controller_spec.rb'
- 'spec/models/event_spec.rb'
- 'spec/models/ticket_request_spec.rb'

# Offense count: 1
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- 'spec/lib/fnf/music_submissions_spec.rb'

# Offense count: 1
RSpec/ExpectInHook:
Exclude:
- 'spec/lib/fnf/event_reporter_spec.rb'

# Offense count: 1
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
EnforcedStyle: receive

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

# Offense count: 3
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Exclude:
- 'spec/controllers/ticket_requests_controller_spec.rb'
- 'spec/lib/fnf/csv_reader_spec.rb'
- 'spec/models/ticket_request_spec.rb'

# Offense count: 60
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 5

# Offense count: 52
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/controllers/emails_controller_spec.rb'
- 'spec/controllers/events_controller_spec.rb'
- 'spec/controllers/ticket_requests_controller_spec.rb'
- 'spec/lib/fnf/event_reporter_spec.rb'
- 'spec/mailers/payment_mailer_spec.rb'
- 'spec/mailers/ticket_request_mailer_spec.rb'
- 'spec/models/event_spec.rb'
- 'spec/models/ticket_request_spec.rb'
- 'spec/models/user_spec.rb'

# Offense count: 2
RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/models/event_spec.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationMailer:
Exclude:
- 'app/mailers/eald_payment_mailer.rb'
- 'app/mailers/payment_mailer.rb'
- 'app/mailers/ticket_request_mailer.rb'

# Offense count: 9
# Configuration parameters: Database, Include.
# SupportedDatabases: mysql, postgresql
# Include: db/**/*.rb
Rails/BulkChangeTable:
Exclude:
- 'db/migrate/20130226221916_add_user_to_ticket_request.rb'
- 'db/migrate/20130325024448_add_ticket_cost_info_to_event.rb'
- 'db/migrate/20130803212458_add_start_and_end_ticket_sale_times_to_events.rb'
- 'db/migrate/20140428045329_add_role_to_ticket_requests.rb'
- 'db/migrate/20140605045004_extract_address_into_multiple_fields.rb'
- 'db/migrate/20140616030905_change_camping_type_on_ticket_requests.rb'
- 'db/migrate/20160611234315_add_eald_columns.rb'

# Offense count: 3
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/event.rb'
- 'app/models/ticket_request.rb'
- 'app/models/user.rb'

# Offense count: 3
# Configuration parameters: Include.
# Include: app/helpers/**/*.rb
Rails/HelperInstanceVariable:
Exclude:
- 'app/helpers/shifts_helper.rb'

# Offense count: 14
Rails/I18nLocaleTexts:
Exclude:
- 'app/controllers/home_controller.rb'
- 'app/controllers/jobs_controller.rb'
- 'app/controllers/passwords_controller.rb'
- 'app/controllers/payments_controller.rb'
- 'app/controllers/shifts_controller.rb'
- 'app/controllers/ticket_requests_controller.rb'
- 'app/models/event_admin.rb'
- 'app/models/payment.rb'
- 'app/models/site_admin.rb'
- 'app/models/user.rb'

# Offense count: 1
# Configuration parameters: Database, Include.
# SupportedDatabases: mysql
# Include: db/**/*.rb
Rails/NotNullColumn:
Exclude:
- 'db/migrate/20130311213508_add_event_id_to_ticket_request.rb'

# Offense count: 9
# Configuration parameters: Include.
# Include: db/**/*.rb
Rails/ReversibleMigration:
Exclude:
- 'db/migrate/20130226221916_add_user_to_ticket_request.rb'
- 'db/migrate/20140515053804_remove_performer_from_ticket_requests.rb'
- 'db/migrate/20140605045004_extract_address_into_multiple_fields.rb'
- 'db/migrate/20140605052627_remove_volunteer_shifts_from_ticket_requests.rb'
- 'db/migrate/20140605053705_remove_ask_how_many_shifts_from_events.rb'
- 'db/migrate/20140605060026_add_camping_type_to_ticket_requests.rb'
- 'db/migrate/20140616030905_change_camping_type_on_ticket_requests.rb'

# Offense count: 3
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Rails/SkipsModelValidations:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/controllers/ticket_requests_controller.rb'
- 'app/models/user.rb'

# Offense count: 3
# Configuration parameters: Include.
# Include: db/**/*.rb
Rails/ThreeStateBooleanColumn:
Exclude:
- 'db/migrate/20140515054433_add_vehicle_camping_requested_to_ticket_requests.rb'
- 'db/migrate/20140616030905_change_camping_type_on_ticket_requests.rb'
- 'db/migrate/20150609064608_add_agrees_terms_to_ticket_requests.rb'

# Offense count: 1
# Configuration parameters: TransactionMethods.
Rails/TransactionExitStatement:
Exclude:
- 'app/models/ticket_request.rb'

# Offense count: 2
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/UniqueValidationWithoutIndex:
Exclude:
- 'app/models/payment.rb'
- 'app/models/site_admin.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Rake/Desc:
Exclude:
- 'Rakefile'

# Offense count: 81
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Exclude:
- 'app/models/application_record.rb'

# Offense count: 5
# Configuration parameters: MinBodyLength.
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'app/controllers/application_controller.rb'
Expand All @@ -92,9 +278,9 @@ Style/MissingRespondToMissing:
Exclude:
- 'spec/support/factory_bot.rb'

# Offense count: 3
# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 174
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.2
3.3.0
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ brew 'rsync'
brew 'ruby-build'
brew 'ruby-completion'
brew 'shellcheck'
brew 'stripe/stripe-mock/stripe-mock'
brew 'tree'
brew 'vim'
brew 'watch'
Expand Down
Loading

0 comments on commit afa5556

Please sign in to comment.