Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@ -166,7 +166,7 @@ module Email
elsif bounce_score >= SiteSetting.bounce_score_threshold
# NOTE: we check bounce_score before sending emails, nothing to do
# here other than log it happened.
reason = I18n.t("user.email.revoked", { email: user.email, date: user.user_stat.reset_bounce_score_after })
reason = I18n.t("user.email.revoked", email: user.email, date: user.user_stat.reset_bounce_score_after)
StaffActionLogger.new(Discourse.system_user).log_revoke_email(user, reason)
end
end
@ -466,7 +466,7 @@ module Email
true
end
def self.reply_by_email_address_regex(extract_reply_key=true)
def self.reply_by_email_address_regex(extract_reply_key = true)
reply_addresses = [SiteSetting.reply_by_email_address]
reply_addresses << (SiteSetting.alternative_reply_by_email_addresses.presence || "").split("|")
@ -538,11 +538,11 @@ module Email
PostActionType.types[:like] if likes.include?(body.strip.downcase)
end
def create_topic(options={})
def create_topic(options = {})
create_post_with_attachments(options)
end
def create_reply(options={})
def create_reply(options = {})
raise TopicNotFoundError if options[:topic].nil? || options[:topic].trashed?
if post_action_type = post_action_for(options[:raw])
@ -572,7 +572,7 @@ module Email
end
end
def create_post_with_attachments(options={})
def create_post_with_attachments(options = {})
# deal with attachments
attachments.each do |attachment|
tmp = Tempfile.new(["discourse-email-attachment", File.extname(attachment.filename)])
@ -612,7 +612,7 @@ module Email
end
end
def create_post(options={})
def create_post(options = {})
options[:via_email] = true
options[:raw_email] = @raw_email
@ -622,7 +622,7 @@ module Email
raise InvalidPost, "No post creation date found. Is the e-mail missing a Date: header?"
end
options[:created_at] = DateTime.now if options[:created_at] > DateTime.now
options[:created_at] = DateTime.now if options[:created_at] > DateTime.now
is_private_message = options[:archetype] == Archetype.private_message ||
options[:topic].try(:private_message?)