mcore-linting-and-formatting
Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-08
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- mcore-linting-and-formatting
- license
- Apache-2.0
- metadata
- { "author": "Philip Petrakian <ppetrakian@nvidia.com>" }
- description
- Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.
- when_to_use
- Running linting or autoformat; fixing style violations before a PR; 'pre-commit fails', 'ruff error', 'isort', 'mypy', 'style violation', 'how do I format', 'autoformat.sh'.
02 资源文件 4
- 参考文档BENCHMARK.md2.8 KB
- 参考文档evals/evals.json3 B
- 参考文档skill-card.md2.5 KB
- 其他skill.oms.sig4.5 KB
03 SKILL.md 正文
Linting and Formatting
Running the Formatter
Run before opening a PR:
# Check mode (no changes applied)
BASE_REF=main CHECK_ONLY=true SKIP_DOCS=false bash tools/autoformat.sh
# Fix mode
BASE_REF=main CHECK_ONLY=false bash tools/autoformat.sh
Tools invoked: black, isort, pylint, ruff, mypy.
Import Ordering
After editing imports in any Python files, always run uv run isort on those
files before committing:
uv run isort <file1>.py <file2>.py
Setting Up the Linting Group
Inside the container:
uv sync --locked --only-group linting
This installs ruff, black, isort, pylint — the same tools used by
tools/autoformat.sh and CI's linting job.
Code Style Rules
- Type hints: required on all public API functions. Use
X | None, notOptional[X]. - Docstrings: Google-style on all public classes and functions.
- Naming: follow Python conventions —
snake_casefor functions and variables,PascalCasefor classes. - Line length: 119 characters (configured in
pyproject.toml). - No bare
except: always catch specific exception types.
04 同仓库更多 Skills
vss-summarize-video
Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.
vss-setup-video-analytics-api
Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.
vss-setup-behavior-analytics
Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.
vss-search-archive
Use this skill to run top-level VSS fusion search on archived video, or to ingest video files / RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).
vss-query-analytics
Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.
vss-manage-video-io-storage
Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add/delete sensors and streams). Not for VLM inference or search.