Skip to content

Update copilot-instructions: API design rules from PR #305 review#317

Merged
jonathanpeppers merged 2 commits intomainfrom
dev/update-copilot-instructions
Mar 19, 2026
Merged

Update copilot-instructions: API design rules from PR #305 review#317
jonathanpeppers merged 2 commits intomainfrom
dev/update-copilot-instructions

Conversation

@rmarinho
Copy link
Member

Summary

Add three rules to .github/copilot-instructions.md learned from PR #305 (AdbRunner reverse port forwarding) review feedback by @jonathanpeppers:

  1. Strongly-typed APIs over strings — use record/enum pairs (e.g. AdbPortSpec(AdbProtocol.Tcp, 5000)) instead of raw strings like "tcp:5000"
  2. Avoid convenience overloads — don't add string, int, and typed overloads for the same method. Pick one.
  3. Include stdout in error diagnostics — pass both stdout and stderr to ProcessUtils.ThrowIfFailed when available

These patterns keep the API surface small, type-safe, and debuggable.

…loads, stdout in errors

Add three rules learned from PR #305 review feedback:
- Prefer strongly-typed APIs (enum+record) over string parameters
- Avoid convenience overloads (string, int, typed) — pick one
- Include stdout in ProcessUtils.ThrowIfFailed error diagnostics

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 19, 2026 17:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repository’s Copilot guidance to capture API design patterns learned during the PR #305 review, helping keep new Android-tools APIs small, type-safe, and easier to debug.

Changes:

  • Add guidance to prefer strongly-typed API parameters (record/enum) over string “spec” parameters.
  • Add guidance to avoid “convenience overload” proliferation (string/int/typed variants).
  • Add guidance to include stdout (when captured) in ProcessUtils.ThrowIfFailed diagnostics.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jonathanpeppers jonathanpeppers merged commit d679f2b into main Mar 19, 2026
1 of 2 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/update-copilot-instructions branch March 19, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants