Pyflakes builder should check example code

Bug #1152533 reported by Richard Wall on 2013-03-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Twisted Buildbot Configuration

Bug Description

This is part of the Twisted Better Examples plan:

In the comments for, jml and spiv have both suggested that we
should run a linter on the examples.

[ The writing standard]
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.

 * pyflakes twisted

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 files.


[richard@zorin testable-examples-84]$ pyflakes doc setup* | wc -l

doc/historic/2003/pycon/deferex/ invalid
syntax ... ^ doc/historic/2003/pycon/deferex/
invalid syntax ... ^
doc/historic/2003/pycon/deferex/ 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

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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers