summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-17 16:39:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-17 16:39:43 +0000
commitcae3f78ebab10ccacacbd8f4192ac63a2790a12e (patch)
tree09a0fe801ed3423f24916a2e07f333daeae4638e
parentf891a28152f88885e548181e98bb81742002138f (diff)
downloadredmine-cae3f78ebab10ccacacbd8f4192ac63a2790a12e.tar.gz
redmine-cae3f78ebab10ccacacbd8f4192ac63a2790a12e.zip
code cleanup: rubocop: fix Style/CharacterLiteral and Style/ParenthesesAroundCondition in lib/redmine/wiki_formatting.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18719 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--.rubocop_todo.yml2
-rw-r--r--lib/redmine/wiki_formatting.rb6
2 files changed, 3 insertions, 5 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 38ddef746..4c56f5509 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -920,7 +920,6 @@ Style/BracesAroundHashParameters:
# Cop supports --auto-correct.
Style/CharacterLiteral:
Exclude:
- - 'lib/redmine/wiki_formatting.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
# Cop supports --auto-correct.
@@ -1226,7 +1225,6 @@ Style/ParenthesesAroundCondition:
- 'lib/redmine/helpers/gantt.rb'
- 'lib/redmine/scm/adapters/cvs_adapter.rb'
- 'lib/redmine/scm/adapters/git_adapter.rb'
- - 'lib/redmine/wiki_formatting.rb'
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
# Cop supports --auto-correct.
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 1dc320c47..64f2fc544 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -144,9 +144,9 @@ module Redmine
else
# Idea below : an URL with unbalanced parenthesis and
# ending by ')' is put into external parenthesis
- if ( url[-1]==?) and ((url.count("(") - url.count(")")) < 0 ) )
- url=url[0..-2] # discard closing parenthesis from url
- post = ")"+post # add closing parenthesis to post
+ if url[-1] == ")" and ((url.count("(") - url.count(")")) < 0)
+ url = url[0..-2] # discard closing parenthesis from url
+ post = ")" + post # add closing parenthesis to post
end
content = proto + url
href = "#{proto=="www."?"http://www.":proto}#{url}"