跳转到主要内容

lintrunner的适配器和工具

项目描述

lintrunner-adapters

CI PyPI version

lintrunner提供适配器和工具。

lintrunner-adapters目前支持流行的Python / Rust / C++代码检查器和格式化工具,如flake8pylintmypyblackruff(带有自动修复支持)、rustfmtclippyclang-format等,列表还在不断增长。欢迎贡献力量!

要查看支持的代码检查器和格式化工具列表,请运行lintrunner_adapters run

安装

pip install lintrunner-adapters

用法

Usage: python -m lintrunner_adapters [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  run       Run an adapter.
  to-sarif  Convert the output of lintrunner json (INPUT) to SARIF (OUTPUT).

使用lintrunner_adapters run查看可用的适配器列表。

GitHub动作

https://github.com/justinchuby/lintrunner-action

如何

在您的项目中使用lintrunner_adapterslintrunner

参考此仓库中的.lintrunner.toml配置文件以及每个适配器下的示例配置文件,位于examples/adapters

.lintrunner.toml中编写代码检查配置

https://docs.rs/lintrunner/latest/lintrunner/lint_config/struct.LintConfig.html

创建一个新的适配器

lintrunner_adapters/adapters/pylint_linter.py为例。

在CI中运行lintrunner并在PR中获取GitHub代码扫描消息

选项1

使用GitHub Action:lintrunner-action

选项2

直接在工作流程中运行。请参阅.github/workflows/ci.yml

项目详情


下载文件

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

源代码分布

lintrunner_adapters-0.12.4.tar.gz (29.1 kB 查看哈希值)

上传时间 源代码

构建分布

lintrunner_adapters-0.12.4-py3-none-any.whl (62.4 kB 查看哈希值)

上传时间 Python 3

支持者