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-07-13
- Stars
- ★ 1
- 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
zustand-store-creator
Create zustand store creator operations. Auto-activating skill for Frontend Development. Triggers on: zustand store creator, zustand store creator Part of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like "zustand store creator", "zustand creator", "zustand".
zero-trust-config-helper
Configure with zero trust config helper operations. Auto-activating skill for Security Advanced. Triggers on: zero trust config helper, zero trust config helper Part of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like "zero trust config helper", "zero helper", "zero".
zapier-integration-helper
Assist with zapier integration helper operations. Auto-activating skill for Business Automation. Triggers on: zapier integration helper, zapier integration helper Part of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like "zapier integration helper", "zapier helper", "zapier".
yaml-config-validator
Validate yaml config validator operations. Auto-activating skill for DevOps Basics. Triggers on: yaml config validator, yaml config validator Part of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like "yaml config validator", "yaml validator", "yaml".
xvary-stock-research
Thesis-driven equity analysis from public SEC EDGAR and market data; /analyze, /score, /compare workflows with bundled Python tools (Claude Code, Cursor, Codex).
xss-vulnerability-scanner
Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals. Triggers on: xss vulnerability scanner, xss vulnerability scanner Part of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like "xss vulnerability scanner", "xss scanner", "xss".