Patch allow-non-breakable-words on '-'
This commit is contained in:
@@ -78,6 +78,12 @@ class LineLengthTestCase(RuleTestCase):
|
|||||||
' # http://localhost/very/long/url\n'
|
' # http://localhost/very/long/url\n'
|
||||||
' comment\n'
|
' comment\n'
|
||||||
'...\n', conf)
|
'...\n', conf)
|
||||||
|
self.check('---\n'
|
||||||
|
'this:\n'
|
||||||
|
'is:\n'
|
||||||
|
'another:\n'
|
||||||
|
' - https://localhost/very/very/long/url\n'
|
||||||
|
'...\n', conf)
|
||||||
|
|
||||||
conf = 'line-length: {max: 20, allow-non-breakable-words: no}'
|
conf = 'line-length: {max: 20, allow-non-breakable-words: no}'
|
||||||
self.check('---\n' + 30 * 'A' + '\n', conf, problem=(2, 21))
|
self.check('---\n' + 30 * 'A' + '\n', conf, problem=(2, 21))
|
||||||
@@ -94,3 +100,9 @@ class LineLengthTestCase(RuleTestCase):
|
|||||||
' # http://localhost/very/long/url\n'
|
' # http://localhost/very/long/url\n'
|
||||||
' comment\n'
|
' comment\n'
|
||||||
'...\n', conf, problem=(5, 21))
|
'...\n', conf, problem=(5, 21))
|
||||||
|
self.check('---\n'
|
||||||
|
'this:\n'
|
||||||
|
'is:\n'
|
||||||
|
'another:\n'
|
||||||
|
' - https://localhost/very/very/long/url\n'
|
||||||
|
'...\n', conf, problem=(5, 21))
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ def check(conf, line):
|
|||||||
start += 1
|
start += 1
|
||||||
|
|
||||||
if start != line.end:
|
if start != line.end:
|
||||||
if line.buffer[start] == '#':
|
if line.buffer[start] in ('#', '-'):
|
||||||
start += 2
|
start += 2
|
||||||
|
|
||||||
if line.buffer.find(' ', start, line.end) == -1:
|
if line.buffer.find(' ', start, line.end) == -1:
|
||||||
|
|||||||
Reference in New Issue
Block a user