Enable pep8 in Eclipse

2019-01-20 11:43发布

问题:

I enabled PEP8 in my Eclipse Luna for a pydev project and it works if I create a new file but it doesn't work for an existing project/file.

I enabled PEP8 in window> preferences > pydev > editor > codeAnalysis > pep8.py > warning and I tried to click right onto my project folder > pydev > code analysis But unfortunately it doesn't work.

回答1:

PyDev will only analyze valid packages in the PYTHONPATH (i.e.: under a source folder).

So, Are your sources in the existing project under a source folder and are folders actually packages (i.e.: do they have __init__.py files?)

See: http://pydev.org/manual_101_project_conf2.html for details on configuring your source folders.