From 529dfc131b3e668ac77f9897996fef85715d908a Mon Sep 17 00:00:00 2001 From: gabrieldemarmiesse <gabrieldemarmiesse@gmail.com> Date: Sun, 12 Aug 2018 12:33:52 +0200 Subject: [PATCH] Set the maximum line length to 150. --- Cython/Compiler/Code.py | 3 ++- Cython/Compiler/ExprNodes.py | 3 ++- Cython/Compiler/Symtab.py | 4 +++- tests/run/pure_py.py | 3 ++- tox.ini | 4 ++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index 45e6cd338..e7dc66941 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -2297,7 +2297,8 @@ class CCodeWriter(object): # error handling def put_error_if_neg(self, pos, value): -# return self.putln("if (unlikely(%s < 0)) %s" % (value, self.error_goto(pos))) # TODO this path is almost _never_ taken, yet this macro makes is slower! + # TODO this path is almost _never_ taken, yet this macro makes is slower! + # return self.putln("if (unlikely(%s < 0)) %s" % (value, self.error_goto(pos))) return self.putln("if (%s < 0) %s" % (value, self.error_goto(pos))) def put_error_if_unbound(self, pos, entry, in_nogil_context=False): diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 1bc28fa82..e1404dc54 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -5807,7 +5807,8 @@ class SimpleCallNode(CallNode): and self.type.is_int and self.type.signed and self.function.result() in ('abs', 'labs', '__Pyx_abs_longlong')): - goto_error = 'if (unlikely(%s < 0)) { PyErr_SetString(PyExc_OverflowError, "value too large"); %s; }' % (self.result(), code.error_goto(self.pos)) + goto_error = 'if (unlikely(%s < 0)) { PyErr_SetString(PyExc_OverflowError, "value too large"); %s; }' % ( + self.result(), code.error_goto(self.pos)) elif exc_checks: goto_error = code.error_goto_if(" && ".join(exc_checks), self.pos) else: diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 4fe903cb1..2af2b9d95 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -2237,7 +2237,9 @@ class CClassScope(ClassScope): # TODO(robertwb): Make this an error. warning(pos, "Compatible but non-identical C method '%s' not redeclared " - "in definition part of extension type '%s'. This may cause incorrect vtables to be generated." % (name, self.class_name), 2) + "in definition part of extension type '%s'. " + "This may cause incorrect vtables to be generated." % ( + name, self.class_name), 2) warning(entry.pos, "Previous declaration is here", 2) entry = self.add_cfunction(name, type, pos, cname, visibility='ignore', modifiers=modifiers) else: diff --git a/tests/run/pure_py.py b/tests/run/pure_py.py index c66d0bba7..b60f483c2 100644 --- a/tests/run/pure_py.py +++ b/tests/run/pure_py.py @@ -20,7 +20,8 @@ def test_sizeof(): """ x = cython.declare(cython.bint) print(cython.sizeof(x) == cython.sizeof(cython.bint)) - print(cython.sizeof(cython.char) <= cython.sizeof(cython.short) <= cython.sizeof(cython.int) <= cython.sizeof(cython.long) <= cython.sizeof(cython.longlong)) + sizeof = cython.sizeof + print(sizeof(cython.char) <= sizeof(cython.short) <= sizeof(cython.int) <= sizeof(cython.long) <= sizeof(cython.longlong)) print(cython.sizeof(cython.uint) == cython.sizeof(cython.int)) print(cython.sizeof(cython.p_int) == cython.sizeof(cython.p_double)) if cython.compiled: diff --git a/tox.ini b/tox.ini index f7a96a320..ec32cdb05 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,6 @@ commands = [pycodestyle] ignore = W, E -select = E711, E714 -max-line-length = 300 +select = E711, E714, E501 +max-line-length = 150 format = pylint -- 2.30.9