ort-lint

bởi microsoft

Lint và định dạng mã nguồn ONNX Runtime. Sử dụng kỹ năng này khi được yêu cầu lint, định dạng hoặc kiểm tra kiểu mã cho các tệp C++ hoặc Python trong ONNX Runtime.

npx skills add https://github.com/microsoft/onnxruntime --skill ort-lint

Linting and Formatting ONNX Runtime Code

ONNX Runtime uses lintrunner for both C++ (clang-format) and Python (ruff).

Setup (one-time)

pip install -r requirements-lintrunner.txt
lintrunner init

Commands

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).
  • Prefer lintrunner -a (changed files only) over --all-files unless the user asks for a full sweep.

Thêm skills từ microsoft

oss-growth
microsoft
Cá tính tăng trưởng OSS
official
accessibility-aria-expert
microsoft
Phát hiện và sửa các vấn đề về khả năng tiếp cận trong giao diện web React/Fluent UI. Sử dụng khi xem xét mã để đảm bảo tương thích với trình đọc màn hình, sửa nhãn ARIA, đảm bảo…
official
generate-canvas-app
microsoft
[DEPRECATED — sử dụng canvas-app thay thế] Tạo một ứng dụng canvas Power Apps hoàn chỉnh.
official
django
microsoft
Các phương pháp tốt nhất cho phát triển web Django bao gồm models, views, templates và testing.
official
github-issue-creator
microsoft
Chuyển đổi ghi chú thô, nhật ký lỗi, ghi âm giọng nói hoặc ảnh chụp màn hình thành báo cáo vấn đề markdown sắc nét theo phong cách GitHub. Sử dụng khi người dùng dán thông tin lỗi, lỗi…
official
python-package-management
microsoft
Sử dụng uv để quản lý phụ thuộc và poethepoet để tự động hóa tác vụ.
official
runtime-validation
microsoft
Xác thực thời gian chạy cho các ứng dụng đã di chuyển — bao gồm chiến lược kiểm thử (giai đoạn lập kế hoạch) và thực thi kiểm thử (giai đoạn xác thực): xác minh khởi động,…
official
azure-postgres-ts
microsoft
Kết nối đến Azure Database for PostgreSQL Flexible Server bằng gói pg (node-postgres) với hỗ trợ xác thực mật khẩu và Microsoft Entra ID (không mật khẩu).
official