示例
Differentiate Ruff directory exclusions between top-level exclude which completely overwrites default excluded paths like virtual environments, extend-exclude which preserves default excludes, and force-exclude which governs whether explicitly passed file paths are filtered.
sha256:13ed1592fd6a24d410fe43470d6672a385528c30b007098eae90619ce9e0fabe
发布状态。LOCAL_PASS 表示仅在作者环境中通过;PUBLISHED 表示已公开并等待独立验证;CROSS_PASS 表示另一验证者已复现;MATRIX_PASS 表示在不同环境中通过;STABLE 表示近期无失败且独立通过持续稳定。
证据强度。L0 仅有源码;L1 已解析依赖;L2 已编译或加载;L3 已通过契约;L4 已被独立复现;L5 已在不同环境中通过。
MIT-0
执行证据
分开显示声明环境和签名验证运行,明确样本的证明范围。
- 证据依据
- 独立交叉验证
- 验证回执
- 2
- 验证级别
- L4_CROSS_PASS
声明的环境
python linux x64 python python pip
验证运行环境
| 环境 | 契约 | 阶段 | 运行日期 |
|---|---|---|---|
| python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1 |
2026-08-19 |
| python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1 |
2026-08-19 |
案例
HOW- 目标
- Differentiate Ruff directory exclusions between top-level exclude which completely overwrites default excluded paths like virtual environments, extend-exclude which preserves default excludes, and force-exclude which governs whether explicitly passed file paths are filtered.
- 符号
-
- ruff.find_ruff_bin
- 环境
- python
- 创建时间
- 2026-08-19T13:35:30Z
契约
- Configuring top-level exclude replaces Ruff default exclusion list rather than extending it, causing virtual environments such as .venv to be scanned unless extend-exclude is used, while explicit CLI path arguments bypass exclusion patterns unless force-exclude is enabled.
- assert unconfigured Ruff automatically excludes default directories including .venv when checking the workspace
- assert setting top-level exclude overwrites default exclusions causing .venv to be linted with exit code 1
- assert setting extend-exclude appends custom paths while retaining default exclusions so .venv remains ignored
- assert explicitly passing an excluded file path on the CLI bypasses exclude and extend-exclude when force-exclude is false
- assert setting force-exclude = true in configuration or passing --force-exclude causes explicitly passed excluded files to be skipped with exit code 0
- assert passing --no-force-exclude overrides configuration force-exclude = true and restores explicit file linting
- assert passing --isolated ignores configuration files and restores default exclusion patterns
文件
- NOTES.md
- csx.json
- pyproject.toml
- requirements.txt
- src/__init__.py
- src/executor.py
- test/contract.py