All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Marc-André Lureau" <mlureau@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v7 12/21] qapi.py: fix line break before binary operator pep8
Date: Tue, 10 Jan 2017 17:04:04 +0100	[thread overview]
Message-ID: <87d1fuoqa3.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <724269411.621337.1484052915061.JavaMail.zimbra@redhat.com> (=?utf-8?Q?=22Marc-Andr=C3=A9?= Lureau"'s message of "Tue, 10 Jan 2017 07:55:15 -0500 (EST)")

Marc-André Lureau <mlureau@redhat.com> writes:

> Hi
>
> ----- Original Message -----
>> Marc-André Lureau <marcandre.lureau@redhat.com> writes:
>> 
>> > Python code style accepts both form, but pep8 complains. Better to clean
>> > up the single warning for now, so new errors stand out more easily.
>> >
>> > Fix scripts/qapi.py:1539:21: W503 line break before binary operator
>> 
>> PEP 8 permits both, but prefers line break before binary operator.
>> Thus, this warning is clearly bogus.  What version of pep8 do you use?
>> Mine doesn't warn.
>
> I tried both 1.6.2 and 1.7.0

I tried again, and I can now see the warning.  No idea what I did wrong
the first time.

Turns out PEP8 used to demand line break after the operator, but no
more[1].  The pep8 program hasn't caught up, but it will[2]: its current
git HEAD already suppresses W503.  There's work in progress[3] on a new
W504 to warn on line break after binary operator.

We will have to live with a mix of old and new pep8 / pycodestyle
versions.  Changing code to make new versions instead of old versions
complain instead is not a good idea.  We should simply ignore the
obsolete warning from old versions.

pep8 lets you do that with --ignore=W503.  Sadly, --ignore overwrites
the default, so you have to --ignore=E121,E123,E126,E226,E24,E704,W503.
Or have a file tox.ini with

    [pep8]
    ignore=E121,E123,E126,E226,E24,E704,W503


[1] https://hg.python.org/peps/rev/3857909d7956
[2] https://github.com/PyCQA/pycodestyle/issues/498
[3] https://github.com/PyCQA/pycodestyle/pull/502

  reply	other threads:[~2017-01-10 16:04 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 14:34 [Qemu-devel] [PATCH v7 00/21] qapi doc generation (whole version, squashed) Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 01/21] qapi: replace 'o' for list items Marc-André Lureau
2017-01-10  8:49   ` Markus Armbruster
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 02/21] qapi: move QKeyCode doc body at the top Marc-André Lureau
2017-01-10  8:51   ` Markus Armbruster
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 03/21] qapi: make TODOs named-sections Marc-André Lureau
2017-01-10  9:11   ` Markus Armbruster
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 04/21] qapi: improve device_add schema Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 05/21] qapi: improve TransactionAction doc Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 06/21] qga/schema: improve guest-set-vcpus Returns: section Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 07/21] qapi: avoid interleaving sections and parameters Marc-André Lureau
2017-01-10 10:32   ` Markus Armbruster
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 08/21] qapi: move experimental note down Marc-André Lureau
2017-01-10 12:08   ` Markus Armbruster
2017-01-10 12:56     ` Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 09/21] qapi: add some sections in docs Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 10/21] docs: add master qapi texi files Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 11/21] qapi: rework qapi Exception Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 12/21] qapi.py: fix line break before binary operator pep8 Marc-André Lureau
2017-01-10 12:23   ` Markus Armbruster
2017-01-10 12:55     ` Marc-André Lureau
2017-01-10 16:04       ` Markus Armbruster [this message]
2017-01-10 16:25         ` Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 13/21] texi2pod: learn quotation, deftp and deftypefn Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 14/21] (SQUASHED) move doc to schema Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 15/21] qapi: add qapi2texi script Marc-André Lureau
2017-01-11 14:26   ` Markus Armbruster
2017-01-11 16:21     ` Marc-André Lureau
2017-01-12 13:17       ` Markus Armbruster
2017-01-12 17:36         ` Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 16/21] docs: add qemu logo to pdf Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 17/21] build-sys: use --no-split for info Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 18/21] build-sys: remove dvi doc generation Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 19/21] build-sys: use a generic TEXI2MAN rule Marc-André Lureau
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 20/21] build-sys: add txt documentation rules Marc-André Lureau
2017-01-12 10:09   ` Markus Armbruster
2017-01-09 14:34 ` [Qemu-devel] [PATCH v7 21/21] build-sys: add qapi doc generation targets Marc-André Lureau
2017-01-11 14:28   ` Markus Armbruster
2017-01-11 14:40 ` [Qemu-devel] [PATCH v7 00/21] qapi doc generation (whole version, squashed) Markus Armbruster
2017-01-11 14:43   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d1fuoqa3.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mlureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.