[d-feet/enable-gitlab-ci: 1/4] Ignore W504 line break after binary operator



commit 7fa36c53e1b3f59d5b8072faa6da633acbed9d44
Author: Will Thompson <will willthompson co uk>
Date:   Wed Sep 19 11:14:17 2018 +0100

    Ignore W504 line break after binary operator
    
    The following code:
    
        self.connection = Gio.DBusConnection.new_for_address_sync(
            self.__bus_address,
            Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT |
            Gio.DBusConnectionFlags.MESSAGE_BUS_CONNECTION,
            None, None)
    
    causes newer versions of pycodestyle to complain:
    
    ../../src/dfeet/bus_watch.py:139:17: W504 line break after binary operator
    
    However, if I move the the line break to be before the binary operator:
    
        self.connection = Gio.DBusConnection.new_for_address_sync(
            self.__bus_address,
            Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT
            | Gio.DBusConnectionFlags.MESSAGE_BUS_CONNECTION,
            None, None)
    
    Older versions complain in the opposite way:
    
    ../../src/dfeet/bus_watch.py:140:17: W503 line break before binary operator
    
    The thread around
    https://mail.python.org/pipermail/python-ideas/2016-April/039774.html
    explains why the tool has changed its mind.
    
    I prefer the old style, so let's just ignore the new warning.

 src/tests/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 4e80a55..d641dc7 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -13,5 +13,5 @@ tests.py: tests.py.in
 PYCODESTYLE_EXCLUDES=--exclude='.svn,CVS,.bzr,.hg,.git,__pycache__,.\#*'
 
 check-local:
-       $(PYCODESTYLE) --max-line-length=99 --ignore=E123,E402 \
+       $(PYCODESTYLE) --max-line-length=99 --ignore=E123,E402,W504 \
                $(PYCODESTYLE_EXCLUDES) $(top_srcdir)/src/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]