Skip to content

Commit

Permalink
Switch to rubocop-rails-omakase
Browse files Browse the repository at this point in the history
  • Loading branch information
miharekar committed Jan 4, 2024
1 parent 89d60ba commit a5e38b3
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 142 deletions.
42 changes: 7 additions & 35 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
---
inherit_gem:
standard: config/base.yml
standard-performance: config/base.yml
standard-custom: config/base.yml
standard-rails: config/base.yml
rubocop-rails-omakase: rubocop.yml

require:
- standard
- standard-custom
- standard-performance
- rubocop-performance
- rubocop-rails

Expand All @@ -21,78 +14,57 @@ AllCops:

Bundler/OrderedGems:
Enabled: true

Layout/ClassStructure:
Enabled: true

Layout/EmptyLineAfterGuardClause:
Enabled: true

Layout/SpaceInsideArrayLiteralBrackets:
EnforcedStyle: no_space
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Performance/AncestorsInclude:
Enabled: true

Performance/ArraySemiInfiniteRangeSlice:
Enabled: true

Performance/CaseWhenSplat:
Enabled: true

Performance/Casecmp:
Enabled: true

Performance/CollectionLiteralInLoop:
Enabled: true

Performance/DeletePrefix:
Enabled: true

Performance/DeleteSuffix:
Enabled: true

Performance/IoReadlines:
Enabled: true

Performance/MapCompact:
Enabled: true

Performance/MethodObjectAsBlock:
Enabled: true

Performance/OpenStruct:
Enabled: true

Performance/RedundantBlockCall:
Enabled: true

Performance/RedundantEqualityComparisonBlock:
Enabled: true

Performance/SelectMap:
Enabled: true

Performance/StringInclude:
Enabled: true

Performance/Sum:
Enabled: true

Performance/TimesMap:
Enabled: true

Rails/SaveBang:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: true

Style/IfUnlessModifier:
Enabled: true

Style/Send:
Enabled: true

Style/SymbolArray:
Enabled: true

Style/WordArray:
Enabled: true

Rails/SaveBang:
Enabled: false
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ group :development do
gem "brakeman"
gem "dockerfile-rails"
gem "letter_opener"
gem "rubocop", require: false
gem "standard", require: false
gem "standard-performance", require: false
gem "standard-rails", require: false
gem "rubocop-rails-omakase", require: false
gem "web-console"
end

Expand Down
48 changes: 13 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ GEM
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
appsignal (3.5.2)
appsignal (3.5.3)
rack
ast (2.4.2)
aws-eventstream (1.3.0)
aws-partitions (1.876.0)
aws-partitions (1.877.0)
aws-sdk-core (3.190.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
Expand Down Expand Up @@ -193,7 +193,7 @@ GEM
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (1.2.3)
importmap-rails (2.0.1)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
Expand All @@ -216,7 +216,6 @@ GEM
addressable (~> 2.8)
letter_opener (1.8.1)
launchy (>= 2.2, < 3)
lint_roller (1.1.0)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
Expand Down Expand Up @@ -253,12 +252,8 @@ GEM
net-protocol
netrc (0.11.0)
nio4r (2.7.0)
nokogiri (1.16.0-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
Expand Down Expand Up @@ -386,6 +381,9 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-minitest (0.34.3)
rubocop (>= 1.39, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-performance (1.20.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
Expand All @@ -394,6 +392,11 @@ GEM
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails-omakase (1.0.0)
rubocop
rubocop-minitest
rubocop-performance
rubocop-rails
ruby-progressbar (1.13.0)
ruby-vips (2.2.0)
ffi (~> 1.12)
Expand All @@ -420,31 +423,12 @@ GEM
hashie
version_gem (~> 1.1, >= 1.1.1)
stackprof (0.2.25)
standard (1.33.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.59.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.3)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.3.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.1)
standard-rails (1.0.0)
lint_roller (~> 1.0)
rubocop-rails (~> 2.23.1)
stimulus-rails (1.3.0)
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
stripe (10.4.0)
tailwindcss-rails (2.1.0-aarch64-linux)
railties (>= 6.0.0)
tailwindcss-rails (2.1.0-arm64-darwin)
railties (>= 6.0.0)
tailwindcss-rails (2.1.0-x86_64-linux)
railties (>= 6.0.0)
temple (0.10.3)
thor (1.3.0)
tilt (2.3.0)
Expand Down Expand Up @@ -475,10 +459,7 @@ GEM
zeitwerk (2.6.12)

PLATFORMS
aarch64-linux
arm64-darwin-22
arm64-darwin-23
x86_64-linux

DEPENDENCIES
active_link_to
Expand Down Expand Up @@ -517,15 +498,12 @@ DEPENDENCIES
redis
redlock
responders
rubocop
rubocop-rails-omakase
sidekiq
sidekiq-scheduler
singed
slim
stackprof
standard
standard-performance
standard-rails
stimulus-rails
stripe
tailwindcss-rails
Expand Down
27 changes: 27 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rubocop' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rubocop", "rubocop")
22 changes: 11 additions & 11 deletions config/importmap.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# frozen_string_literal: true

pin "application", preload: true
pin "@rails/activestorage", to: "activestorage.esm.js", preload: true
pin "@rails/actioncable", to: "actioncable.esm.js", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin "application"
pin "@rails/activestorage", to: "activestorage.esm.js"
pin "@rails/actioncable", to: "actioncable.esm.js"
pin "@hotwired/turbo-rails", to: "turbo.min.js"
pin "@hotwired/stimulus", to: "stimulus.min.js"
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"

# use rails importmap:update to update these to the latest version
pin "stimulus-autocomplete", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/optimized/stimulus-autocomplete.js", preload: true # source: https://cdn.skypack.dev/stimulus-autocomplete
pin "el-transition", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/optimized/el-transition.js", preload: true # source: https://cdn.skypack.dev/el-transition
pin "highcharts", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/unoptimized/es-modules/masters/highcharts.src.js" # source: https://cdn.skypack.dev/highcharts/es-modules/masters/highcharts.src.js
pin "highcharts-annotations", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/unoptimized/es-modules/masters/modules/annotations.src.js" # source: https://cdn.skypack.dev/highcharts/es-modules/masters/modules/annotations.src.js
pin "prismjs", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/optimized/prismjs.js" # source: https://cdn.skypack.dev/prismjs/prism.js
pin "stimulus-autocomplete", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/optimized/stimulus-autocomplete.js"
pin "el-transition", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/optimized/el-transition.js"
pin "highcharts", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/unoptimized/es-modules/masters/highcharts.src.js"
pin "highcharts-annotations", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/unoptimized/es-modules/masters/modules/annotations.src.js"
pin "prismjs", to: "https://cdn.skypack.dev/pin/[email protected]/mode=imports/optimized/prismjs.js"

pin_all_from "app/javascript/channels", under: "channels"
pin_all_from "app/javascript/controllers", under: "controllers"
Expand Down
57 changes: 0 additions & 57 deletions lib/tasks/update_importmap.rake

This file was deleted.

0 comments on commit a5e38b3

Please sign in to comment.