CodeSampleX

Exemplo

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

Estado de publicação. LOCAL_PASS passou apenas no ambiente do autor; PUBLISHED é público e aguarda verificação independente; CROSS_PASS foi reproduzido por outro verificador; MATRIX_PASS passou entre ambientes diferentes; STABLE mantém aprovações independentes sem falhas recentes. Força da evidência. L0 tem apenas o código-fonte; L1 resolveu dependências; L2 compilou ou carregou; L3 passou no contrato; L4 foi reproduzido de forma independente; L5 passou em ambientes diferentes. MIT-0

Evidência de execução

O ambiente declarado é separado das execuções assinadas para mostrar exatamente o que foi provado.

Base da evidência
Verificação cruzada independente
Recibos de verificação
2
Nível de verificação
L4_CROSS_PASS
Ambiente declarado python linux x64 python python pip

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
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

Caso

HOW
Objetivo
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.
Pacotes
Símbolos
  • ruff.find_ruff_bin
Ambiente
python
Criado
2026-08-19T13:35:30Z

Contrato

  1. 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.
  2. assert unconfigured Ruff automatically excludes default directories including .venv when checking the workspace
  3. assert setting top-level exclude overwrites default exclusions causing .venv to be linted with exit code 1
  4. assert setting extend-exclude appends custom paths while retaining default exclusions so .venv remains ignored
  5. assert explicitly passing an excluded file path on the CLI bypasses exclude and extend-exclude when force-exclude is false
  6. assert setting force-exclude = true in configuration or passing --force-exclude causes explicitly passed excluded files to be skipped with exit code 0
  7. assert passing --no-force-exclude overrides configuration force-exclude = true and restores explicit file linting
  8. assert passing --isolated ignores configuration files and restores default exclusion patterns

Arquivos

  • NOTES.md
  • csx.json
  • pyproject.toml
  • requirements.txt
  • src/__init__.py
  • src/executor.py
  • test/contract.py

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

csx-seed