First time here? Check out the FAQ!

pep8 reformatter configuration?

I seem to recall that Wing delegates reformatting to an outside executable (pep8, black, yapf, etc) , and that there's a configuration panel for the reformatters, but I can't find it. Can anyone point me in the right direction?


TL;DR - can we change the autopep8formatter to respect the new binary operator + line break recommendations:

Long Version:

My organization requires code to pass a pycodestyle check before being accepted. But Wing sometimes seems to be reformatting some bits of code like:

    if (
        val is None
        or not val.isdigit()
        or int(val) <= 0


    if (
        val is None or
        not val.isdigit() or
        int(val) <= 0

And then pycodestyle complains about

./src/dashboard/ W504 line break after binary operator

The "sometimes" part is interesting. After the reformatting, pycodestyle complains about two blocks of code. If I fix the first block, save, and check, the first block is not reformatted, and then pycodestyle only complains about the second block. But when I fix the second block, the first block is reformatted, and pycodestyle complains again. If I edit BOTH blocks of code and then hit save, neither one is reformatted

Now that I look into it, the docs say that

Wing uses its own copy of autopep8 for PEP 8 style formatting

And if I dig into the docs for autopep8, it apparently depends on pycodestyle itself!

Chris Curvey's avatar
Chris Curvey
asked 2022-01-07 06:51:32 -0500, updated 2022-01-12 09:40:38 -0500
edit flag offensive 0 remove flag close merge delete


This may be due to a version mismatch between the pycodestyle you have and the one that ships with Wing (2.5.0). Or just a bug in that or the autopep8 that we include (1.5.2). I'm going to upgrade both the copies of autopep8 and pycodestyle that Wing ships with, from version 1.5.2 to 1.6.0 for autopep8 and version 2.5.0 to 2.8.0 for pycodestyle (both the latest).

Longer term, we may want to add a way to get Wing to use your installed autopep8, as a way to avoid problems like this. Of course the installed autopep8 in your Python may also not match the version being used in precommit hooks.

I should note that I tried both with the above versions and got the same result in both cases it's but different than what you seemed ... (more)

Wingware Support's avatar Wingware Support (2022-01-12 14:21:54 -0500) edit
add a comment see more comments

1 Answer


This is controlled from the Options tab in Project Properties or the Editor > Auto-Reformatting preferences page. The docs are at

Wingware Support's avatar
Wingware Support
answered 2022-01-07 07:58:15 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer