Include cop settings from `rt_rubocop_defaults` and remove Gem

Hound can't require external configurations and so we have to resort to this.
This commit is contained in:
Andreas Nedbal 2022-01-15 23:31:20 +01:00 committed by Andreas Nedbal
parent 71353b3721
commit bdaf2f7fef
3 changed files with 194 additions and 111 deletions

View File

@ -1,8 +1,8 @@
require: require:
- rt_rubocop_defaults
- rubocop-rails - rubocop-rails
AllCops: AllCops:
TargetRubyVersion: 2.7 DisplayCopNames: true
CacheRootDirectory: '.git'
Exclude: Exclude:
- 'config/**/*' - 'config/**/*'
- 'vendor/**/*' - 'vendor/**/*'
@ -10,6 +10,9 @@ AllCops:
- 'db/seeds.rb' - 'db/seeds.rb'
- 'bin/**/*' - 'bin/**/*'
- 'node_modules/**/*' - 'node_modules/**/*'
- coverage/**/*
TargetRubyVersion: 2.7
NewCops: enable
Rails: Rails:
Enabled: true Enabled: true
@ -17,6 +20,16 @@ Rails:
Rails/InverseOf: Rails/InverseOf:
Enabled: false Enabled: false
### Lint
Lint/NestedMethodDefinition:
Exclude:
- api/sinatra/**/*
### Metrics
Metrics/AbcSize: Metrics/AbcSize:
Max: 20 Max: 20
Exclude: Exclude:
@ -30,12 +43,86 @@ Metrics/MethodLength:
Exclude: Exclude:
- 'db/migrate/*.rb' - 'db/migrate/*.rb'
Style/ClassAndModuleChildren: Metrics/BlockLength:
Exclude:
- '*.gemspec'
- '**/*.rake'
- 'api/**/*'
- 'app/api/routes.rb'
- 'config/initialize/**/*'
- 'config/initializers/**/*'
- 'spec/**/*'
Metrics/ClassLength:
Exclude:
- spec/**/*
Metrics/CyclomaticComplexity:
Severity: refactor
Metrics/ModuleLength:
Exclude:
- 'app/api/routes.rb'
- 'spec/requests/**/*'
### Style / Layout
#### Hash
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
Style/HashTransformKeys:
Enabled: false Enabled: false
Style/HashTransformValues:
Enabled: false
Layout/MultilineOperationIndentation:
Description: Checks indentation of binary operations that span more than one line.
EnforcedStyle: indented
#### Rest
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false
Style/DoubleNegation:
Enabled: false
Style/ExponentialNotation:
# https://docs.rubocop.org/rubocop/cops_style.html#styleexponentialnotation
EnforcedStyle: engineering
Style/NumericLiterals:
Description: Add underscores to large numeric literals to improve their readability.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
Enabled: false
Style/PerlBackrefs:
Enabled: false
Style/RaiseArgs:
EnforcedStyle: compact
Style/RegexpLiteral:
Enabled: false
Style/SignalException:
EnforcedStyle: only_raise
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/OptionalBooleanParameter:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/RescueStandardError: Style/RescueStandardError:
Enabled: false Enabled: false

207
Gemfile
View File

