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

@ -28,8 +28,8 @@ class DiscourseCLI < Thor
discourse remap --regex "\[\/?color(=[^\]]*)*]" "" # removing "color" bbcodes
LONGDESC
option :global, :type => :boolean
option :regex, :type => :boolean
option :global, type: :boolean
option :regex, type: :boolean
def remap(from, to)
load_rails
@ -48,7 +48,7 @@ class DiscourseCLI < Thor
if options[:global]
RailsMultisite::ConnectionManagement.each_connection do |db|
puts "","Remapping tables on #{db}...",""
puts "", "Remapping tables on #{db}...", ""
do_remap(from, to, options[:regex])
end
else
@ -85,7 +85,7 @@ class DiscourseCLI < Thor
end
desc "restore", "Restore a Discourse backup"
def restore(filename=nil)
def restore(filename = nil)
if !filename
puts "You must provide a filename to restore. Did you mean one of the following?\n\n"
@ -175,7 +175,7 @@ class DiscourseCLI < Thor
end
desc "export_category", "Export a category, all its topics, and all users who posted in those topics"
def export_category(category_id, filename=nil)
def export_category(category_id, filename = nil)
raise "Category id argument is missing!" unless category_id
load_rails
@ -225,7 +225,7 @@ class DiscourseCLI < Thor
require File.expand_path(File.dirname(__FILE__) + "/../lib/import_export/import_export")
end
def do_remap(from, to, regex=false)
def do_remap(from, to, regex = false)
sql = "SELECT table_name, column_name
FROM information_schema.columns
WHERE table_schema='public' and (data_type like 'char%' or data_type like 'text%') and is_updatable = 'YES'"
@ -257,7 +257,6 @@ WHERE table_schema='public' and (data_type like 'char%' or data_type like 'text%
end
end
end
DiscourseCLI.start(ARGV)