Allow long lines if they contain http links
Bug #1383662 reported by
Adi Roiban
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pocket-lint |
New
|
Undecided
|
Unassigned |
Bug Description
In readme files or documentation (rst) files I need to insert http links. Some of them are very long and is not possible to break them.
I have a patch with ignore long lines with http or https links in them.
code exception is hardcoded and brutal but it does it job.
I will send to patch in case someone else find it useful
To post a comment you must log in.
here is a preview... let me know if you agree on this bug and I can send a review request
diff --git a/pocketlint/ formatcheck. py b/pocketlint/ formatcheck. py formatcheck. py formatcheck. py length_ filter ' in line or 'https:/ /' in line:
self. message(
line_ no, 'Line exceeds %s characters.' % max_length,
icon= 'info') tests/test_ text.py b/pocketlint/ tests/test_ text.py tests/test_ text.py tests/test_ text.py
self. reporter. messages)
index afec408..e75dd8a 100755
--- a/pocketlint/
+++ b/pocketlint/
@@ -410,6 +410,9 @@ class AnyTextMixin:
"""Check the length of the line."""
max_length = self.check_
if len(line) > max_length:
+ # Ignore if line is long due to an URL.
+ if 'http://
+ return
diff --git a/pocketlint/
index 6a6f29d..56743aa 100644
--- a/pocketlint/
+++ b/pocketlint/
@@ -40,6 +40,18 @@ class TestAnyTextMixin:
[(1, 'Line exceeds 80 characters.')],
+ def test_long_ length_ http_exception( self): some.url 56189' * 9 and_check( 'bogus' , long_line) l([], self.reporter. messages) /some.url 56189' * 9 and_check( 'bogus' , long_line) l([], self.reporter. messages) trailing_ whitespace( self):
self. create_ and_check( 'bogus' , 'no trailing white-space')
self. assertEqual( [], self.reporter. messages)
+ """
+ Long line with http or https links are ignored.
+ """
+ long_line = '1234 http://
+ self.create_
+ self.assertEqua
+
+ long_line = '1234 https:/
+ self.create_
+ self.assertEqua
+
def test_no_