Skip to main content

ort-lint

Lint and format ONNX Runtime code. Use this skill when asked to lint, format, or check code style for C++ or Python files in ONNX Runtime.

来源信息

仓库
microsoft/onnxruntime
最近来源活动
2026年8月21日 01:04
检测到的 SKILL.md 语言
英语
星标
22,088
分支
4,318

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
ort-lint
description
Lint and format ONNX Runtime code. Use this skill when asked to lint, format, or check code style for C++ or Python files in ONNX Runtime.
# Linting and Formatting ONNX Runtime Code ONNX Runtime uses [lintrunner](https://github.com/suo/lintrunner) for both C++ (clang-format) and Python (ruff). ## Setup (one-time) ```bash pip install -r requirements-lintrunner.txt lintrunner init ``` ## Commands ```bash lintrunner -a # auto-fix changed files lintrunner -a --all-files # auto-fix all files lintrunner -a path/to/file.py path/to/other_file.cc # auto-fix specific files lintrunner f --all-files # format Python files only lintrunner # check without fixing (dry run) ``` ## Style rules ### C++ - Google C++ Style with modifications (see `docs/Coding_Conventions_and_Standards.md` for full details) - Max line length: 120 characters, but **aim for 80** when possible - Configured in `.clang-format` and `.clang-tidy` ### Python - Google Python Style Guide (extension of PEP 8) - Max line length: 120 characters - Configured in `pyproject.toml` ## Agent tips - **Activate a Python virtual environment** before installing dependencies. See "Python > Virtual environment" in `AGENTS.md`. - If lintrunner is not yet set up, install and initialize first (see [Setup](#setup-one-time)). - Prefer `lintrunner -a` (changed files only) over `--all-files` unless the user asks for a full sweep.
在 GitHub 查看