Contributing¶
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Setup¶
The project uses uv for dependency management:
Using pre-commit is highly recommended. To install hooks, run:
Running checks¶
uv run pytest --doctest-modules rss_parser tests
uv run black --check .
uv run ruff check .
uv run mypy rss_parser
Test architecture¶
The suite is layered; each layer catches what the others can't:
- Spec tests (
test_spec_compliance.py,test_spec_atom.py,test_tag.py,test_dates.py,test_detection.py,test_extensibility.py,test_itunes.py,test_errors.py,test_serialization.py) — targeted assertions with hand-written expected values. This is where correctness lives. - Property-based tests (
test_properties.py, hypothesis) — invariants that must hold for generated feeds: text round-trips, lists are always lists, unknown tags are never dropped,model_validate(model_dump())is idempotent. - Real-world corpus (
test_corpus.py,tests/corpus/) — feeds captured from the wild (BBC, NPR, YouTube, Slashdot, GitHub, podcasts...), parsed offline. Expectations in eachexpect.jsonare derived by reading the raw XML, never by running the parser — seetests/corpus/README.md. -
Serialization snapshots (
test_snapshots.py,tests/samples/) — fullmodel_dumpcontracts for small curated samples, guarding the output shape against accidental changes. Regenerate after intentional changes with:Review the resulting diff carefully — the snapshots are the contract.
Coverage has a CI-enforced floor (fail_under in pyproject.toml).
Both samples and corpus feeds are discovered automatically — dropping a new directory in is enough.
Docs¶
Docs are built with mkdocs-material: