pyflakes best practices?

R

Roy Smith

We've recently started using pyflakes. The results seem to be similar
to most tools of this genre. It found a few real problems. It
generated a lot of noise about things which weren't really wrong, but
were easy to fix (mostly, unused imports), and a few plain old false
positives which have no easy "fix" (in the sense of, things I can change
which will make pyflakes STFU).

So, what's the best practice here? How do people deal with the false
positives? Is there some way to annotate the source code to tell
pyflakes to ignore something?
 
M

Mark Lawrence

We've recently started using pyflakes. The results seem to be similar
to most tools of this genre. It found a few real problems. It
generated a lot of noise about things which weren't really wrong, but
were easy to fix (mostly, unused imports), and a few plain old false
positives which have no easy "fix" (in the sense of, things I can change
which will make pyflakes STFU).

So, what's the best practice here? How do people deal with the false
positives? Is there some way to annotate the source code to tell
pyflakes to ignore something?

I was under the impression that pyflakes was configurable. It it isn't
I'd simply find another tool. Having said that if you don't get better
answers here try gmane.comp.python.code-quality.
 
R

Roy Smith

Mark Lawrence said:
I was under the impression that pyflakes was configurable. It it isn't
I'd simply find another tool. Having said that if you don't get better
answers here try gmane.comp.python.code-quality.

I didn't know that list existed, it looks very interesting. Thanks for
the pointer!
 
M

Miki Tebeka

Greetings,
So, what's the best practice here? How do people deal with the false
positives? Is there some way to annotate the source code to tell
pyflakes to ignore something?
We use flake8 (pyflakes + pep8) as pre step for the tests. We fail the tests on any output from flake8.

flake8 supports ignoring certain lines by appending a comment starting with # NOQA

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top