Add rubocop-rails-omakase gem
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
@@ -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")
|
||||
|
||||
@@ -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.
|
||||
#
|
||||
|
||||
@@ -17,7 +17,7 @@ Rails.application.configure do
|
||||
config.consider_all_requests_local = true
|
||||
|
||||
# Allow access when running in docker
|
||||
config.web_console.allowed_ips = ["172.16.0.0/12", "192.168.0.0/16"]
|
||||
config.web_console.allowed_ips = [ "172.16.0.0/12", "192.168.0.0/16" ]
|
||||
|
||||
# Enable server timing
|
||||
config.server_timing = true
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
||||
ActiveSupport.on_load(:action_controller) do
|
||||
wrap_parameters format: [:json]
|
||||
wrap_parameters format: [ :json ]
|
||||
end
|
||||
|
||||
# To enable root element in JSON for ActiveRecord objects.
|
||||
|
||||
@@ -52,6 +52,6 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
|
||||
setting = config.options[config.orm][:primary_key_type]
|
||||
primary_key_type = setting || :primary_key
|
||||
foreign_key_type = setting || :bigint
|
||||
[primary_key_type, foreign_key_type]
|
||||
[ primary_key_type, foreign_key_type ]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -21,6 +21,6 @@ class CreateActionTextTables < ActiveRecord::Migration[6.0]
|
||||
setting = config.options[config.orm][:primary_key_type]
|
||||
primary_key_type = setting || :primary_key
|
||||
foreign_key_type = setting || :bigint
|
||||
[primary_key_type, foreign_key_type]
|
||||
[ primary_key_type, foreign_key_type ]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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,10 +12,9 @@ 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
|
||||
# TODO: with rich_text, this is not a textarea
|
||||
# assert_select "textarea[name=?]", "article[content]"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,10 +12,9 @@ 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
|
||||
# TODO: with rich_text, this is not a textarea
|
||||
# assert_select "textarea[name=?]", "article[content]"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user