Loading...
Loading...
Compare original and translation side by side
hatch run lint:fmt -- <file>hatch run lint:checks-- <file>fmthatch run lint:typing -- <file>hatch run lint:fmt -- <file>hatch run lint:checks-- <file>fmthatch run lint:typing -- <file>hatch run lint:checkshatch run lint:fmt -- path/to/file.pyhatch run lint:typing -- path/to/file.pyhatch run lint:checkshatch run lint:fmt -- path/to/file.pyhatch run lint:typing -- path/to/file.pyfmtfmtundefinedundefined
**What it does:**
1. Runs the Ruff formatter
2. Runs Ruff with --fix to auto-fix issues
3. Re-validates with style checks
**When to use:** After making code changes to automatically format and fix style issues.
**功能说明:**
1. 运行Ruff格式化工具
2. 使用Ruff的--fix参数自动修复问题
3. 重新执行风格检查进行验证
**适用场景:** 代码修改完成后,自动格式化并修复风格问题。fmt-snapshotsfmt-snapshotshatch run lint:fmt-snapshots -- tests/snapshots/hatch run lint:fmt-snapshots -- tests/snapshots/stylestyleundefinedundefined
**What it validates:**
- Ruff formatting
- Ruff linting rules
- Cython linting
- C code formatting
- CMake formatting
**When to use:** To verify style compliance before committing without auto-fixes.
**验证内容:**
- Ruff格式化
- Ruff检查规则
- Cython代码检查
- C代码格式化
- CMake格式化
**适用场景:** 提交前验证代码风格合规性,且不需要自动修复。format_checkformat_checkruff formathatch run lint:format_check -- ddtrace/tracer.pyruff formathatch run lint:format_check -- ddtrace/tracer.pytypingtypingundefinedundefined
**When to use:** After adding type hints or modifying functions with type annotations.
**适用场景:** 添加类型提示或修改带类型注解的函数后。securitysecurityundefinedundefined
**When to use:** Before committing code that handles user input, credentials, or sensitive operations.
**适用场景:** 提交处理用户输入、凭证或敏感操作的代码前。spellingspellingundefinedundefined
**When to use:** Before committing documentation or user-facing text.
**适用场景:** 提交文档或面向用户的文本前。riotriothatch run lint:riotriotfile.pyhatch run lint:riotriotfile.pysuitespec-checksuitespec-checktests/suitespec.ymlhatch run lint:suitespec-checktests/suitespec.ymlhatch run lint:suitespec-checkerror-log-checkerror-log-checkhatch run lint:error-log-checkhatch run lint:error-log-checksgsgundefinedundefined
**When to use:** To find code patterns that may need refactoring or optimization.
**适用场景:** 查找可能需要重构或优化的代码模式。sg-testsg-testhatch run lint:sg-testhatch run lint:sg-testcformat_checkcformat_checkhatch run lint:cformat_checkhatch run lint:cformat_checkcmakeformat_checkcmakeformat_checkhatch run lint:cmakeformat_checkhatch run lint:cmakeformat_checkundefinedundefinedundefinedundefinedhatch run lint:typing -- ddtrace/contrib/flask/patch.pyhatch run lint:typing -- ddtrace/contrib/flask/patch.pyhatch run lint:checkshatch run lint:checkshatch run lint:security -- -r ddtrace/contrib/hatch run lint:security -- -r ddtrace/contrib/hatch run lint:spelling -- docs/ ddtrace/hatch run lint:spelling -- docs/ ddtrace/hatch run lint:fmt -- <file>lint:checks-- <file>lint:typinghatch run lint:fmt -- <file>lint:checks-- <file>lint:typingfmtfmtlint:checkslint:checks--undefined--undefinedundefinedundefinedhatch run lint:fmthatch run lint:fmt -- <file>
hatch run lint:style -- <file> # Should now passhatch run lint:fmthatch run lint:fmt -- <file>
hatch run lint:style -- <file> # 现在应该可以通过hatch run lint:typing -- <file>hatch run lint:typing -- <file>cd /path/to/dd-trace-py
hatch run lint:checkscd /path/to/dd-trace-py
hatch run lint:checksfmthatch run lint:fmt -- .fmthatch run lint:fmt -- .