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:
Allan Lewis
2016-09-17 13:28:17 +01:00
committed by Allan Lewis
parent d017631aff
commit e56a7c788c
4 changed files with 33 additions and 6 deletions

View File

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