@ -1,104 +1,103 @@
# frozen_string_literal: true # frozen_string_literal: true
source 'https://rubygems.org' source "https://rubygems.org"
gem 'rails', '~> 6.1' gem "i18n-js", "= 3.6"
gem 'rails-i18n', '~> 6.0' gem "rails", "~> 6.1"
gem 'i18n-js', '= 3.6' gem "rails-i18n", "~> 6.0"
gem 'pg' gem "pg"
gem 'sass-rails', '~> 5.0' gem "jbuilder", "~> 2.10"
gem 'uglifier', '>= 1.3.0' gem "sass-rails", "~> 5.0"
gem 'turbolinks', '~> 2.5.3' gem "turbolinks", "~> 2.5.3"
gem 'jbuilder', '~> 2.10' gem "uglifier", ">= 1.3.0"
gem 'bcrypt', '~> 3.1.7' gem "bcrypt", "~> 3.1.7"
gem 'haml', '~> 5.0' gem "active_model_otp"
gem 'devise', '~> 4.0' gem "bootstrap_form"
gem 'devise-i18n' gem "carrierwave", "~> 2.0"
gem 'devise-async' gem "carrierwave_backgrounder", git: "https://github.com/mltnhm/carrierwave_backgrounder.git"
gem 'active_model_otp' gem "colorize"
gem 'rqrcode' gem "devise", "~> 4.0"
gem 'bootstrap_form' gem "devise-async"
gem 'fog-core' gem "devise-i18n"
gem 'fog-aws' gem "fog-aws"
gem 'fog-local' gem "fog-core"
gem 'colorize' gem "fog-local"
gem 'carrierwave', '~> 2.0' gem "haml", "~> 5.0"
gem 'carrierwave_backgrounder', git: 'https://github.com/mltnhm/carrierwave_backgrounder.git' gem "hcaptcha", "~> 6.0", git: "https://github.com/Retrospring/hcaptcha.git", ref: "v6.0.2"
gem 'mini_magick' gem "mini_magick"
gem "hcaptcha", "~> 6.0", git: "https://github.com/Retrospring/hcaptcha.git", ref: "v6.0.2" gem "rqrcode"
gem "rolify", "~> 5.2" gem "rolify", "~> 5.2"
gem "dry-initializer", "~> 3.0" gem "dry-initializer", "~> 3.0"
gem "dry-types", "~> 1.4" gem "dry-types", "~> 1.4"
gem 'ruby-progressbar' gem "ruby-progressbar"
gem 'rails_admin' gem "pghero"
gem 'pghero' gem "rails_admin"
gem "sentry-ruby" gem "sentry-rails"
gem "sentry-rails" gem "sentry-ruby"
gem "sentry-sidekiq" gem "sentry-sidekiq"
gem 'sidekiq', "< 6" # remove version constraint once we have redis 5 gem "sidekiq", "< 6" # remove version constraint once we have redis 5
gem 'questiongenerator', '~> 1.0' gem "questiongenerator", "~> 1.0"
gem 'sanitize' gem "httparty"
gem 'redcarpet' gem "redcarpet"
gem 'httparty' gem "sanitize"
# OmniAuth and providers # OmniAuth and providers
gem 'omniauth' gem "omniauth"
gem 'omniauth-twitter' gem "omniauth-twitter"
# OAuth clients # OAuth clients
gem 'twitter' gem "twitter"
gem 'twitter-text' gem "twitter-text"
gem 'redis' gem "redis"
gem 'fake_email_validator' gem "fake_email_validator"
group :development do group :development do
gem 'spring', '~> 2.0' gem "binding_of_caller"
gem 'byebug' gem "byebug"
gem 'web-console', '~> 4.0' gem "spring", "~> 2.0"
gem 'binding_of_caller' gem "web-console", "~> 4.0"
end end
gem 'puma' gem "puma"
group :development, :test do group :development, :test do
gem 'rake' gem "better_errors"
gem 'rspec-mocks' gem "brakeman"
gem 'rspec-rails', '~> 4.0' gem "capybara"
gem 'rspec-its', '~> 1.3' gem "database_cleaner"
gem "rspec-sidekiq", "~> 3.0", require: false gem "factory_bot_rails", require: false
gem 'factory_bot_rails', require: false gem "faker"
gem 'faker' gem "guard-brakeman"
gem 'capybara' gem "haml_lint", require: false
gem 'poltergeist' gem "letter_opener" # Use this just in local test environments
gem 'simplecov', require: false gem "poltergeist"
gem 'simplecov-json', require: false gem "rails-controller-testing"
gem 'simplecov-cobertura', require: false gem "rake"
gem 'database_cleaner' gem "rspec-its", "~> 1.3"
gem 'better_errors' gem "rspec-mocks"
gem 'letter_opener' # Use this just in local test environments gem "rspec-rails", "~> 4.0"
gem 'brakeman' gem "rspec-sidekiq", "~> 3.0", require: false
gem 'guard-brakeman' gem "rubocop", "~> 1.22", ">= 1.22.1"
gem 'timecop' gem "rubocop-rails", "~> 2.13", ">= 2.13.1"
gem 'rails-controller-testing' gem "simplecov", require: false
gem 'haml_lint', require: false gem "simplecov-cobertura", require: false
gem 'rt_rubocop_defaults', '~> 2.3', '>= 2.3.1' gem "simplecov-json", require: false
gem 'rubocop', '~> 1.22', '>= 1.22.1' gem "timecop"
gem 'rubocop-rails', '~> 2.13', '>= 2.13.1' end
end
gem "webpacker", "~> 5.2"
gem "webpacker", "~> 5.2"
gem "omniauth-rails_csrf_protection", "~> 1.0"
gem "omniauth-rails_csrf_protection", "~> 1.0"

View File

@ -474,8 +474,6 @@ GEM
rspec-core (~> 3.0, >= 3.0.0) rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0) sidekiq (>= 2.4.0)
rspec-support (3.10.3) rspec-support (3.10.3)
rt_rubocop_defaults (2.3.1)
rubocop (~> 1.5)
rubocop (1.24.1) rubocop (1.24.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.0.0.0) parser (>= 3.0.0.0)
@ -664,7 +662,6 @@ DEPENDENCIES
rspec-mocks rspec-mocks
rspec-rails (~> 4.0) rspec-rails (~> 4.0)
rspec-sidekiq (~> 3.0) rspec-sidekiq (~> 3.0)
rt_rubocop_defaults (~> 2.3, >= 2.3.1)
rubocop (~> 1.22, >= 1.22.1) rubocop (~> 1.22, >= 1.22.1)
rubocop-rails (~> 2.13, >= 2.13.1) rubocop-rails (~> 2.13, >= 2.13.1)
ruby-progressbar ruby-progressbar