Skip to content
Permalink
Browse files

chore: πŸ€– Eject onkcop

  • Loading branch information
okonomi committed Dec 30, 2019
1 parent 2b1a493 commit b2d92034725e0395daf7de2958a971124899ddc8
@@ -1,16 +1,55 @@
inherit_gem:
onkcop:
- "config/rubocop.yml"
- "config/rails.yml"
- "config/rspec.yml"
- "config/performance.yml"

inherit_mode:
merge:
- Exclude

AllCops:
TargetRubyVersion: 2.6
TargetRailsVersion: 6.0
Exclude:
- "bin/*"
- "db/schema.rb"
- "node_modules/**/*"
- "test/**/*"

Layout/LineLength:
Max: 200

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods

Layout/SpaceInsideBlockBraces:
SpaceBeforeBlockParameters: false

Metrics/AbcSize:
Max: 20

Style/Documentation:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/EmptyMethod:
EnforcedStyle: expanded

Style/GuardClause:
MinBodyLength: 5

Style/IfUnlessModifier:
Enabled: false

Metrics/MethodLength:
Max: 20
Exclude:
- "db/migrate/*.rb"

Metrics/BlockLength:
Exclude:
- "spec/**/*"
- "config/environments/*"
12 Gemfile
@@ -38,13 +38,11 @@ gem "active_decorator"

gem "newrelic_rpm"

gem "onkcop", require: false, github: "okonomi/onkcop"

gem "meta-tags"

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "byebug", platforms: [:mri, :mingw, :x64_mingw]
gem "byebug", platforms: %i[mri mingw x64_mingw]

gem "pry-byebug"
gem "pry-doc"
@@ -74,6 +72,12 @@ group :development do
gem "stackprof"

gem "bullet"

gem "rubocop"
gem "rubocop-performance"
gem "rubocop-rails"
gem "rubocop-rake"
gem "rubocop-rspec"
end

group :test do
@@ -85,4 +89,4 @@ group :test do
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
@@ -1,13 +1,3 @@
GIT
remote: https://github.com/okonomi/onkcop.git
revision: 0281dd1cf447240feb08a21571e16d4358fe451e
specs:
onkcop (0.53.0.3)
rubocop (>= 0.53.0)
rubocop-performance (>= 1.3.0)
rubocop-rails (>= 2.0.0)
rubocop-rspec (>= 1.24.0)

GEM
remote: https://rubygems.org/
specs:
@@ -242,11 +232,13 @@ GEM
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-performance (1.5.1)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.4.0)
rubocop-rails (2.4.1)
rack (>= 1.1)
rubocop (>= 0.72.0)
rubocop-rake (0.5.0)
rubocop
rubocop-rspec (1.37.1)
rubocop (>= 0.68.1)
ruby-progressbar (1.10.1)
@@ -328,7 +320,6 @@ DEPENDENCIES
omniauth
omniauth-github
omniauth-rails_csrf_protection
onkcop!
pg (>= 0.18, < 2.0)
pry-byebug
pry-doc
@@ -338,6 +329,11 @@ DEPENDENCIES
rack-mini-profiler
rails (~> 6.0.0)
rspec-rails
rubocop
rubocop-performance
rubocop-rails
rubocop-rake
rubocop-rspec
sass-rails (~> 5)
selenium-webdriver
spring
@@ -8,7 +8,7 @@ def show

private

def already_logged_in
redirect_to root_path if logged_in?
end
def already_logged_in
redirect_to root_path if logged_in?
end
end
@@ -1,5 +1,5 @@
class PostsController < ApplicationController
before_action :set_post, only: [:show, :edit, :update, :destroy]
before_action :set_post, only: %i[show edit update destroy]
after_action :verify_authorized

def index
@@ -1,5 +1,5 @@
class TagsController < ApplicationController
def show
@tag = Tag.includes(posts: [:tags, :rich_text_content]).find(params[:id])
@tag = Tag.includes(posts: %i[tags rich_text_content]).find(params[:id])
end
end
@@ -1,6 +1,6 @@
atom_feed do |feed|
feed.title(ENV.fetch("BLOG_TITLE"))
feed.updated(@posts.first.updated_at) if @posts.length > 0
feed.updated(@posts.first.updated_at) unless @posts.empty?

@posts.each do |post|
feed.entry(post) do |entry|
@@ -20,7 +20,7 @@ def change

t.datetime :created_at, null: false

t.index [:record_type, :record_id, :name, :blob_id], name: "index_active_storage_attachments_uniqueness", unique: true
t.index %i[record_type record_id name blob_id], name: "index_active_storage_attachments_uniqueness", unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
@@ -8,7 +8,7 @@ def change

t.timestamps

t.index [:record_type, :record_id, :name], name: "index_action_text_rich_texts_uniqueness", unique: true
t.index %i[record_type record_id name], name: "index_action_text_rich_texts_uniqueness", unique: true
end
end
end
@@ -8,7 +8,7 @@
# Add additional requires below this line. Rails is not loaded until this point!
require "pundit/rspec"

Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f }
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each {|f| require f }

OmniAuth.config.test_mode = true

0 comments on commit b2d9203

Please sign in to comment.
You can’t perform that action at this time.