Flake8包装器,使其美观且可配置
flakehell的Python项目详细描述
它是一个Flake8包装器,可以让它变酷。
- 可共享和远程配置。
- 传统友好型:只报告新错误的能力。
- 只使用指定的插件,而不是所有已安装的插件。
- 管理每个插件的代码。
- 通过通配符启用和禁用插件和代码。
- 使输出美观。
- pyproject.toml支持。
- 显示已安装插件的代码。
- 显示插件的所有消息和代码。
- 检查是否安装了所有必需的插件。
- 在消息和代码段中突出显示语法。
- PyLint集成。
安装
python3 -m pip install --user flakehell
用法
首先,让我们创建pyproject.tomlconfig:
[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了解更多信息。