Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
285 views
in Technique[技术] by (71.8m points)

python - How to integrate pep8.py in Eclipse?

A little background:

  • PEP 8 is the Style Guide for Python Code. It contains the conventions all python programmers should follow.
  • pep8.py is a (very useful) script that checks the code formating of a given python script, according to PEP 8.
  • Eclipse is a great IDE. With the Pydev extension, it that can be used to develop Python

I run pep8.py manually when I'm scripting, but with bigger projects I prefer to use Eclipse. It would be really useful to integrate pep8.py in Eclipse/Pydev, so it can be run automatically in all the files in the project, and point to the lines containing the warnings. Maybe there is an obvious way to do it, but I haven't found it yet.

Question is: How to integrate pep8.py in Eclipse?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As of PyDev 2.3.0, pep8 is integrated in PyDev by default, even shipping with a default version of it.

Open Window > Preferences

It must be enabled in PyDev > Editor > Code Analysis > pep8.py

Errors/Warnings should be shown as markers (as other things in the regular code analysis).

In the event a file is not analyzed, see https://stackoverflow.com/a/31001619/832230.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...