<< All versions
Skill v1.0.0
currentTrusted Publisher100/100microsoft/onnxruntime/ort-lint
──Details
PublishedSeptember 29, 2026 at 05:07 PM
Content Hashsha256:c8764d3dd0a91602...
Git SHA
──Files
Files (1 file, 1.5 KB)
SKILL.md1.5 KBactive
SKILL.md · 45 lines · 1.5 KB
version: "1.0.0" 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 for both C++ (clang-format) and Python (ruff).
Setup (one-time)
bash
pip install -r requirements-lintrunner.txtlintrunner init
Commands
bash
lintrunner -a # auto-fix changed fileslintrunner -a --all-files # auto-fix all fileslintrunner -a path/to/file.py path/to/other_file.cc # auto-fix specific fileslintrunner f --all-files # format Python files onlylintrunner # check without fixing (dry run)
Style rules
C++
- Google C++ Style with modifications (see
docs/Coding_Conventions_and_Standards.mdfor full details) - Max line length: 120 characters, but aim for 80 when possible
- Configured in
.clang-formatand.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).
- Prefer
lintrunner -a(changed files only) over--all-filesunless the user asks for a full sweep.