user220201
user220201

Reputation: 4532

Recursive code checker for python

I used pyflakes and pylint to statically check for any errors in my code but they are not of much use since they don't go into the the files that the input file uses. For example, if I have a typo in a function I am using from another file and these programs blissfully report no errors. At that point they become useless to me. Are there better alternatives I can use? I guess if I use eclipse it could help me weed out these typos while I am writing code itself but I am using emacs to code. Are there options/tools I can use inside of emacs may be for this? I just found a typo reported after my code runs for a few minutes.

EDIT: To clarify here is the code directory structure -

src/
  driver.py
  DB/
    DBHelper.py
  Analyze/
    file1.py
    file2.py
  Helper/
    HelperClasses.py

driver.py is where the code runs from and it uses code from the other files listed.

For e.g. file1.py uses some functions from HelperClasses.py and I made a typo when using the name of the function. Running pyflakes on file1.py reports no errors because it does not see HelperClasses.py while analyzing file1.py

I am looking to find a tool that also looks into the other files it uses as needed.

Upvotes: 3

Views: 2728

Answers (1)

danielpopa
danielpopa

Reputation: 820

You could try flake8. I use it in Sublime as a plug-in. It also exists for Emacs.

To run flake8, just invoke it against any directory or Python module:

$ flake8 --max-complexity 12 coolproject

Upvotes: 4

Related Questions