| name | workflows |
| description | Common developer workflows, commands, and troubleshooting for leanSpec |
/workflows - Repository Workflows
Common developer workflows and commands for working in leanSpec.
Running Specific Tests
just test tests/lean_spec/subspecs/networking/discovery/test_transport.py -v
just test -k "TestDiscoveryTransport::test_start" -v
just test -s -k "test_name"
Resolving Type Errors
The project uses two type checkers. Run them separately to isolate issues:
just typecheck
just lint
Common type error patterns:
invalid-assignment — Wrong type assigned; check if a domain type (RequestId, PeerId) is expected instead of raw bytes
invalid-argument-type — Function argument type mismatch; verify the function signature
union-attr — Accessing attribute on a possibly-None value; add an assert is not None guard
Inspecting Coverage
After running tests, coverage reports are generated:
just test-cov
open htmlcov/index.html
Running Interop Tests
Interop tests are excluded from the default test run. Run them explicitly:
just interop
Spell Check Failures
just spellcheck
echo "newword" >> .codespell-ignore-words.txt
Markdown Formatting
just mdformat
Common Pitfalls
- Tests pass locally but CI fails: CI runs checks across Python 3.12, 3.13, and 3.14. Ensure no version-specific syntax is used.
ruff format changes after ruff check --fix: Always run format after fix — the fixer doesn't guarantee formatting compliance.
- Import ordering issues: Run
just fix to auto-sort imports.