Pyflakes builder should check example code
|||Twisted Buildbot Configuration||
This is part of the Twisted Better Examples plan:
In the comments for http://
should run a linter on the examples.
suggests that "example code should conform to
the coding standard" which implies that examples should be tested in
the same way as the main twisted code. That includes pyflakes.
The pyflakes builder does not currently scan the doc folder and the
Python files within.
So we should alter the current pyflakes builder to scan everything.
This would also catch problems with the setuptools files.
There are 116 pyflakes errors in the existing documentation examples
and in the setup.py files.
syntax ... ^ doc/historic/
invalid syntax ... ^
But the pyflakes builder is a "ratchet" test, so these errors will
only show up as "new errors" in initial builds, after which, the
errors can be fixed incrementally in future tickets.
When this task is done, we will raise tickets for fixing the pyflakes
errors in each example.
Some further notes based on comments in http://
There are some example python files which contain only partial
code. This is done in some howtos which only want to highlight the
changes to an example, inbetween narrative paragraphs. There are only
a few of these and in time these will be updated to use sphinx or
lore's ability to include parts of an example file. Ultimately all
example python files will be complete runnable examples.
The "historic" examples can not be updated and therefore should not
not be scanned by pyflakes.