跳转到主要内容

Flake8包装器,使其易于使用和配置

项目描述

FlakeHell

PyPI version Build Status License: MIT Documentation

这是一个Flake8包装器,使其变得酷。

output example

兼容性

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

plugins command output

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

flakehell codes pyflakes

codes command output

对代码运行flake8

flakehell lint

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

阅读flakehell.readthedocs.io获取更多信息。

贡献

欢迎贡献!以下是一些您可以贡献的想法:

  • 改进文档。
  • 添加更多测试。
  • 提高性能。
  • 发现了一个bug?修复它!
  • 写了一篇关于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

出于设计考虑,已禁用bug-tracker,以将贡献从言语转移到行动。请帮助我们使项目变得更好,不要在社交网络和街道上骚扰维护者。

谢谢 :heart

FlakeHell吉祥物(Flaky)由@illustrator.way创作,并受CC BY-SA 4.0许可。

项目详情


下载文件

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

源代码发行版

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

上传时间 源代码

构建发行版

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

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面