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:
- rt_rubocop_defaults
- rubocop-rails
AllCops:
TargetRubyVersion: 2.7
DisplayCopNames: true
CacheRootDirectory: '.git'
Exclude:
- 'config/**/*'
- 'vendor/**/*'
@ -10,6 +10,9 @@ AllCops:
- 'db/seeds.rb'
- 'bin/**/*'
- 'node_modules/**/*'
- coverage/**/*
TargetRubyVersion: 2.7
NewCops: enable
Rails:
Enabled: true
@ -17,6 +20,16 @@ Rails:
Rails/InverseOf:
Enabled: false
### Lint
Lint/NestedMethodDefinition:
Exclude:
- api/sinatra/**/*
### Metrics
Metrics/AbcSize:
Max: 20
Exclude:
@ -30,12 +43,86 @@ Metrics/MethodLength:
Exclude:
- '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
Style/HashTransformValues:
Enabled: false
Layout/MultilineOperationIndentation:
Description: Checks indentation of binary operations that span more than one line.
EnforcedStyle: indented
#### Rest
Style/Documentation:
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:
Enabled: false

131
Gemfile
View File

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

View File

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