Skip to content

Commit

Permalink
chore: Update rubocop and linters
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraichen committed Oct 9, 2024
1 parent 0eb9802 commit 6a3ee58
Show file tree
Hide file tree
Showing 3 changed files with 158 additions and 137 deletions.
187 changes: 102 additions & 85 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,33 @@
require:
- rubocop-capybara
- rubocop-factory_bot
- rubocop-performance
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails

AllCops:
Exclude:
- "bin/**"
- "db/schema.rb"
- "vendor/**/*"
TargetRubyVersion: 2.7
TargetRailsVersion: 6.0
TargetRubyVersion: 3.3
TargetRailsVersion: 7.2
NewCops: enable

#s
# -----------------------------------------------------------------------------
# RAILS

Rails:
Enabled: True

Rails/ApplicationRecord:
Exclude:
- "db/migrate/**/*"

Rails/SkipsModelValidations:
Exclude:
- "db/migrate/**/*"

#
# -----------------------------------------------------------------------------
# RSPEC

RSpec:
Include:
- "spec/**/*_spec.rb"
- "spec/spec_helper.rb"
- "spec/rails_helper.rb"

RSpec/ContextWording:
Enabled: False

RSpec/ExampleLength:
Enabled: False

RSpec/ExpectInHook:
Enabled: False

RSpec/FilePath:
Exclude:
- "spec/client/**/*_spec.rb"

RSpec/MessageSpies:
Enabled: False

RSpec/MissingExampleGroupArgument:
Enabled: False

RSpec/MultipleExpectations:
Enabled: False

RSpec/NestedGroups:
Max: 5

RSpec/FactoryBot/CreateList:
Enabled: False

#
# -----------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Layout

Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation

Layout/CaseIndentation:
EnforcedStyle: end
IndentOneStep: True
SupportedStyles:
- case
- end
IndentOneStep: True

Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Expand All @@ -104,7 +53,7 @@ Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

#
# -----------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Lint

#
Expand All @@ -121,8 +70,14 @@ Lint/AmbiguousBlockAssociation:
Lint/MixedRegexpCaptureTypes:
Enabled: False

Lint/RaiseException:
Enabled: true

Lint/StructNewOverride:
Enabled: true

#
# -----------------------------------------------------------------------------
# ---------------------------------------------------------------------------
# Metrics

Metrics/AbcSize:
Expand All @@ -136,62 +91,124 @@ Metrics/BlockLength:
- "**/*.rake"

Metrics/ClassLength:
Max: 200
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: False
Enabled: false

Metrics/MethodLength:
Max: 25
Exclude:
- "db/**/*"
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false

#
# -----------------------------------------------------------------------------
# Style
# ---------------------------------------------------------------------------
# Naming

Naming/FileName:
Exclude:
- "**/Gemfile"
- "**/Rakefile"
- "**/Appraisals"

#
# Disable due to https://github.com/rubocop/rubocop/issues/5953
# ---------------------------------------------------------------------------
# RAILS

Rails:
Enabled: True

Rails/ApplicationRecord:
Exclude:
- "db/migrate/**/*"

Rails/SkipsModelValidations:
Exclude:
- "db/migrate/**/*"

#
Style/AccessModifierDeclarations:
# ---------------------------------------------------------------------------
# RSPEC

RSpec/ContextWording:
Enabled: False

#
# Both styles or mixtures are reasonable
#
Style/ClassAndModuleChildren:
EnforcedStyle: compact
RSpec/ExampleLength:
Enabled: False

RSpec/ExpectInHook:
Enabled: False

RSpec/MessageSpies:
Enabled: False

RSpec/MissingExampleGroupArgument:
Enabled: False

RSpec/MultipleExpectations:
Enabled: False

RSpec/NestedGroups:
Max: 5

RSpec/ScatteredSetup:
Enabled: false

#
# Would be better but unlikely...
#
# ---------------------------------------------------------------------------
# Style

Style/ClassAndModuleChildren:
Enabled: false

Style/Documentation:
Enabled: False
Enabled: false

Style/HashEachMethods:
Enabled: false

Style/HashTransformKeys:
Enabled: false

Style/HashTransformValues:
Enabled: false

Style/IfUnlessModifier:
Enabled: false

Style/RaiseArgs:
EnforcedStyle: compact

#
# Quick single line rescues in specs
#
Style/RedundantBegin:
Enabled: false

Style/RescueModifier:
Exclude:
- "spec/**/*_spec.rb"

