1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-10-17 17:01:01 +00:00

code cleanup: rubocop: fix Style/CharacterLiteral and Style/ParenthesesAroundCondition in lib/redmine/wiki_formatting/textile/redcloth3.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@18720 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2019-10-17 16:39:55 +00:00
parent cae3f78eba
commit 8bac080b8c
2 changed files with 2 additions and 8 deletions

View File

@ -917,11 +917,6 @@ Style/BlockDelimiters:
Style/BracesAroundHashParameters:
Enabled: false
# Cop supports --auto-correct.
Style/CharacterLiteral:
Exclude:
- 'lib/redmine/wiki_formatting/textile/redcloth3.rb'
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
@ -1225,7 +1220,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/textile/redcloth3.rb'
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.

View File

@ -673,7 +673,7 @@ class RedCloth3 < String
block_applied = 0
@rules.each do |rule_name|
block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) )
block_applied += 1 if rule_name.to_s.match /^block_/ and method(rule_name).call(blk)
end
if block_applied.zero?
if deep_code
@ -836,7 +836,7 @@ class RedCloth3 < String
# Idea below : an URL with unbalanced parethesis 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 parenth from url
post = ")"+post # add closing parenth to post
end