DEV: enable frozen string literal on all files

This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.

Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
This commit is contained in:
Sam Saffron
2019-05-03 08:17:27 +10:00
committed by Guo Xiang Tan
parent 4e1f25197d
commit 30990006a9
2201 changed files with 4482 additions and 90 deletions

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'upload_creator'
class Admin::EmojisController < Admin::AdminController

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'flag_query'
class Admin::FlaggedTopicsController < Admin::AdminController

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'flag_query'
class Admin::FlagsController < Admin::AdminController

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::GroupsController < Admin::AdminController
def bulk
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::ImpersonateController < Admin::AdminController
def create

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::PermalinksController < Admin::AdminController
before_action :fetch_permalink, only: [:destroy]

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::PluginsController < Admin::AdminController
def index

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'report'
class Admin::ReportsController < Admin::AdminController

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::ScreenedEmailsController < Admin::AdminController
def index

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'ip_addr'
class Admin::ScreenedIpAddressesController < Admin::AdminController

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::ScreenedUrlsController < Admin::AdminController
def index

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::SearchLogsController < Admin::AdminController
def index

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::SiteSettingsController < Admin::AdminController
rescue_from Discourse::InvalidParameters do |e|
render_json_error e.message, status: 422

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'seed_data/categories'
require_dependency 'seed_data/topics'

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::StaffActionLogsController < Admin::AdminController
def index
@@ -22,7 +24,7 @@ class Admin::StaffActionLogsController < Admin::AdminController
diff_fields = {}
output = "<h2>#{CGI.escapeHTML(cur["name"].to_s)}</h2><p></p>"
output = +"<h2>#{CGI.escapeHTML(cur["name"].to_s)}</h2><p></p>"
diff_fields["name"] = {
prev: prev["name"].to_s,

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'upload_creator'
require_dependency 'theme_store/tgz_exporter'
require 'base64'

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::UserFieldsController < Admin::AdminController
def self.columns

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'user_destroyer'
require_dependency 'admin_user_index_query'
require_dependency 'admin_confirmation'

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require_dependency 'discourse_updates'
class Admin::VersionsController < Admin::AdminController

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::WatchedWordsController < Admin::AdminController
def index

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Admin::WebHooksController < Admin::AdminController
before_action :fetch_web_hook, only: %i(show update destroy list_events bulk_events ping)