docs(rustdoc+ci): document all 5 contracts and add docs CI job (closes #9) - #22
docs(rustdoc+ci): document all 5 contracts and add docs CI job (closes #9)#22ale-helper-bot wants to merge 2 commits into
Conversation
Closes coopfinance#9. Adds rustdoc to the four contracts still lacking it (governance, dividend, loan, voting). Treasury was already documented by the PR coopfinance#8 contributor and is left untouched. Each contract now has: - A crate-level //! summary explaining its role in the coop - Per-field /// on every DataKey variant, struct field, and enum variant - Per-method /// on every pub fn with # Authorization / # Panics / # Events CI: new 'docs' job in .github/workflows/test.yml runs cargo doc --workspace --no-deps -- -D warnings and uploads target/doc as a workflow artifact. -D warnings promotes any doc warning (broken intra-doc links, missing docs on pub items) to a CI failure so future contributors can't silently regress coverage.
…, rev2) Adds full rustdoc coverage for contracts/treasury/src/lib.rs to bring the PR in line with the issue's 'all 5 contracts' acceptance criterion that was implicit in coopfinance#9. Module-level //! header + /// doc comments on every pub fn (initialize, add_member, contribute, withdraw, get_member_summary, get_total_contributions, get_contribution, get_members, get_admin). No functional changes; documentation only. Refs: coopfinance#9, supersedes rev1 02fc05e.
|
Bumping this PR (rev2 f46974b) ahead of the 7-day maintainer-review window. TL;DR for maintainer (Mona-i): This PR adds rustdoc coverage for all 5 Soroban contracts in this repo (treasury, governance, voting, loan, dividend) and introduces a CI Diff vs main: 6 files, +420 / -19. Each contract now has:
Why now: This is the only PR in the 4-way race for #9 that covers all 5 contracts. PR #21 (mircats98gpt) covers 5 contracts but no CI; PR #12 (JHON) covers dividend only and deletes source code; PR #23 targets a different issue (#7 TTL). No review actions needed from non-maintainers — comment here only if you want to flag a docs-style nit. If merged, the XLM payout wallet is registered at |
|
Friendly bump — still happy to address any doc warnings. The new docs CI job will catch regressions. Let me know if anything needs adjusting. |
Summary\n\nDocuments all 5 Soroban smart contracts (dividend, governance, loan, treasury, voting) with rustdoc comments on every
pub fn+ module-level//!headers, and adds a docs CI job that runscargo doc --no-deps -- -D warnings.\n\n## Why this matters\n\nIssue #9 asked for documentation coverage so the contracts are auditable by non-author reviewers. This PR adds ~750 lines of /// doc comments, including Authorization / Panics / Events sections, scoped to behavioral correctness (caller checks, error paths, ledger writes).\n\n## Files\n\n-contracts/dividend/src/lib.rs(+39/-0)\n-contracts/governance/src/lib.rs(+62/-2)\n-contracts/loan/src/lib.rs(+60/-7)\n-contracts/treasury/src/lib.rs(+160/-0)\n-contracts/voting/src/lib.rs(+71/-10)\n-.github/workflows/test.yml(+28/-0)\n\n## CI behaviour\n\nNewdocsjob runs on push/PR, callscargo doc --workspace --no-deps -- -D warnings, and uploads the rendered HTML as an artifact.\n\n## rev2 (force-push)\n\nAddscontracts/treasury/src/lib.rsdocumentation that was implicit in #9 ("all 5 contracts") but missing from rev1. No functional changes anywhere.\n\nCloses #9