mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2026-07-07 01:24:38 +00:00
2.4 KiB
2.4 KiB
Contributions
Thank you for contributing to this project.
Scope
This document defines contribution expectations for code quality, testing, and documentation.
Quick Start
- Fork and create a feature branch from
v2-ts. - Make focused, minimal, reversible changes.
- Run relevant checks before opening a PR.
- Open a PR with a clear summary and validation notes.
Development Standards
- Preserve existing architecture unless a change is explicitly requested.
- Keep naming consistent for semantically identical constructs.
- Prefer explicit failures with actionable errors.
- Avoid changing public API or externally observable behavior unless requested.
Documentation Standards
Apply these standards to all exported/public APIs in src/:
- Use TSDoc blocks (
/** ... */) with concise behavior-focused summaries. - Include explicit
@paramtags for each input parameter. - Include explicit
@returnstags for return values (orNothingforvoid). - Include
@throwswhen the function intentionally throws validation/runtime errors. - Prefer documenting behavior and constraints over implementation detail.
- Keep comments synchronized with current behavior; update docs in the same change as code.
Testing Standards
- Test naming format:
<method> <conditions> <expected>. - Test behavior, not implementation detail.
- Keep setup focused on the tested condition.
- Avoid control-flow logic (
if, loops) in test bodies. - Add or update tests for any behavior change in the same PR.
Verification Before PR
Run the smallest relevant checks first, then broader checks as needed:
npm run typecheck
npm exec vitest run test/action.test.ts test/action-runner.test.ts test/manifest.test.ts test/io.test.ts
When changing scripts under scripts/dev/ or scripts/ops/, also run:
npm exec vitest run test/dev_scripts.test.ts
Pull Request Checklist
- Change scope is clear and minimal.
- Documentation updated for exported/public API changes.
- Tests added/updated for behavior changes.
- Verification commands listed with pass/fail status.
- No secrets or credentials are included.
Commit Message Guidance
Use concise, imperative messages, for example:
docs: standardize TSDoc across src APIstest: add coverage for ActionRunner cache-hit branchrefactor: move reusable script library to repository root