Skip to content

Commit

Permalink
Rubocop fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rhomeister committed Feb 11, 2018
1 parent e1f5932 commit 063a05c
Show file tree
Hide file tree
Showing 166 changed files with 323 additions and 109 deletions.
90 changes: 78 additions & 12 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,98 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-01-03 04:53:24 +0100 using RuboCop version 0.45.0.
# on 2018-02-11 20:53:46 +0000 using RuboCop version 0.52.1.
# 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: 3
# Offense count: 1
Lint/BooleanSymbol:
Exclude:
- 'app/controllers/setup_controller.rb'

# Offense count: 10
Metrics/AbcSize:
Max: 32

# Offense count: 3
# Configuration parameters: CountComments.
# Offense count: 26
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 121

# Offense count: 156
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives.
# URISchemes: http, https
Metrics/LineLength:
Max: 120

# Offense count: 7
# Offense count: 12
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 17

# Offense count: 24
# Offense count: 2
# Configuration parameters: Include.
# Include: db/migrate/*.rb
Rails/CreateTableWithTimestamps:
Exclude:
- 'db/migrate/20170103063306_create_author_submission_join_table.rb'
- 'db/migrate/20170108014805_create_memberships_teams_join_table.rb'

# Offense count: 6
Rails/FilePath:
Exclude:
- 'app/controllers/setup_controller.rb'
- 'config/environments/development.rb'
- 'config/initializers/paperclip.rb'
- 'config/initializers/sidekiq.rb'
- 'lib/tasks/cucumber.rake'

# Offense count: 3
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Exclude:
- 'app/models/membership.rb'
- 'app/models/team.rb'
- 'app/models/test.rb'

# Offense count: 4
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/InverseOf:
Exclude:
- 'app/models/course.rb'
- 'app/models/submission.rb'
- 'app/models/team.rb'
- 'app/models/user.rb'

# Offense count: 1
# Configuration parameters: Include.
# Include: db/migrate/*.rb
Rails/ReversibleMigration:
Exclude:
- 'db/migrate/20170108202754_drop_author_submissions_join_table.rb'

# Offense count: 2
# Configuration parameters: Blacklist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
Rails/SkipsModelValidations:
Exclude:
- 'app/controllers/omniauth_callbacks_controller.rb'

# Offense count: 83
Style/Documentation:
Enabled: false

# Offense count: 1
# Configuration parameters: .
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
EnforcedStyle: unannotated

# Offense count: 2
Style/MixinUsage:
Exclude:
- 'bin/setup'
- 'bin/update'

# Offense count: 260
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 130
1 change: 1 addition & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Load DSL and Setup Up Stages
require 'capistrano/setup'

Expand Down
59 changes: 30 additions & 29 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

git_source(:github) do |repo_name|
Expand All @@ -25,8 +26,8 @@ gem 'coffee-rails', '~> 4.2'
#
gem 'haml'

gem 'paperclip', '~> 5.0'
gem 'aws-sdk', '~> 2.3.0'
gem 'paperclip', '~> 5.0'
gem 'rubyzip'

# Use jquery as the JavaScript library
Expand Down Expand Up @@ -60,84 +61,84 @@ gem 'git_stats'
gem 'sidekiq'

group :development, :test do
gem 'pry'
gem 'factory_girl_rails'
gem 'faker'
gem 'pry'
end

group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.0.5'
gem 'web-console', '>= 3.3.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'

gem 'letter_opener'
gem 'happy_seed'
gem 'letter_opener'

gem 'rubocop', require: false
gem 'brakeman', require: false
gem 'rubocop', require: false

# capistrano

gem 'capistrano', '~> 3.8', require: false, group: :development
# Deploy with capistrano, see config/deploy.rb
gem 'capistrano-rails', '~> 1.1', require: false
gem 'capistrano-bundler', '~> 1.1', require: false
gem 'capistrano-postgresql', '~> 4.2.1', require: false
gem 'capistrano-rails', '~> 1.1', require: false
gem 'capistrano-safe-deploy-to', '~> 1.1.1', require: false
gem 'rvm1-capistrano3', '~> 1.3.2', require: false
gem 'capistrano-postgresql', '~> 4.2.1', require: false
# gem 'capistrano-memcached', '~> 1.2.0', require: false
gem 'capistrano-unicorn-nginx', '~> 4.1', require: false
# gem 'capistrano-faster-assets', '~> 1.0.2', require: false
gem 'capistrano-sidekiq', require: false
end

group :test do
gem 'rspec-rails'
gem 'capybara'
gem 'rails-controller-testing'
gem 'rspec-collection_matchers'
gem 'rspec-mocks'
gem 'rspec-rails'
gem 'spring-commands-rspec'
gem 'rspec-collection_matchers'
gem 'vcr'
gem 'webmock'
gem 'rails-controller-testing'
gem 'capybara'
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]

gem 'bh'
gem 'bootstrap-sass'
gem 'modernizr-rails'
gem 'cancancan'
gem 'devise', '~> 4.2'
gem 'github_webhook', '~> 1.0.2'
gem 'meta-tags', require: 'meta_tags'
gem 'responders', '~> 2.0'
gem 'bh'
gem 'premailer-rails'
gem 'modernizr-rails'
gem 'nokogiri'
gem 'devise', '~> 4.2'
gem 'cancancan'
gem 'octokit'
gem 'omniauth'
gem 'omniauth-oauth2', '1.3.1'
gem 'omniauth-facebook'
gem 'omniauth-github'
gem 'octokit'
gem 'github_webhook', '~> 1.0.2'
gem 'omniauth-oauth2', '1.3.1'
gem 'premailer-rails'
gem 'responders', '~> 2.0'

gem 'omniauth-google-oauth2'
# gem 'google-api-client', require: 'google/api_client'

gem 'omniauth-twitter'
gem 'twitter'
gem 'ckeditor'
gem 'activeadmin', github: 'activeadmin'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'kaminari', github: 'amatsuda/kaminari', branch: '0-17-stable'
gem 'formtastic', github: 'justinfrench/formtastic'
gem 'draper', github: 'audionerd/draper', branch: 'rails5', ref: 'e816e0e587'
gem 'activemodel-serializers-xml', github: 'rails/activemodel-serializers-xml'
gem 'ckeditor'
gem 'dateslices'
gem 'draper', github: 'audionerd/draper', branch: 'rails5', ref: 'e816e0e587'
gem 'formtastic', github: 'justinfrench/formtastic'
gem 'gretel'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
gem 'kaminari', github: 'amatsuda/kaminari', branch: '0-17-stable'
gem 'omniauth-twitter'
gem 'ransack', github: 'activerecord-hackery/ransack'
gem 'twitter'

ruby '~> 2.4'
20 changes: 11 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ GEM
arbre (1.1.1)
activesupport (>= 3.0.0)
arel (7.1.4)
ast (2.3.0)
ast (2.4.0)
autoprefixer-rails (6.6.0)
execjs
aws-sdk (2.3.22)
Expand Down Expand Up @@ -362,8 +362,9 @@ GEM
cocaine (~> 0.5.5)
mime-types
mimemagic (~> 0.3.0)
parser (2.3.1.4)
ast (~> 2.2)
parallel (1.12.1)
parser (2.4.0.2)
ast (~> 2.3)
pg (0.18.2)
polyamorous (1.3.1)
activerecord (>= 3.0)
Expand Down Expand Up @@ -411,7 +412,7 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.1.0)
rainbow (3.0.0)
raindrops (0.19.0)
rake (12.0.0)
rb-fsevent (0.9.8)
Expand Down Expand Up @@ -443,13 +444,14 @@ GEM
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubocop (0.45.0)
parser (>= 2.3.1.1, < 3.0)
rubocop (0.52.1)
parallel (~> 1.10)
parser (>= 2.4.0.2, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
ruby-progressbar (1.9.0)
rubyzip (1.1.7)
rvm1-capistrano3 (1.3.2.2)
capistrano (~> 3.0)
Expand Down Expand Up @@ -512,7 +514,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.1.1)
unicode-display_width (1.3.0)
unicorn (5.3.0)
kgio (~> 2.6)
raindrops (~> 0.7)
Expand Down
3 changes: 2 additions & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

Expand Down Expand Up @@ -67,7 +68,7 @@ guard :rspec, cmd: 'bin/rspec', all_on_start: true do
dsl.watch_spec_files_for(ruby.lib_files)

# Rails files
rails = dsl.rails(view_extensions: %w(erb haml slim))
rails = dsl.rails(view_extensions: %w[erb haml slim])
dsl.watch_spec_files_for(rails.app_files)
dsl.watch_spec_files_for(rails.views)

Expand Down
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

Expand Down
1 change: 1 addition & 0 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

ActiveAdmin.register_page 'Dashboard' do
menu priority: 1, label: proc { I18n.t('active_admin.dashboard') }

Expand Down
1 change: 1 addition & 0 deletions app/admin/user.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# frozen_string_literal: true

ActiveAdmin.register User
1 change: 1 addition & 0 deletions app/channels/application_cable/channel.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module ApplicationCable
class Channel < ActionCable::Channel::Base
end
Expand Down
1 change: 1 addition & 0 deletions app/channels/application_cable/connection.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :current_user
Expand Down
1 change: 1 addition & 0 deletions app/channels/submissions_channel.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class SubmissionsChannel < ApplicationCable::Channel
def subscribed
stream_from "submissions_#{current_user.id}"
Expand Down
1 change: 1 addition & 0 deletions app/controllers/admin/stats_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

module Admin
class StatsController < ApplicationController
before_action :authenticate_admin_user!
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
check_authorization unless: :devise_controller?

Expand All @@ -12,8 +13,7 @@ def redirect_to_primary_domain
redirect_to "#{request.protocol}#{ENV.fetch('DOMAIN_NAME')}#{request.fullpath}", status: :moved_permanently
end

def page_title
end
def page_title; end

def access_denied(exception)
redirect_to root_path, alert: exception.message
Expand Down
7 changes: 3 additions & 4 deletions app/controllers/assignments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

class AssignmentsController < ApplicationController
load_and_authorize_resource :course
load_and_authorize_resource through: :course
Expand All @@ -11,11 +12,9 @@ def show
@assignment = @assignment.decorate
end

def new
end
def new; end

def edit
end
def edit; end

def index
redirect_to @course
Expand Down
Loading

0 comments on commit 063a05c

Please sign in to comment.