Skip to main content

lint

Run targeted linting, formatting, and code quality checks on modified files. Use this to validate code style, type safety, security, and other quality metrics before committing. Supports running all checks or targeting specific checks on specific files for efficient validation.

来源信息

仓库
DataDog/dd-trace-py
最近来源活动
2026年10月27日 18:48
检测到的 SKILL.md 语言
英语
星标
654
Forks
579

安装方式

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

检查来源文件

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

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
lint
description
Run targeted linting, formatting, and code quality checks on modified files. Use this to validate code style, type safety, security, and other quality metrics before committing. Supports running all checks or targeting specific checks on specific files for efficient validation.
allowed-tools
["Bash","Read","Grep","Glob","TodoWrite"]
# Formatting and checks Run `scripts/lint` from the repository root. It provisions the versions in `pyproject.toml`'s lint dependency group. Do not invoke the underlying tools directly. ```bash scripts/lint fmt -- <edited-python-file> scripts/lint typing -- <edited-python-file> scripts/lint spelling -- <edited-document> scripts/lint checks ``` Format edited code, use focused checks during iteration, and run `checks` before committing. Do not pass Markdown to the Python formatter. Native formatters invoked by `fmt`/`style` have their own selection logic; inspect the diff afterward rather than assuming every check is file-scoped. ## Discover specialized checks `scripts/lint --help` is the current command inventory. Useful task-specific checks include: | Change | Subcommand | |--------|------------| | Updated trace snapshots | `fmt-snapshots` | | Python handling user input, credentials, or sensitive operations | `security` | | New test files / suitespec | `suitespec-check`, `suitespec-duplicates` | | Microbenchmark scenarios or thresholds | `slo-ownership` | | Profiling native coverage | `profiling-native-check` | | Environment-variable registry | `supported-config-check` | | Log messages | `error-log-check` | | Type annotations | `typing`, `type-comments-check` | | ast-grep rules | `sg`, `sg-test` | | Git hooks | `hook-tests` | After changing annotations, run `typing` and check for new PEP 484 type comments. Use inline annotations for new types; existing type comments may stay, and `# type: ignore` is allowed. See `scripts/check_type_comments.py` for the exact diff-based policy and exceptions. ```bash scripts/lint type-comments-check --base-ref origin/main scripts/lint fmt-snapshots <edited-snapshot-file-or-directory> scripts/lint security -r <affected-python-directory> ``` Use the PR's actual base ref for the type-comment check; this check is not currently part of `scripts/lint checks`. Snapshot formatting rewrites the selected files; add `--check` for validation only. The full `checks` command already includes the security scan. Arguments are passed to each underlying command; consult its interface rather than assuming all subcommands accept paths. `checks` stops at the first failure. Report that failure and any checks not reached; do not describe a partial run as passing. Avoid unrelated cleanup.
在 GitHub 查看