line_length: Extract inline logic to new config option
This commit extracts the inline mappings logic defined in the previous commit to a separate config option, as suggested by @adrienverge. I'll squash this into the previous commit if the change is accepted. (I named the option slightly differently to what was suggested as I think my proposal reads better without consulting the docs: I'd be happy to reconsider this.)
This commit is contained in:
@@ -85,7 +85,8 @@ class LineLengthTestCase(RuleTestCase):
|
||||
' - https://localhost/very/very/long/url\n'
|
||||
'...\n', conf)
|
||||
self.check('---\n'
|
||||
'long_line: http://localhost/very/very/long/url\n', conf)
|
||||
'long_line: http://localhost/very/very/long/url\n', conf,
|
||||
problem=(2, 21))
|
||||
|
||||
conf = 'line-length: {max: 20, allow-non-breakable-words: no}'
|
||||
self.check('---\n' + 30 * 'A' + '\n', conf, problem=(2, 21))
|
||||
@@ -111,3 +112,8 @@ class LineLengthTestCase(RuleTestCase):
|
||||
self.check('---\n'
|
||||
'long_line: http://localhost/very/very/long/url\n'
|
||||
'...\n', conf, problem=(2, 21))
|
||||
|
||||
conf = 'line-length: {max: 20, ' \
|
||||
'allow-non-breakable-inline-mappings: yes}'
|
||||
self.check('---\n'
|
||||
'long_line: http://localhost/very/very/long/url\n', conf)
|
||||
|
||||
Reference in New Issue
Block a user