Skip to main content

Flake8 包装器使其美观且可配置

项目描述

片状地狱

PyPI 版本 构建状态 执照:麻省理工学院 文档

这是一个Flake8包装器,让它变得很酷。

输出示例

兼容性

FlakeHell 支持所有 flake8 插件、格式化程序和配置。然而,FlakeHell 有它自己的漂亮方式来配置启用的插件和代码。因此,喜欢--ignore--select不受支持的选项。如果需要,您可以在一个项目中拥有 flake8 和 FlakeHell,但应明确指定启用的插件。

安装

python3 -m pip install --user flakehell

用法

首先,让我们创建pyproject.toml配置:

[tool.flakehell]
# optionally inherit from remote config (or local if you want)
base = "https://raw.githubusercontent.com/life4/flakehell/master/pyproject.toml"
# specify any flake8 options. For example, exclude "example.py":
exclude = ["example.py"]
# make output nice
format = "grouped"
# 80 chars aren't enough in 21 century
max_line_length = 90
# show line of source code in output
show_source = true

# list of plugins and rules for them
[tool.flakehell.plugins]
# include everything in pyflakes except F401
pyflakes = ["+*", "-F401"]
# enable only codes from S100 to S199
flake8-bandit = ["-*", "+S1??"]
# enable everything that starts from `flake8-`
"flake8-*" = ["+*"]
# explicitly disable plugin
flake8-docstrings = ["-*"]

显示尚未安装的插件:

flakehell missed

显示已安装的插件、使用的插件、指定的规则、代码前缀:

flakehell plugins

插件命令输出

显示特定插件的代码和消息:

flakehell codes pyflakes

代码命令输出

对代码运行 flake8:

flakehell lint

该命令接受与 Flake8 相同的所有参数。

阅读flakehell.readthedocs.io了解更多信息。

贡献

欢迎投稿!您可以贡献的一些想法:

  • 改进文档。
  • 添加更多测试。
  • 提高性能。
  • 发现错误?修理它!
  • 写了一篇关于 FlakeHell 的文章?伟大的!让我们将它添加到README.md.
  • 没时间写代码?不用担心!只需告诉您的朋友和订阅者该项目。更多用户 -> 更多贡献者 -> 更多酷功能。

运行测试的一种便捷方法是使用DepHell

curl -L dephell.org/install | python3
dephell venv create --env=pytest
dephell deps install --env=pytest
dephell venv run --env=pytest

错误跟踪器被设计为禁用,以将贡献从文字转移到行动。请帮助我们使项目变得更好,不要在社交网络和大街上跟踪维护者。

谢谢你:心:

FlakeHell 吉祥物 (Flaky) 由@illustrator.way创建并在CC BY-SA 4.0许可下获得许可。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

flakehell-0.9.0.tar.gz (36.6 kB 查看哈希)

已上传 source

内置分布

flakehell-0.9.0-py3-none-any.whl (43.0 kB 查看哈希

已上传 py3