Skip to content

A platform for community discussion. Free, open, simple.

DEV: Enable `Style/SingleLineMethods` and `Style/Semicolon` in Rubocop (#6717)

David Taylor9248ad190524
diff --git a/.rubocop.yml b/.rubocop.yml
index e28a0876aa1..9f2254dd3a6 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -114,3 +114,10 @@ Layout/AlignHash:
Bundler/OrderedGems:
Enabled: false
+
+Style/SingleLineMethods:
+ Enabled: true
+
+Style/Semicolon:
+ Enabled: true
+ AllowAsExpressionSeparator: true
\ No newline at end of file
diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb
index fec948e8be0..2d353702258 100644
--- a/app/mailers/user_notifications.rb
+++ b/app/mailers/user_notifications.rb
@@ -575,7 +575,7 @@ class UserNotifications < ActionMailer::Base
if SiteSetting.private_email?
message = I18n.t('system_messages.contents_hidden')
else
- message = email_post_markdown(post) + (reached_limit ? "\n\n#{I18n.t "user_notifications.reached_limit", count: SiteSetting.max_emails_per_day_per_user}" : "");
+ message = email_post_markdown(post) + (reached_limit ? "\n\n#{I18n.t "user_notifications.reached_limit", count: SiteSetting.max_emails_per_day_per_user}" : "")
end
first_footer_classes = "hilight"
diff --git a/app/models/backup_location_site_setting.rb b/app/models/backup_location_site_setting.rb
index aef3c89fec3..4763c3be047 100644
--- a/app/models/backup_location_site_setting.rb
+++ b/app/models/backup_location_site_setting.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_dependency 'enum_site_setting';
+require_dependency 'enum_site_setting'
class BackupLocationSiteSetting < EnumSiteSetting
LOCAL ||= "local"
diff --git a/app/models/queued_post.rb b/app/models/queued_post.rb
index a4067f8c57a..92cc688fa96 100644
--- a/app/models/queued_post.rb
+++ b/app/models/queued_post.rb
@@ -1,6 +1,6 @@
class QueuedPost < ActiveRecord::Base
- class InvalidStateTransition < StandardError; end;
+ class InvalidStateTransition < StandardError; end
belongs_to :user
belongs_to :topic
diff --git a/db/migrate/20150818190757_create_embeddable_hosts.rb b/db/migrate/20150818190757_create_embeddable_hosts.rb
index c5ae2ac36a8..fc52e7bb8c8 100644
--- a/db/migrate/20150818190757_create_embeddable_hosts.rb
+++ b/db/migrate/20150818190757_create_embeddable_hosts.rb
@@ -6,7 +6,7 @@ class CreateEmbeddableHosts < ActiveRecord::Migration[4.2]
t.timestamps null: false
end
- category_id = 0;
+ category_id = 0
category_row = execute("SELECT c.id FROM categories AS c
INNER JOIN site_settings AS s ON s.value = c.name
WHERE s.name = 'embed_category'")
diff --git a/lib/autospec/qunit_runner.rb b/lib/autospec/qunit_runner.rb
index 6598207c74a..91e3d3983cb 100644
--- a/lib/autospec/qunit_runner.rb
+++ b/lib/autospec/qunit_runner.rb
@@ -5,8 +5,12 @@ module Autospec
class QunitRunner < BaseRunner
WATCHERS = {}
- def self.watch(pattern, &blk); WATCHERS[pattern] = blk; end
- def watchers; WATCHERS; end
+ def self.watch(pattern, &blk)
+ WATCHERS[pattern] = blk
+ end
+ def watchers
+ WATCHERS
+ end
# Discourse specific
watch(%r{^app/assets/javascripts/discourse/(.+)\.js.es6$}) { |m| "test/javascripts/#{m[1]}-test.js.es6" }
@@ -14,8 +18,12 @@ module Autospec
watch(%r{^test/javascripts/.+\.js.es6$})
RELOADERS = Set.new
- def self.reload(pattern); RELOADERS << pattern; end
- def reloaders; RELOADERS; end
+ def self.reload(pattern)
+ RELOADERS << pattern
+ end
+ def reloaders
+ RELOADERS
+ end
# Discourse specific
reload(%r{^test/javascripts/fixtures/.+_fixtures\.js(\.es6)?$})
diff --git a/lib/autospec/rspec_runner.rb b/lib/autospec/rspec_runner.rb
index e8848c6937a..64cb0302080 100644
--- a/lib/autospec/rspec_runner.rb
+++ b/lib/autospec/rspec_runner.rb
@@ -3,8 +3,12 @@ module Autospec
class RspecRunner < BaseRunner
WATCHERS = {}
- def self.watch(pattern, &blk); WATCHERS[pattern] = blk; end
- def watchers; WATCHERS; end
+ def self.watch(pattern, &blk)
+ WATCHERS[pattern] = blk
+ end
+ def watchers
+ WATCHERS
+ end
# Discourse specific
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/components/#{m[1]}_spec.rb" }
@@ -30,8 +34,12 @@ module Autospec
watch(%r{^(plugins/.*)/lib/(.*)\.rb}) { |m| "#{m[1]}/spec/lib/#{m[2]}_spec.rb" }
RELOADERS = Set.new
- def self.reload(pattern); RELOADERS << pattern; end
- def reloaders; RELOADERS; end
+ def self.reload(pattern)
+ RELOADERS << pattern
+ end
+ def reloaders
+ RELOADERS
+ end
# we are using a simple runner at the moment, whole idea of using a reloader is no longer needed
watch("spec/rails_helper.rb")
diff --git a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb
index 10802feaac9..f45884fb8b5 100644
--- a/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb
+++ b/lib/es6_module_transpiler/tilt/es6_module_transpiler_template.rb
@@ -28,7 +28,7 @@ module Tilt
ctx = MiniRacer::Context.new(timeout: 15000)
ctx.eval("var self = this; #{File.read("#{Rails.root}/vendor/assets/javascripts/babel.js")}")
ctx.eval(File.read(Ember::Source.bundled_path_for('ember-template-compiler.js')))
- ctx.eval("module = {}; exports = {};");
+ ctx.eval("module = {}; exports = {};")
ctx.attach("rails.logger.info", proc { |err| Rails.logger.info(err.to_s) })
ctx.attach("rails.logger.error", proc { |err| Rails.logger.error(err.to_s) })
ctx.eval <<JS
diff --git a/lib/guardian.rb b/lib/guardian.rb
index 0f8d5689b2d..f06ec7c051b 100644
--- a/lib/guardian.rb
+++ b/lib/guardian.rb
@@ -19,17 +19,39 @@ class Guardian
include TagGuardian
class AnonymousUser
- def blank?; true; end
- def admin?; false; end
- def staff?; false; end
- def moderator?; false; end
- def approved?; false; end
- def staged?; false; end
- def silenced?; false; end
- def secure_category_ids; []; end
- def topic_create_allowed_category_ids; []; end
- def has_trust_level?(level); false; end
- def email; nil; end
+ def blank?
+ true
+ end
+ def admin?
+ false
+ end
+ def staff?
+ false
+ end
+ def moderator?
+ false
+ end
+ def approved?
+ false
+ end
+ def staged?
+ false
+ end
+ def silenced?
+ false
+ end
+ def secure_category_ids
+ []
+ end
+ def topic_create_allowed_category_ids
+ []
+ end
+ def has_trust_level?(level)
+ false
+ end
+ def email
+ nil
+ end
end
attr_accessor :can_see_emails
diff --git a/lib/html_to_markdown.rb b/lib/html_to_markdown.rb
index 3f362e6f945..a213611ea3f 100644
--- a/lib/html_to_markdown.rb
+++ b/lib/html_to_markdown.rb
@@ -3,7 +3,9 @@ require "nokogiri"
class HtmlToMarkdown
class Block < Struct.new(:name, :head, :body, :opened, :markdown)
- def initialize(name, head = "", body = "", opened = false, markdown = ""); super; end
+ def initialize(name, head = "", body = "", opened = false, markdown = "")
+ super
+ end
end
def initialize(html, opts = {})
diff --git a/lib/migration/safe_migrate.rb b/lib/migration/safe_migrate.rb
index d777f095bd0..4ec48aa8f7b 100644
--- a/lib/migration/safe_migrate.rb
+++ b/lib/migration/safe_migrate.rb
@@ -50,7 +50,9 @@ class Migration::SafeMigrate
super
rescue => e
if e.cause.is_a?(Discourse::InvalidMigration)
- def e.cause; nil; end
+ def e.cause
+ nil
+ end
def e.backtrace
super.reject do |frame|
frame =~ /safe_migrate\.rb/ || frame =~ /schema_migration_details\.rb/
diff --git a/lib/stylesheet/compiler.rb b/lib/stylesheet/compiler.rb
index 5aff8dfdba4..8cba8e677bc 100644
--- a/lib/stylesheet/compiler.rb
+++ b/lib/stylesheet/compiler.rb
@@ -32,7 +32,7 @@ module Stylesheet
end
def self.compile(stylesheet, filename, options = {})
- source_map_file = options[:source_map_file] || "#{filename.sub(".scss", "")}.css.map";
+ source_map_file = options[:source_map_file] || "#{filename.sub(".scss", "")}.css.map"
engine = SassC::Engine.new(stylesheet,
importer: Importer,
diff --git a/lib/validators/allow_user_locale_enabled_validator.rb b/lib/validators/allow_user_locale_enabled_validator.rb
index 73d3cb5c51b..09a283212c4 100644
--- a/lib/validators/allow_user_locale_enabled_validator.rb
+++ b/lib/validators/allow_user_locale_enabled_validator.rb
@@ -12,7 +12,7 @@ class AllowUserLocaleEnabledValidator
end
def error_message
- I18n.t("site_settings.errors.user_locale_not_enabled");
+ I18n.t("site_settings.errors.user_locale_not_enabled")
end
end
diff --git a/script/bulk_import/base.rb b/script/bulk_import/base.rb
index 0ac869d96ef..9401fc16fd5 100644
--- a/script/bulk_import/base.rb
+++ b/script/bulk_import/base.rb
@@ -183,14 +183,28 @@ class BulkImport::Base
@raw_connection.exec("SELECT setval('#{PostAction.sequence_name}', #{@last_post_action_id})") if @last_post_action_id > 0
end
- def group_id_from_imported_id(id); @groups[id.to_s]; end
- def user_id_from_imported_id(id); @users[id.to_s]; end
- def category_id_from_imported_id(id); @categories[id.to_s]; end
- def topic_id_from_imported_id(id); @topics[id.to_s]; end
- def post_id_from_imported_id(id); @posts[id.to_s]; end
+ def group_id_from_imported_id(id)
+ @groups[id.to_s]
+ end
+ def user_id_from_imported_id(id)
+ @users[id.to_s]
+ end
+ def category_id_from_imported_id(id)
+ @categories[id.to_s]
+ end
+ def topic_id_from_imported_id(id)
+ @topics[id.to_s]
+ end
+ def post_id_from_imported_id(id)
+ @posts[id.to_s]
+ end
- def post_number_from_imported_id(id); @post_number_by_post_id[post_id_from_imported_id(id)]; end
- def topic_id_from_imported_post_id(id); @topic_id_by_post_id[post_id_from_imported_id(id)]; end
+ def post_number_from_imported_id(id)
+ @post_number_by_post_id[post_id_from_imported_id(id)]
+ end
+ def topic_id_from_imported_post_id(id)
+ @topic_id_by_post_id[post_id_from_imported_id(id)]
+ end
GROUP_COLUMNS ||= %i{
id name title bio_raw bio_cooked created_at updated_at
@@ -250,7 +264,9 @@ class BulkImport::Base
topic_id tag_id created_at updated_at
}
- def create_groups(rows, &block); create_records(rows, "group", GROUP_COLUMNS, &block); end
+ def create_groups(rows, &block)
+ create_records(rows, "group", GROUP_COLUMNS, &block)
+ end
def create_users(rows, &block)
@imported_usernames = {}
@@ -273,16 +289,36 @@ class BulkImport::Base
end
end
- def create_user_emails(rows, &block) create_records(rows, "user_email", USER_EMAIL_COLUMNS, &block); end
- def create_user_stats(rows, &block) create_records(rows, "user_stat", USER_STAT_COLUMNS, &block); end
- def create_user_profiles(rows, &block); create_records(rows, "user_profile", USER_PROFILE_COLUMNS, &block); end
- def create_group_users(rows, &block); create_records(rows, "group_user", GROUP_USER_COLUMNS, &block); end
- def create_categories(rows, &block); create_records(rows, "category", CATEGORY_COLUMNS, &block); end
- def create_topics(rows, &block); create_records(rows, "topic", TOPIC_COLUMNS, &block); end
- def create_posts(rows, &block); create_records(rows, "post", POST_COLUMNS, &block); end
- def create_post_actions(rows, &block); create_records(rows, "post_action", POST_ACTION_COLUMNS, &block); end
- def create_topic_allowed_users(rows, &block); create_records(rows, "topic_allowed_user", TOPIC_ALLOWED_USER_COLUMNS, &block); end
- def create_topic_tags(rows, &block); create_records(rows, "topic_tag", TOPIC_TAG_COLUMNS, &block); end
+ def create_user_emails(rows, &block)
+ create_records(rows, "user_email", USER_EMAIL_COLUMNS, &block)
+ end
+ def create_user_stats(rows, &block)
+ create_records(rows, "user_stat", USER_STAT_COLUMNS, &block)
+ end
+ def create_user_profiles(rows, &block)
+ create_records(rows, "user_profile", USER_PROFILE_COLUMNS, &block)
+ end
+ def create_group_users(rows, &block)
+ create_records(rows, "group_user", GROUP_USER_COLUMNS, &block)
+ end
+ def create_categories(rows, &block)
+ create_records(rows, "category", CATEGORY_COLUMNS, &block)
+ end
+ def create_topics(rows, &block)
+ create_records(rows, "topic", TOPIC_COLUMNS, &block)
+ end
+ def create_posts(rows, &block)
+ create_records(rows, "post", POST_COLUMNS, &block)
+ end
+ def create_post_actions(rows, &block)
+ create_records(rows, "post_action", POST_ACTION_COLUMNS, &block)
+ end
+ def create_topic_allowed_users(rows, &block)
+ create_records(rows, "topic_allowed_user", TOPIC_ALLOWED_USER_COLUMNS, &block)
+ end
+ def create_topic_tags(rows, &block)
+ create_records(rows, "topic_tag", TOPIC_TAG_COLUMNS, &block)
+ end
def process_group(group)
@groups[group[:imported_id].to_s] = group[:id] = @last_group_id += 1
@@ -339,7 +375,7 @@ class BulkImport::Base
end
def process_user_email(user_email)
- user_email[:id] = @last_user_email_id += 1;
+ user_email[:id] = @last_user_email_id += 1
user_email[:user_id] = @users[user_email[:imported_user_id].to_s]
user_email[:primary] = true
user_email[:created_at] ||= NOW
diff --git a/script/compile_hbs.rb b/script/compile_hbs.rb
index 785aae6b38e..21d2b22713e 100644
--- a/script/compile_hbs.rb
+++ b/script/compile_hbs.rb
@@ -1,7 +1,7 @@
ctx = MiniRacer::Context.new(timeout: 15000)
ctx.eval("var self = this; #{File.read("#{Rails.root}/vendor/assets/javascripts/babel.js")}")
ctx.eval(File.read(Ember::Source.bundled_path_for('ember-template-compiler.js')))
-ctx.eval("module = {}; exports = {};");
+ctx.eval("module = {}; exports = {};")
ctx.attach("rails.logger.info", proc { |err| puts(">> #{err.to_s}") })
ctx.attach("rails.logger.error", proc { |err| puts(">> #{err.to_s}") })
ctx.eval <<JS
@@ -20,5 +20,5 @@ ctx.eval(js)
if ARGV[0].present?
source = File.read(ARGV[0])
js_source = ::JSON.generate(source, quirks_mode: true)
- puts ctx.eval("exports.compile(#{js_source})");
+ puts ctx.eval("exports.compile(#{js_source})")
end
diff --git a/script/import_scripts/bespoke_1.rb b/script/import_scripts/bespoke_1.rb
index 0026ff30ace..0607a616000 100644
--- a/script/import_scripts/bespoke_1.rb
+++ b/script/import_scripts/bespoke_1.rb
@@ -65,7 +65,7 @@ class ImportScripts::Bespoke < ImportScripts::Base
first = true
row = nil
- current_row = "";
+ current_row = ""
double_quote_count = 0
File.open(filename).each_line do |line|
diff --git a/script/import_scripts/drupal_qa.rb b/script/import_scripts/drupal_qa.rb
index 98d79198646..b7bad2fbf6a 100644
--- a/script/import_scripts/drupal_qa.rb
+++ b/script/import_scripts/drupal_qa.rb
@@ -52,7 +52,7 @@ class ImportScripts::DrupalQA < ImportScripts::Drupal
GROUP BY n.nid, n.title, n.uid, n.created, f.body_value
LIMIT #{batch_size}
OFFSET #{offset}
- ", cache_rows: false);
+ ", cache_rows: false)
break if results.size < 1
diff --git a/script/import_scripts/jive.rb b/script/import_scripts/jive.rb
index ae077bda2ee..586e5443af8 100644
--- a/script/import_scripts/jive.rb
+++ b/script/import_scripts/jive.rb
@@ -67,7 +67,7 @@ class ImportScripts::Jive < ImportScripts::Base
first = true
row = nil
- current_row = "";
+ current_row = ""
double_quote_count = 0
File.open(filename).each_line do |line|
diff --git a/script/import_scripts/lithium.rb b/script/import_scripts/lithium.rb
index 834f97cec28..2296d71a1fa 100644
--- a/script/import_scripts/lithium.rb
+++ b/script/import_scripts/lithium.rb
@@ -1019,7 +1019,7 @@ SQL
end
def html_for_attachments(user_id, files)
- html = "";
+ html = ""
files.each do |file|
upload, filename = find_upload(user_id, file["attachment_id"], file["file_name"])
diff --git a/script/import_scripts/nabble.rb b/script/import_scripts/nabble.rb
index ac3a93f8dcf..8f371da4e80 100644
--- a/script/import_scripts/nabble.rb
+++ b/script/import_scripts/nabble.rb
@@ -172,7 +172,7 @@ class ImportScripts::Nabble < ImportScripts::Base
txt.gsub! /\<quote author="(.*?)"\>/, '[quote="\1"]'
txt.gsub! /\<\/quote\>/, '[/quote]'
txt.gsub!(/\<raw\>(.*?)\<\/raw\>/m) do |match|
- c = Regexp.last_match[1].indent(4);
+ c = Regexp.last_match[1].indent(4)
"\n#{c}\n"
end
diff --git a/script/import_scripts/phpbb3/database/database.rb b/script/import_scripts/phpbb3/database/database.rb
index fa88352349f..3cc3bd9e439 100644
--- a/script/import_scripts/phpbb3/database/database.rb
+++ b/script/import_scripts/phpbb3/database/database.rb
@@ -53,6 +53,6 @@ module ImportScripts::PhpBB3
end
end
- class UnsupportedVersionError < RuntimeError;
+ class UnsupportedVersionError < RuntimeError
end
end
diff --git a/script/test_hbs_compiler.rb b/script/test_hbs_compiler.rb
index 0045b942545..e5dec469ad4 100644
--- a/script/test_hbs_compiler.rb
+++ b/script/test_hbs_compiler.rb
@@ -19,7 +19,7 @@ HBS
ctx = MiniRacer::Context.new(timeout: 15000)
ctx.eval("var self = this; #{File.read("#{Rails.root}/vendor/assets/javascripts/babel.js")}")
ctx.eval(File.read(Ember::Source.bundled_path_for('ember-template-compiler.js')))
-ctx.eval("module = {}; exports = {};");
+ctx.eval("module = {}; exports = {};")
ctx.attach("rails.logger.info", proc { |err| puts(err.to_s) })
ctx.attach("rails.logger.error", proc { |err| puts(err.to_s) })
ctx.eval <<JS
@@ -35,4 +35,4 @@ ctx.eval(source)
js_source = ::JSON.generate(template, quirks_mode: true)
-puts ctx.eval("exports.compile(#{js_source})");
+puts ctx.eval("exports.compile(#{js_source})")
diff --git a/spec/components/auth/managed_authenticator_spec.rb b/spec/components/auth/managed_authenticator_spec.rb
index 300a4cc0f52..da02c870521 100644
--- a/spec/components/auth/managed_authenticator_spec.rb
+++ b/spec/components/auth/managed_authenticator_spec.rb
@@ -3,7 +3,9 @@ require 'rails_helper'
describe Auth::ManagedAuthenticator do
let(:authenticator) {
Class.new(described_class) do
- def name; "myauth" end
+ def name
+ "myauth"
+ end
end.new
}
@@ -55,8 +57,12 @@ describe Auth::ManagedAuthenticator do
it 'does not work when disabled' do
authenticator = Class.new(described_class) do
- def name; "myauth" end
- def can_connect_existing_user?; false end
+ def name
+ "myauth"
+ end
+ def can_connect_existing_user?
+ false
+ end
end.new
result = authenticator.after_authenticate(hash, existing_account: user2)
expect(result.user.id).to eq(user1.id)
@@ -81,8 +87,12 @@ describe Auth::ManagedAuthenticator do
it 'does not match if match_by_email is false' do
authenticator = Class.new(described_class) do
- def name; "myauth" end
- def match_by_email; false end
+ def name
+ "myauth"
+ end
+ def match_by_email
+ false
+ end
end.new
user = Fabricate(:user, email: "[email protected]")
result = authenticator.after_authenticate(hash)
diff --git a/spec/components/guardian_spec.rb b/spec/components/guardian_spec.rb
index 9f9da726038..c05b994f7a9 100644
--- a/spec/components/guardian_spec.rb
+++ b/spec/components/guardian_spec.rb
@@ -1,4 +1,4 @@
-require 'rails_helper';
+require 'rails_helper'
require 'guardian'
require_dependency 'post_destroyer'
diff --git a/spec/components/plugin/instance_spec.rb b/spec/components/plugin/instance_spec.rb
index 2104f72dffa..48cdc6ac6eb 100644
--- a/spec/components/plugin/instance_spec.rb
+++ b/spec/components/plugin/instance_spec.rb
@@ -36,7 +36,9 @@ describe Plugin::Instance do
class TroutPlugin < Plugin::Instance
attr_accessor :enabled
- def enabled?; @enabled; end
+ def enabled?
+ @enabled
+ end
end
before do
diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb
index 208b08d14fc..64ce1a3a402 100644
--- a/spec/components/pretty_text_spec.rb
+++ b/spec/components/pretty_text_spec.rb
@@ -1118,13 +1118,13 @@ HTML
it "supports url bbcode" do
cooked = PrettyText.cook "[url]http://sam.com[/url]"
- html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener">http://sam.com</a></p>';
+ html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener">http://sam.com</a></p>'
expect(cooked).to eq(html)
end
it "supports nesting tags in url" do
cooked = PrettyText.cook("[url=http://sam.com][b]I am sam[/b][/url]")
- html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener"><span class="bbcode-b">I am sam</span></a></p>';
+ html = '<p><a href="http://sam.com" data-bbcode="true" rel="nofollow noopener"><span class="bbcode-b">I am sam</span></a></p>'
expect(cooked).to eq(html)
end
diff --git a/spec/lib/content_security_policy_spec.rb b/spec/lib/content_security_policy_spec.rb
index ba625860f1e..40f618d2e37 100644
--- a/spec/lib/content_security_policy_spec.rb
+++ b/spec/lib/content_security_policy_spec.rb
@@ -86,7 +86,9 @@ describe ContentSecurityPolicy do
it 'can be extended by plugins' do
plugin = Class.new(Plugin::Instance) do
attr_accessor :enabled
- def enabled?; @enabled; end
+ def enabled?
+ @enabled
+ end
end.new(nil, "#{Rails.root}/spec/fixtures/plugins/csp_extension/plugin.rb")
plugin.activate!
diff --git a/spec/models/topic_user_spec.rb b/spec/models/topic_user_spec.rb
index aa333172cfe..fca57e78047 100644
--- a/spec/models/topic_user_spec.rb
+++ b/spec/models/topic_user_spec.rb
@@ -240,7 +240,7 @@ describe TopicUser do
create_post(
archetype: Archetype.private_message,
target_usernames: target_user.username
- );
+ )
end
let(:topic) { post.topic }
diff --git a/spec/requests/categories_controller_spec.rb b/spec/requests/categories_controller_spec.rb
index 871c3d02b6a..ec9b28123a7 100644
--- a/spec/requests/categories_controller_spec.rb
+++ b/spec/requests/categories_controller_spec.rb
@@ -184,7 +184,7 @@ describe CategoriesController do
c3 = Fabricate(:category)
c4 = Fabricate(:category)
if c3.id < c2.id
- tmp = c3; c2 = c3; c3 = tmp;
+ tmp = c3; c2 = c3; c3 = tmp
end
c1.position = 8
c2.position = 6
diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rb
index 84b232b986f..137649c3d8c 100644
--- a/spec/requests/users_controller_spec.rb
+++ b/spec/requests/users_controller_spec.rb
@@ -470,7 +470,7 @@ describe UsersController do
get "/u/admin-login/#{email_token.token}"
expect(response).not_to redirect_to('/')
expect(session[:current_user_id]).not_to eq(admin.id)
- expect(response.body).to include(I18n.t('login.second_factor_description'));
+ expect(response.body).to include(I18n.t('login.second_factor_description'))
end
describe 'invalid 2 factor token' do
@@ -483,8 +483,8 @@ describe UsersController do
}
expect(response.status).to eq(200)
- expect(response.body).to include(I18n.t('login.second_factor_description'));
- expect(response.body).to include(I18n.t('login.invalid_second_factor_code'));
+ expect(response.body).to include(I18n.t('login.second_factor_description'))
+ expect(response.body).to include(I18n.t('login.invalid_second_factor_code'))
end
end