1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

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
This commit is contained in:
Toshi MARUYAMA 2019-10-17 16:39:43 +00:00
parent f891a28152
commit cae3f78eba
2 changed files with 3 additions and 5 deletions

View File

@ -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.

View File

@ -144,7 +144,7 @@ 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 ) )
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