bump rubocop (#690)

This commit is contained in:
Peter Bhat Harkins 2019-06-18 06:54:27 -07:00 committed by GitHub
commit 1b448d916e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 41 additions and 41 deletions

View File

@ -6,8 +6,7 @@
require:
- ./extras/prohibit_safe_navigation
- ./extras/prohibit_form_for_and_form_tag
Rails:
Enabled: true
- rubocop-rails
AllCops:
Include:
- '**/*.rb'
@ -43,7 +42,7 @@ Layout/EmptyLinesAroundExceptionHandlingKeywords:
Enabled: false
Layout/EndAlignment:
EnforcedStyleAlignWith: variable
Layout/IndentHash:
Layout/IndentFirstHashElement:
EnforcedStyle: consistent
Layout/MultilineMethodCallBraceLayout:
Enabled: false
@ -97,10 +96,6 @@ Naming/VariableName:
Enabled: false
# Performance
Performance/Casecmp:
Enabled: false
Performance/RedundantMatch:
Enabled: false
# Rails
Rails/Blank:
@ -115,6 +110,8 @@ Rails/Present:
UnlessBlank: false
Rails/SkipsModelValidations:
Enabled: false
Rails/HelperInstanceVariable:
Enabled: false
# Security

View File

@ -50,6 +50,7 @@ group :test, :development do
gem "rspec-rails"
gem "factory_bot_rails"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false
gem "faker"
gem "byebug"

View File

@ -100,7 +100,7 @@ GEM
htmlentities (4.3.4)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.1)
jaro_winkler (1.5.2)
jquery-rails (4.3.3)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
@ -128,10 +128,9 @@ GEM
nokogiri (1.10.1)
mini_portile2 (~> 2.4.0)
oauth (0.5.4)
parallel (1.12.1)
parser (2.5.3.0)
parallel (1.17.0)
parser (2.6.3.0)
ast (~> 2.4.0)
powerpack (0.1.2)
public_suffix (3.0.3)
rack (2.0.6)
rack-test (1.1.0)
@ -189,19 +188,21 @@ GEM
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.60.0)
rubocop (0.71.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.4.0)
rubocop-rspec (1.30.1)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-rails (2.0.1)
rack (>= 1.1)
rubocop (>= 0.70.0)
rubocop-rspec (1.33.0)
rubocop (>= 0.60.0)
ruby-enum (0.7.2)
i18n
ruby-progressbar (1.10.0)
ruby-progressbar (1.10.1)
ruby_dep (1.5.0)
ruumba (0.1.8)
rubocop
@ -226,7 +227,7 @@ GEM
thread_safe (~> 0.1)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.4.0)
unicode-display_width (1.6.0)
unicorn (5.4.1)
kgio (~> 2.6)
raindrops (~> 0.7)
@ -268,6 +269,7 @@ DEPENDENCIES
rqrcode
rspec-rails
rubocop
rubocop-rails
rubocop-rspec
ruumba
scenic

View File

@ -9,13 +9,13 @@ class Comment < ApplicationRecord
belongs_to :parent_comment,
:class_name => "Comment",
:inverse_of => false,
:required => false
:optional => true
has_one :moderation,
:class_name => "Moderation",
:inverse_of => :comment,
:dependent => :destroy
belongs_to :hat,
:required => false
:optional => true
has_many :taggings, through: :story
attr_accessor :current_vote, :previewing, :indent_level

View File

@ -1,6 +1,6 @@
class Invitation < ApplicationRecord
belongs_to :user
belongs_to :new_user, class_name: 'User', inverse_of: nil, required: false
belongs_to :new_user, class_name: 'User', inverse_of: nil, optional: true
scope :used, -> { where.not(:used_at => nil) }
scope :unused, -> { where(:used_at => nil) }

View File

@ -8,7 +8,7 @@ class Message < ApplicationRecord
:foreign_key => "author_user_id",
:inverse_of => :sent_messages
belongs_to :hat,
:required => false
:optional => true
attribute :mod_note, :boolean
attr_reader :recipient_username

View File

@ -3,15 +3,15 @@ class Moderation < ApplicationRecord
:class_name => "User",
:foreign_key => "moderator_user_id",
:inverse_of => :moderations,
:required => false
:optional => true
belongs_to :comment,
:required => false
:optional => true
belongs_to :story,
:required => false
:optional => true
belongs_to :tag,
:required => false
:optional => true
belongs_to :user,
:required => false
:optional => true
scope :for, ->(user) {
left_outer_joins(:story, :comment) .where("

View File

@ -4,7 +4,7 @@ class Story < ApplicationRecord
:class_name => "Story",
:foreign_key => "merged_story_id",
:inverse_of => :merged_stories,
:required => false
:optional => true
has_many :merged_stories,
:class_name => "Story",
:foreign_key => "merged_story_id",

View File

@ -22,15 +22,15 @@ class User < ApplicationRecord
belongs_to :invited_by_user,
:class_name => "User",
:inverse_of => false,
:required => false
:optional => true
belongs_to :banned_by_user,
:class_name => "User",
:inverse_of => false,
:required => false
:optional => true
belongs_to :disabled_invite_by_user,
:class_name => "User",
:inverse_of => false,
:required => false
:optional => true
has_many :invitations, :dependent => :destroy
has_many :moderations,
:inverse_of => :moderator,

View File

@ -1,7 +1,7 @@
class Vote < ApplicationRecord
belongs_to :user, required: false
belongs_to :story, required: false
belongs_to :comment, required: false
belongs_to :user, optional: true
belongs_to :story, optional: true
belongs_to :comment, optional: true
COMMENT_REASONS = {
"O" => "Off-topic",

View File

@ -24,22 +24,22 @@ if parser.been_here?
exit
elsif !parser.sending_user
STDERR.puts "no active user with mailing list token #{parser.user_token}"
warn "no active user with mailing list token #{parser.user_token}"
# if this looks like a user token but invalid, generate a bounce to be
# helpful. otherwise supress it to avoid talking back to spammers
exit(parser.user_token ? EX_NOUSER : 0)
elsif !parser.email
STDERR.puts "error parsing e-mail"
warn "error parsing e-mail"
exit EX_UNAVAILABLE
elsif !parser.parent
STDERR.puts "no valid comment or story being replied to"
warn "no valid comment or story being replied to"
exit EX_NOUSER
elsif !parser.body.present?
STDERR.puts "no valid text/plain body found"
warn "no valid text/plain body found"
exit EX_UNAVAILABLE
end
@ -58,6 +58,6 @@ end
if c.save
exit
else
STDERR.puts c.errors.inspect
warn c.errors.inspect
exit EX_UNAVAILABLE
end

View File

@ -26,7 +26,7 @@ if their_users.empty?
raise "Intemittent Twitter bug: they said the list is empty when it's not"
end
if their_users.count >= 5000
STDERR.puts "need to implement paging for list members"
warn "need to implement paging for list members"
end
# fetch our active users that have a linked twitter account

View File

@ -28,7 +28,7 @@ describe TagsController do
hotness_mod: 1.5,
privileged: true,
inactive: true,
}, }
} }
tag = Tag.find_by(tag: 'mytag')
expect(tag.description).to eq 'desc'
expect(tag.is_media).to be true