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

@ -4,7 +4,7 @@
# The alternative is a broken website when this happens
class ActiveSupport::SafeBuffer
def concat(value, raise_encoding_err=false)
def concat(value, raise_encoding_err = false)
if !html_safe? || value.html_safe?
super(value)
else
@ -22,8 +22,8 @@ class ActiveSupport::SafeBuffer
self.force_encoding("UTF-8")
unless valid_encoding?
encode!("utf-16","utf-8",:invalid => :replace)
encode!("utf-8","utf-16")
encode!("utf-16", "utf-8", invalid: :replace)
encode!("utf-8", "utf-16")
end
Rails.logger.warn("Encountered a non UTF-8 string in SafeBuffer - #{self} - #{encoding_diags}")
end
@ -36,7 +36,7 @@ class ActiveSupport::SafeBuffer
Rails.logger.warn("Attempted to concat a non UTF-8 string in SafeBuffer - #{value} - #{encoding_diags}")
end
concat(value,_raise=true)
concat(value, _raise = true)
end
end