#
# Quick single line rescues in specs
#
Style/RescueStandardError:
Exclude:
- "spec/**/*_spec.rb"

#
# Often used pattern in chaining subjects in specs
#
Style/Semicolon:
Exclude:
- "spec/**/*_spec.rb"

Style/SignalException:
EnforcedStyle: only_raise

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma

Style/TrivialAccessors:
AllowPredicates: true
87 changes: 45 additions & 42 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,68 +1,71 @@
# frozen_string_literal: true

source 'https://rubygems.org'
source "https://rubygems.org"

ruby '~> 3.2'
ruby "~> 3.2"

gem 'config', '~> 5.5'
gem 'dry-validation', '~> 1.10'
gem 'forked', '~> 0.1.2'
gem 'puma', '~> 6.4'
gem 'rails', '~> 7.2.0'
gem 'unicorn', '~> 6.0'
gem "config", "~> 5.5"
gem "dry-validation", "~> 1.10"
gem "forked", "~> 0.1.2"
gem "puma", "~> 6.4"
gem "rails", "~> 7.2.0"
gem "unicorn", "~> 6.0"

gem 'active_record_upsert', github: 'jesjos/active_record_upsert', ref: 'c3e07ae'
gem "active_record_upsert", github: "jesjos/active_record_upsert", ref: "c3e07ae"

gem 'bulk_insert', '~> 1.8'
gem 'hutch', '~> 1.1'
gem 'pg', '~> 1.2'
gem "bulk_insert", "~> 1.8"
gem "hutch", "~> 1.1"
gem "pg", "~> 1.2"

gem 'dry-struct', '~> 1.6.0'
gem 'dry-types', '~> 1.7.0'
gem 'uuid4', '~> 1.3'
gem "dry-struct", "~> 1.6.0"
gem "dry-types", "~> 1.7.0"
gem "uuid4", "~> 1.3"

# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

gem 'draper', '~> 4.0'
gem 'has_scope', '~> 0.8.0'
gem 'oj'
gem 'rails-assets-manifest', '~> 3.0', '>= 3.0.0'
gem 'rails-rfc6570', '~> 3.0'
gem 'responders', '~> 3.0'
gem 'slim'
gem "draper", "~> 4.0"
gem "has_scope", "~> 0.8.0"
gem "oj"
gem "rails-assets-manifest", "~> 3.0", ">= 3.0.0"
gem "rails-rfc6570", "~> 3.0"
gem "responders", "~> 3.0"
gem "slim"

gem 'ibsciss-middleware', '~> 0.4.2'
gem 'influxdb'
gem "ibsciss-middleware", "~> 0.4.2"
gem "influxdb"

gem 'concurrent-ruby', '~> 1.1'
gem 'mnemosyne-ruby', '~> 2.0'
gem "concurrent-ruby", "~> 1.1"
gem "mnemosyne-ruby", "~> 2.0"

gem 'sentry-rails'
gem 'sentry-ruby'
gem "sentry-rails"
gem "sentry-ruby"

group :development do
gem 'listen', '~> 3.9.0'
gem 'web-console', '>= 3.3.0'
gem "listen", "~> 3.9.0"
gem "web-console", ">= 3.3.0"
end

group :development, :test do
gem 'capybara', '~> 3.32'
gem 'selenium-webdriver'
gem "capybara", "~> 3.32"
gem "selenium-webdriver"

gem 'pry'
gem 'pry-byebug'
gem 'rspec-rails'
gem 'rubocop', '~> 1.11'
gem 'rubocop-performance', '~> 1.10'
gem 'rubocop-rails', '~> 2.9'
gem 'rubocop-rspec', '~> 2.0'
gem "pry"
gem "pry-byebug"
gem "rspec-rails"
gem "rubocop", "~> 1.66.1"
gem "rubocop-capybara", "~> 2.21.0"
gem "rubocop-factory_bot", "~> 2.26.1"
gem "rubocop-performance", "~> 1.22.1"
gem "rubocop-rails", "~> 2.26.2"
gem "rubocop-rspec", "~> 3.0.2"
gem "rubocop-rspec_rails", "~> 2.30.0"
end

group :test do
gem 'factory_bot_rails'
gem 'rspec', '~> 3.9'
gem 'timecop'
gem "factory_bot_rails"
gem "rspec", "~> 3.9"
gem "timecop"
end
Loading

0 comments on commit 6a3ee58

Please sign in to comment.