Enable Performance/StartWith cop and fix offenses
This commit is contained in:
parent
bc806831e8
commit
2de1109da3
3 changed files with 3 additions and 4 deletions
|
@ -985,11 +985,10 @@ Performance/RedundantMerge:
|
||||||
Performance/RedundantSortBy:
|
Performance/RedundantSortBy:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# TODO: Enable StartWith Cop.
|
|
||||||
# Use `start_with?` instead of a regex match anchored to the beginning of a
|
# Use `start_with?` instead of a regex match anchored to the beginning of a
|
||||||
# string.
|
# string.
|
||||||
Performance/StartWith:
|
Performance/StartWith:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
# Use `tr` instead of `gsub` when you are replacing the same number of
|
# Use `tr` instead of `gsub` when you are replacing the same number of
|
||||||
# characters. Use `delete` instead of `gsub` when you are deleting
|
# characters. Use `delete` instead of `gsub` when you are deleting
|
||||||
|
|
|
@ -13,7 +13,7 @@ module GitlabMarkdownHelper
|
||||||
def link_to_gfm(body, url, html_options = {})
|
def link_to_gfm(body, url, html_options = {})
|
||||||
return "" if body.blank?
|
return "" if body.blank?
|
||||||
|
|
||||||
escaped_body = if body =~ /\A\<img/
|
escaped_body = if body.start_with?('<img')
|
||||||
body
|
body
|
||||||
else
|
else
|
||||||
escape_once(body)
|
escape_once(body)
|
||||||
|
|
|
@ -112,7 +112,7 @@ module TabHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def profile_tab_class
|
def profile_tab_class
|
||||||
if controller.controller_path =~ /\Aprofiles/
|
if controller.controller_path.start_with?('profiles')
|
||||||
return 'active'
|
return 'active'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue