Questions tagged [pyflakes]

Pyflakes analyzes Python source code non-intrusively to check for errors.

Pyflakes analyzes Python source code non-intrusively to check for errors.

Similar to the C language source code analyzer lint, Pyflakes performs similar function on Python source code. It can be used to check for simple errors like misplaced quotes, code indentation inconsistencies, syntax errors, referenced but undeclared variables, unused imported modules, etc. A very useful tool for any Python developer's toolkit!

See also:

83 questions
1
vote
1 answer

Jedi/rope/emacs configuration for python development

I think I'm having the same problem as this user in getting Jedi.el to work, but more trouble with the solution. I've installed EPC Rope ropemacs pymacs python-mode.el-6.1.3 pylint pyflakes I installed these things in a pretty vanilla way, using…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
1
vote
0 answers

Netbeans 7.4 with pyflakes

I installed a plugin for NetBeans 7.4 to make Python work, and it does. But now I am racking my brains to manage another plugin for same IDE which includes pyflakes (PEP 8 and flake8). I am starting to think that for the moment it just does not…
forvas
  • 9,801
  • 7
  • 62
  • 158
1
vote
0 answers

Sublime Text Flake8 lint error on Mechanize which does not appear when running flake8 by hand

I use mechanize library for a small python project. Why does Sublime Text 2 (with Flake8Lint) shows me that there is no such member select_form() in browser. I have checked _mechanize.py and there it is. Also why it can find open() member? I import…
Vladimir Nani
  • 2,774
  • 6
  • 31
  • 52
1
vote
1 answer

Pyflakes with Emacs

I'm trying to install pyflakes with emacs. So far, i've got the flymake.el file from here. I put it inside my .emacs.d folder. Inside my .emacs file, I have this: (when (load "flymake" t) (defun flymake-pyflakes-init () (let* ((temp-file…
1
vote
1 answer

import error cant find module ast when i start VIM editor wit pyflakes

On my Macbook (OSX Lion) I'm running python 2.7 with Vim 7.3 and installed pyflakes. I followed the steps described here, but installed pyflakes, pylint and pep8 with macports. After running Bundleinstall and starting new Vim I got the following…
0
votes
3 answers

How do I disable pyflakes-vim for a particular file?

I have some autogenerated python files that are extremely large (long mathematical equations). Vim slows to a crawl when I open them for editing because I have pyflakes-vim installed. I'd like to be able to disable pyflakes-vim only when I open…
moorepants
  • 1,813
  • 2
  • 22
  • 23
0
votes
1 answer

Why do I get this syntax error (false syntax error pyflakes)

I try to follow a tutorial on how to host a discord bot with discord.py. I did everything correctly but pyflakes shows a syntax error. Do You know why? I've got two files: main.py and keep_alive.py. This is main.py: import os import discord from…
Sneezy_HD
  • 55
  • 6
0
votes
1 answer

How to set flake8 to catch a not-callable?

On this test program: def func(): foo = ( (1, 2) (3, 4) ) Command python -m py_compile my_script.py warns "SyntaxWarning: 'tuple' object is not callable; perhaps you missed a comma?" and pylint --disable=all --enable=E1102…
Kfcaio
  • 442
  • 1
  • 8
  • 20
0
votes
1 answer

Can't jump to line in pyflakes quickfix window

I recently installed the vim extension python-mode, which includes pyflakes. When I save a python file to disk, pyflakes automatically detects errors and style violations and displays them in a quickfix window. This screencast shows that hitting…
ludog
  • 74
  • 1
  • 8
0
votes
1 answer

How to customize vim-syntastic?

I've written a python script. My vimrc contains: Plug 'vim-syntastic/syntastic' let g:syntastic_python_checkers=['pyflakes'] and I'd like to turn this kind of error into warning: File.py|214 error| local variable 'rank_last_c' is assigned to but…
vize_xpft
  • 67
  • 5
0
votes
2 answers

How to statically determine whether a source file supports python 3, for flake8?

How can I statically determine whether a Python source file supports Python 3? The question may be impossible to answer as stated there, so I'll be more specific: My application for this is to pick a version of flake8 to run that won't give spurious…
Croad Langshan
  • 2,646
  • 3
  • 24
  • 37
0
votes
1 answer

Publish pyflakes and sloccount Jenkinsfile

Is it possible to publish pyflakes stats and slocount using Jenkinsfile. I suceeded publishing a junit file but do not know how two proceed wuth this two technos above I used step([$class: 'JUnitResultArchiver', testResults: 'xunit.xml']) Do…
0
votes
1 answer

Using PyFlakes and the del operator

When making use of del in a Python function, I'm getting false positives from PyFlakes telling me that the variable is undefined. def foo(bar): # what if it's ham? eww if bar == 'ham': del bar return # otherwise yummy! …
aodj
  • 2,163
  • 1
  • 12
  • 13
0
votes
1 answer

Python syntax errors: pyflakes detects only the first error of many

Let's say I have the following code: def incr(d, a) r = {} for key, value in d.items(): if key != a: value += 1 r[key] = value return r def decr(d, a) r = {} for key, value in d.items(): if key…
A S
  • 1,195
  • 2
  • 12
  • 26
0
votes
1 answer

vim-flake8 started showing D and H errors

I have a problem with pyflake8 in vim, he started displaying some errors that he didn't show at all, like this: models.py|1 col 1| D100 Missing docstring in public module models.py|2 col 1| H306 imports not in alphabetical order (django.db.models,…
copser
  • 2,523
  • 5
  • 38
  • 73