Add rubocop-rails-omakase gem

This commit is contained in:
Ryan W
2023-12-30 16:30:37 -08:00
parent 18e0822ee2
commit cfcebd12db
13 changed files with 31 additions and 19 deletions
+4
View File
@@ -2,6 +2,10 @@ require:
- rubocop-rails
- rubocop-rspec
# Omakase Ruby styling for Rails
inherit_gem:
rubocop-rails-omakase: rubocop.yml
AllCops:
TargetRubyVersion: 3.3.0
TargetRailsVersion: 7.1.0
+1
View File
@@ -55,6 +55,7 @@ group :development, :test do
gem "debug", platforms: %i[ mri windows ]
gem "rspec-rails"
gem "rubocop-rails"
gem "rubocop-rails-omakase", require: false
gem "rubocop-rspec"
end
+12
View File
@@ -257,11 +257,22 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-minitest (0.34.2)
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)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
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
rubocop-rspec (2.25.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
@@ -330,6 +341,7 @@ DEPENDENCIES
redis (~> 5.0)
rspec-rails
rubocop-rails
rubocop-rails-omakase
rubocop-rspec
selenium-webdriver
sprockets-rails
+6 -8
View File
@@ -8,14 +8,12 @@
# this file is here to facilitate running it.
#
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
Pathname.new(__FILE__).realpath)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
bundle_binstub = File.expand_path('bundle', __dir__)
bundle_binstub = File.expand_path("bundle", __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
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.
@@ -23,7 +21,7 @@ Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this
end
end
require 'rubygems'
require 'bundler/setup'
require "rubygems"
require "bundler/setup"
load Gem.bin_path('rubocop', 'rubocop')
load Gem.bin_path("rubocop", "rubocop")
+1 -1
View File
@@ -28,7 +28,7 @@ module Railsondocker
# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w(assets tasks))
config.autoload_lib(ignore: %w[assets tasks])
# Configuration for the application, engines, and railties goes here.
#
+1 -1
View File
@@ -7,4 +7,4 @@
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code
# by setting BACKTRACE=1 before calling your invocation, like "BACKTRACE=1 ./bin/rails runner 'MyClass.perform'".
Rails.backtrace_cleaner.remove_silencers! if ENV['BACKTRACE']
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"]
-1
View File
@@ -13,7 +13,6 @@
# sticking to rails and rspec-rails APIs to keep things simple and stable.
RSpec.describe "/articles", type: :request do
# Article. As you add validations to Article, be sure to
# adjust the attributes here as well.
let(:valid_attributes) {
@@ -12,7 +12,6 @@ RSpec.describe "articles/edit", type: :view do
render
assert_select "form[action=?][method=?]", article_path(@article), "post" do
assert_select "input[name=?]", "article[title]"
# TODO: with rich_text, this is not a textarea
-1
View File
@@ -12,7 +12,6 @@ RSpec.describe "articles/new", type: :view do
render
assert_select "form[action=?][method=?]", articles_path, "post" do
assert_select "input[name=?]", "article[title]"
# TODO: with rich_text, this is not a textarea