Warning: all plugin authors should check their plugins. Recent revs have changed many (most) plugins. I have been as careful as I can, but there are no guarantees.
Recent revs have fixed the following:
1. all pylint, pyflakes and flake8 complaints in Leo's core,
2. all pylint and pyflakes complaints in Leo's plugins.
Still to do: fix flake8 complaints in plugins.
Yes, innocent-looking changes can create problems. I have been running
all tests before upping the code. Such mucking about should be done early in the release cycle.
Still, the recent changes have been worthwhile. A number of buglets have been revealed and fixed. Even the cosmetic changes are reasonable. I have disabled all the
flake8 checks that seem overly picky, and that includes almost all checks for whitespace around operators and whitespace in continued lines.
It's funny, really. Pep 8 (and many people) seem to be obsessed with whitespace in continued lines, the very places where indentation makes
absolutely no difference to the python parser!
My attitude is this: if you want to improve whitespace, use Leo's beautification commands.
In fact, there were only a few
kinds of fixes required:
E101: indentation contains mixed spaces and tabs
E111: indentation is not a multiple of four
E129: visually indented line with same indent as next logical line
W293: blank line contains whitespace
E501: line too long (over 120 characters)
E711: comparison to None should be ‘if cond is None:’
E712: comparison to True should be ‘if cond is True:’ or ‘if cond:’
E713: test for membership should be ‘not in’
E714: test for object identity should be ‘is not’
Important: E711 can be serious. Comparing positions to None is
always a bug, except for low-level code. The proper tests are "if p:" or "if not p".
An example of E129:
if (a long test
continued on the next line):
first line of block
should be:
if (a long test
continued on the next line
):
first line of block
Similarly:
def foo (lots of args,
continued on next line):
first line of block
should be:
def foo (lots of args,
continued on next line
):
first line of block
To summarize: the recent changes aren't much about whitespace and indentation. The few stylistic changes that have been made seem worth the risk of making them.
We won't debate style issues here: you can always change your flake8 config file.
All comments welcome.
Edward