Skip to content

Commit

Permalink
Merge pull request #429 from moneyadviceservice/9963_merge-rad-core-i…
Browse files Browse the repository at this point in the history
…nto-admin

[DEV APPROVED] - [9963] Merge `mas-rad_core` into `rad`
  • Loading branch information
your authored Jan 10, 2019
2 parents 23a9ef2 + b99fdf9 commit 0e797a1
Show file tree
Hide file tree
Showing 167 changed files with 6,768 additions and 113 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.bundle
.DS_Store
.rubocop-*
/log/*.log
/tmp
/vendor/assets/bower_components
Expand Down
52 changes: 31 additions & 21 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
inherit_from:
- .rubocop_todo.yml
- https://raw.githubusercontent.com/moneyadviceservice/mas-standards/master/.rubocop.yml

Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- 'spec/**/*'
Metrics/ClassLength:
Exclude:
- 'app/models/firm.rb'
Metrics/LineLength:
Max: 80
IgnoredPatterns: ['^\s*class\s']
Exclude:
- 'spec/**/*'
- 'spec/**/*'
- 'app/models/snapshot/*.rb'
Metrics/MethodLength:
Max: 15
Exclude:
- 'app/models/snapshot/*.rb'
Style/ClassAndModuleChildren:
Enabled: false
Style/CollectionMethods:
Expand Down Expand Up @@ -42,24 +52,24 @@ AllCops:
TargetRailsVersion: 4.2
DisplayCopNames: true
Exclude:
- 'bin/**/*'
- 'config/**/*'
- 'db/**/*'
- 'Guardfile'
- 'lib/tasks/**/*'
- 'node_modules/**/*'
- 'script/**/*'
- 'spec/spec_helper.rb'
- 'spec/cassettes/**/*'
- 'features/**/*'
- 'spec/features/**/*'
- 'tmp/**/*'
- 'vendor/**/*'
- 'Rakefile'
- 'spec/dummy/config/**/*'
- 'spec/dummy/db/**/*'
- 'spec/dummy/script/**/*'
# Project specific exclusions
- 'lib/fca/**/*'
- 'bin/**/*'
- 'config/**/*'
- 'db/**/*'
- 'Guardfile'
- 'lib/tasks/**/*'
- 'node_modules/**/*'
- 'script/**/*'
- 'spec/spec_helper.rb'
- 'spec/cassettes/**/*'
- 'features/**/*'
- 'spec/features/**/*'
- 'tmp/**/*'
- 'vendor/**/*'
- 'Rakefile'
- 'spec/dummy/config/**/*'
- 'spec/dummy/db/**/*'
- 'spec/dummy/script/**/*'
# Project specific exclusions
- 'lib/fca/**/*'

# Project specific settings
157 changes: 157 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-01-08 10:21:45 +0000 using RuboCop version 0.54.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: 1
# Cop supports --auto-correct.
# Configuration parameters: Categories, ExpectedOrder.
# ExpectedOrder: module_inclusion, constants, public_class_methods, initializer, public_methods, protected_methods, private_methods
Layout/ClassStructure:
Exclude:
- 'app/controllers/self_service/abstract_firms_controller.rb'

# Offense count: 2
Lint/AmbiguousOperator:
Exclude:
- 'app/models/firm.rb'

# Offense count: 2
Lint/DuplicateMethods:
Exclude:
- 'app/forms/admin/move_advisers_form.rb'
- 'app/models/firm.rb'

# Offense count: 1
Lint/NestedMethodDefinition:
Exclude:
- 'app/models/friendly_namable.rb'

# Offense count: 2
Lint/ReturnInVoidContext:
Exclude:
- 'app/models/office.rb'

# Offense count: 3
Metrics/AbcSize:
Max: 17

# Offense count: 3
Naming/MemoizedInstanceVariableName:
Exclude:
- 'app/jobs/fca_import_job.rb'
- 'app/models/snapshot.rb'

# Offense count: 2
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
# MethodDefinitionMacros: define_method, define_singleton_method
Naming/PredicateName:
Exclude:
- 'spec/**/*'
- 'app/models/adviser.rb'
- 'app/models/office.rb'

# Offense count: 6
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to
Naming/UncommunicativeMethodParamName:
Exclude:
- 'app/controllers/admin/lookup/fca_import_controller.rb'
- 'app/helpers/admin/lookup/fca_import_helper.rb'
- 'lib/adviser_list_csv.rb'
- 'lib/river/core.rb'
- 'lib/river/runners.rb'

# Offense count: 9
# Cop supports --auto-correct.
Rails/ActiveRecordAliases:
Exclude:
- 'app/controllers/admin/principals_controller.rb'
- 'app/controllers/admin/users_controller.rb'
- 'spec/controllers/admin/firms_controller_spec.rb'
- 'spec/controllers/selfservice/firms_controller_spec.rb'
- 'spec/controllers/selfservice/trading_names_controller_spec.rb'
- 'spec/models/firm_spec.rb'
- 'spec/models/office_spec.rb'
- 'spec/support/contexts/advisers_controller.rb'
- 'spec/support/contexts/offices_controller.rb'

# Offense count: 16
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
Exclude:
- 'app/models/adviser.rb'
- 'app/models/allowed_payment_method.rb'
- 'app/models/firm.rb'
- 'app/models/in_person_advice_method.rb'
- 'app/models/initial_advice_fee_structure.rb'
- 'app/models/investment_size.rb'
- 'app/models/ongoing_advice_fee_structure.rb'
- 'app/models/other_advice_method.rb'

# Offense count: 2
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/initial_meeting_duration.rb'
- 'app/models/lookup/firm.rb'

# Offense count: 8
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/InverseOf:
Exclude:
- 'app/models/firm.rb'
- 'app/models/lookup/firm.rb'
- 'app/models/principal.rb'
- 'app/models/user.rb'

# Offense count: 3
# Configuration parameters: Blacklist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
Rails/SkipsModelValidations:
Exclude:
- 'spec/models/office_spec.rb'

# Offense count: 8
# Cop supports --auto-correct.
Style/EmptyLineAfterGuardClause:
Exclude:
- 'app/controllers/self_service/principals_controller.rb'
- 'app/forms/new_principal_form.rb'
- 'app/helpers/self_service/self_service_helper.rb'
- 'app/models/firm.rb'
- 'lib/firm_indexer.rb'
- 'spec/support/self_service/firm_edit_page.rb'
- 'spec/support/shared_examples/system_named.rb'

# Offense count: 1
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Exclude:
- 'lib/stats.rb'

# Offense count: 3
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Exclude:
- 'app/models/adviser.rb'
- 'app/models/office.rb'
- 'app/models/principal.rb'

# Offense count: 5
# Configuration parameters: SuspiciousParamNames.
# SuspiciousParamNames: options, opts, args, params, parameters
Style/OptionHash:
Exclude:
- 'app/presenters/self_service/status_presenter.rb'
- 'spec/controllers/selfservice/firms_controller_spec.rb'
- 'spec/controllers/selfservice/trading_names_controller_spec.rb'
9 changes: 7 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ gem 'dough-ruby',
github: 'moneyadviceservice/dough',
require: 'dough',
tag: 'v5.12.0.267'
gem 'geocoder', '~> 1.4.7'
gem 'httpclient', '~> 2.8.3'
gem 'jquery-rails'
gem 'kaminari'
gem 'language_list', '~> 1.2.1'
gem 'letter_opener', group: :development
gem 'mailjet'
gem 'mas-rad_core', '0.1.5'
gem 'oga'
gem 'pg', '0.21.0'
gem 'rails_email_validator'
Expand All @@ -49,7 +51,10 @@ gem 'sidekiq-unique-jobs'
gem 'sidetiq'
gem 'sinatra', require: false
gem 'slack-ruby-client'
gem 'statsd-ruby', '~> 1.4.0'
gem 'uglifier', '>= 1.3.0'
gem 'uk_phone_numbers', '~> 0.1.1'
gem 'uk_postcode', '~> 2.1.2'
gem 'unicorn'

group :test, :development do
Expand All @@ -61,7 +66,7 @@ group :test, :development do
gem 'pry-byebug'
gem 'pry-rails'
gem 'rspec-rails'
gem 'rubocop', '0.49.0'
gem 'rubocop', '0.54.0'
gem 'timecop'
end

Expand Down
Loading

0 comments on commit 0e797a1

Please sign in to comment.