百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pycodestyle

> 开发工具
开源

单文件简易 Python 风格检查器

5.2K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

单文件简易 Python 风格检查器

pycodestyle(原名 pep8)- 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· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonflake8-pluginlinter-flake8linter-pluginpep8

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具