单文件简易 Python 风格检查器
.. image:: https://github.com/PyCQA/pycodestyle/actions/workflows/main.yml/badge.svg :target: https://github.com/PyCQA/pycodestyle/actions/workflows/main.yml :alt: 构建状态
.. image:: https://readthedocs.org/projects/pycodestyle/badge/?version=latest :target: https://pycodestyle.pycqa.org :alt: 文档状态
.. image:: https://img.shields.io/pypi/wheel/pycodestyle.svg :target: https://pypi.org/project/pycodestyle/ :alt: Wheel 状态
.. image:: https://badges.gitter.im/PyCQA/pycodestyle.svg :alt: 加入聊天室 https://gitter.im/PyCQA/pycodestyle :target: https://gitter.im/PyCQA/pycodestyle?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
pycodestyle 是一个工具,用于根据 PEP 8_ 中的部分风格约定检查你的 Python 代码。
.. _PEP 8: http://www.python.org/dev/peps/pep-0008/
.. note::
这个包以前叫 pep8,后来改名为 pycodestyle,以减少混淆。更多讨论可以在 Guido 提出这一更改请求的 issue <https://github.com/PyCQA/pycodestyle/issues/466>, 或在 @IanLee1521 于 PyCon 2016 的 lightning talk 中找到:
幻灯片 <https://speakerdeck.com/ianlee1521/pep8-vs-pep-8>
视频 <https://youtu.be/PulzIT8KYLk?t=36m>_.
插件架构:添加新的检查很容易。
可解析的输出:在编辑器中直接跳转到错误位置。
轻量:只有一个 Python 文件,仅依赖标准库。为此目的你可以只使用 pycodestyle.py 文件。
附带全面的测试套件。
你可以使用以下命令安装、升级和卸载 pycodestyle.py::
$ pip install pycodestyle $ pip install --upgrade pycodestyle $ pip uninstall pycodestyle
Debian/Ubuntu 也有相应的软件包,但不一定是最新版本。
::
$ pycodestyle --first optparse.py optparse.py:69:11: E401 multiple imports on one line optparse.py:77:1: E302 expected 2 blank line
暂无开放 Issues,或尚未同步最近议题。