Thanks for your interest. A few conventions that keep the repo easy to maintain.
-
Install in editable mode with dev extras and run the test suite locally:
python -m venv .venv && source .venv/bin/activate pip install -e ".[dev]" pytest tests/ -v
Expect 50+ passed, 1 skipped (the live smoke test is opt-in via
SUBSTACK2MD_LIVE=1). -
Before pushing, run the linter the way CI does:
ruff check substack2md tests ruff format --check substack2md tests
-
If you changed behavior that users see, update
README.mdandCHANGELOG.mdin the same PR. -
If you added a new CLI flag, new frontmatter field, or changed the shape of any public function, add a test covering the new behavior.
- Keep PRs focused. One concern per PR beats one giant PR.
- Title in Conventional Commits style:
feat:,fix:,refactor:,docs:,ci:,test:, etc. - PR description should answer: what problem does this solve, what changed, how did you test it.
- If your PR introduces network or side-effect code, flag it in the description so reviewers know to look closely.
- Follow existing code style. Indent is 4 spaces.
- Type hints on new function signatures are encouraged but not strictly required yet.
- Use the
loggingmodule for diagnostics. The module-levellogobject insubstack2md._coreis the shared logger; reserveprint()for boot-time errors that happen before logging is configured. - Run
ruff checkandruff formatbefore pushing; CI enforces both. - No em dashes in user-facing strings (markdown output, CLI help, README, docs).
Tests live in tests/. The suite uses pytest plus the responses library for HTTP mocking. A Chrome/Brave CDP session is not required to run tests; CDP is stubbed out in the CLI wiring tests.
To run just the unit tests:
pytest tests/ -vTo run the optional live smoke test (hits Substack's real API):
SUBSTACK2MD_LIVE=1 pytest tests/test_live_smoke.py -v -sBe kind. Assume good faith. This is a small personal-archival tool; the bar is functionality, not ceremony.
Check the issues list for ideas, or look at the ## Contributing section of the README for areas that could use help. Small docs fixes, edge-case test additions, and platform-specific troubleshooting notes are always welcome.