Skip to content

Commit

Permalink
Added rubocop.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jul 6, 2018
1 parent 3e1c6fc commit fc034c9
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 19 deletions.
18 changes: 18 additions & 0 deletions .rubocop.yml
@@ -0,0 +1,18 @@
AllCops:
Exclude:
- vendor/**/*

Metrics:
Enabled: false

Metrics/LineLength:
Max: 256
Enabled: false

Style/Documentation:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

inherit_from: .rubocop_todo.yml
13 changes: 13 additions & 0 deletions .rubocop_todo.yml
@@ -0,0 +1,13 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-07-05 20:42:49 -0400 using RuboCop version 0.57.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 2
Style/MixinUsage:
Exclude:
- 'bin/setup'
- 'bin/update'
7 changes: 4 additions & 3 deletions Gemfile
Expand Up @@ -3,14 +3,15 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.1'

gem 'rails', '~> 5.2.0'
gem 'puma', '~> 3.11'
gem 'mongoid'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'mongoid'
gem 'puma', '~> 3.11'
gem 'rails', '~> 5.2.0'

gem 'rack-cors'

group :development, :test do
gem 'rubocop'
end

group :development do
Expand Down
18 changes: 18 additions & 0 deletions Gemfile.lock
Expand Up @@ -43,6 +43,7 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (9.0.0)
ast (2.4.0)
bootsnap (1.3.0)
msgpack (~> 1.0)
bson (4.3.0)
Expand All @@ -55,6 +56,7 @@ GEM
activesupport (>= 4.2.0)
i18n (1.0.1)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.1-x86_64-darwin-17)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -80,6 +82,10 @@ GEM
nio4r (2.3.1)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
parallel (1.12.1)
parser (2.5.1.0)
ast (~> 2.4.0)
powerpack (0.1.2)
puma (3.11.4)
rack (2.0.5)
rack-cors (1.0.2)
Expand Down Expand Up @@ -109,10 +115,20 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rubocop (0.57.2)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.9.0)
ruby_dep (1.5.0)
spring (2.0.2)
activesupport (>= 4.2)
Expand All @@ -130,6 +146,7 @@ GEM
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.0)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
Expand All @@ -144,6 +161,7 @@ DEPENDENCIES
puma (~> 3.11)
rack-cors
rails (~> 5.2.0)
rubocop
spring
spring-watcher-listen (~> 2.0.0)

Expand Down
2 changes: 1 addition & 1 deletion bin/rails
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
load File.expand_path('spring', __dir__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
Expand Down
2 changes: 1 addition & 1 deletion bin/rake
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
load File.expand_path('spring', __dir__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
Expand Down
2 changes: 1 addition & 1 deletion bin/spring
Expand Up @@ -8,7 +8,7 @@ unless defined?(Spring)
require 'bundler'

lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
spring = lockfile.specs.detect { |spec| spec.name == "spring" }
spring = lockfile.specs.detect { |spec| spec.name == 'spring' }
if spring
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem 'spring', spring.version
Expand Down
14 changes: 7 additions & 7 deletions config/application.rb
@@ -1,15 +1,15 @@
require_relative 'boot'

require "rails"
require 'rails'
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require 'active_model/railtie'
require 'active_job/railtie'
# require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'action_view/railtie'
require 'action_cable/engine'
# require "sprockets/railtie"
# require "rails/test_unit/railtie"

Expand Down
1 change: 0 additions & 1 deletion config/environments/development.rb
Expand Up @@ -35,7 +35,6 @@
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log


# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

Expand Down
4 changes: 2 additions & 2 deletions config/environments/production.rb
Expand Up @@ -42,7 +42,7 @@
config.log_level = :debug

# Prepend all log lines with the following tags.
config.log_tags = [ :request_id ]
config.log_tags = [:request_id]

# Use a different cache store in production.
# config.cache_store = :mem_cache_store
Expand Down Expand Up @@ -71,7 +71,7 @@
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')

if ENV["RAILS_LOG_TO_STDOUT"].present?
if ENV['RAILS_LOG_TO_STDOUT'].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
Expand Down
6 changes: 3 additions & 3 deletions config/puma.rb
Expand Up @@ -4,16 +4,16 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
threads threads_count, threads_count

# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
port ENV.fetch("PORT") { 3000 }
port ENV.fetch('PORT') { 3000 }

# Specifies the `environment` that Puma will run in.
#
environment ENV.fetch("RAILS_ENV") { "development" }
environment ENV.fetch('RAILS_ENV') { 'development' }

# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
Expand Down

0 comments on commit fc034c9

Please sign in to comment.