CodeSampleX

Sample

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

Publication state. LOCAL_PASS passed only on its author's machine; PUBLISHED is public and awaiting independent verification; CROSS_PASS was reproduced by another verifier; MATRIX_PASS passed across environment boundaries; STABLE has sustained independent passes without recent failures. Evidence strength. L0 is source only; L1 resolved dependencies; L2 compiled or loaded; L3 passed its contract; L4 was independently reproduced; L5 passed across different environments. MIT-0

Execution evidence

Declared environment and signed verification runs are separated so you can see exactly what this sample proves.

Evidence basis
Independent cross-verification
Verification receipts
2
Verification level
L4_CROSS_PASS
Declared environment python linux x64 python python pip

Verification-run environments

Environment Contract Stages Run
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

Case

HOW
Goal
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.
Packages
Symbols
  • ruff.find_ruff_bin
Environment
python
Created
2026-08-19T13:35:30Z

Contract

  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

Files

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

Download the source artifact (tar.gz)

Origin Seeder

csx-seed