Skip to content

chore: add GitHub Copilot instructions#1438

Merged
hwbrzzl merged 2 commits into
masterfrom
bowen/add-copilot-instructions
Apr 10, 2026
Merged

chore: add GitHub Copilot instructions#1438
hwbrzzl merged 2 commits into
masterfrom
bowen/add-copilot-instructions

Conversation

@hwbrzzl

@hwbrzzl hwbrzzl commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add .github/copilot-instructions.md with Go code style, error handling, and testing rules for GitHub Copilot
  • Enforce consistent import ordering, use of any over interface{}, and sentinel error declaration patterns
  • Point to .agents/prompts/tests.md for the full testing guidelines

Why

The repository had no structured file to guide GitHub Copilot when reviewing or generating code for goravel/framework. Without it, Copilot suggestions could diverge from the project's established conventions around error handling, code style, and testing.

Adding .github/copilot-instructions.md documents the key rules in one place — Go style (use any, import order, no variable shadowing), error handling (sentinel errors in errors/list.go, module tagging, no silent swallowing), and a pointer to the full testing guide — so that Copilot's review feedback and code suggestions stay consistent with project standards.

Copilot AI review requested due to automatic review settings April 10, 2026 04:02
@hwbrzzl
hwbrzzl requested a review from a team as a code owner April 10, 2026 04:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-specific .github/copilot-instructions.md to guide GitHub Copilot’s PR reviews and code generation for goravel/framework, with emphasis on Go style, error-handling conventions, and where to find detailed testing guidance.

Changes:

  • Introduces Copilot guidance for Go code style (e.g., any, import grouping, shadowing guidance).
  • Documents error-handling expectations (sentinel errors, module tagging, .Args(...) formatting).
  • Links to the existing test guidelines at .agents/prompts/tests.md.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
Comment thread .github/copilot-instructions.md Outdated
@codecov

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.79%. Comparing base (cb974a8) to head (14e7709).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1438      +/-   ##
==========================================
+ Coverage   68.78%   68.79%   +0.01%     
==========================================
  Files         361      361              
  Lines       27829    27833       +4     
==========================================
+ Hits        19141    19147       +6     
+ Misses       7840     7839       -1     
+ Partials      848      847       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 10, 2026 04:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a repository-scoped instruction file intended to steer GitHub Copilot reviews and code generation toward goravel/framework conventions (Go style, framework error patterns, and testing guidance).

Changes:

  • Added .github/copilot-instructions.md documenting Go code style rules (e.g., any, import grouping, shadowing guidance).
  • Documented framework error handling conventions (sentinel errors, module tagging, .Args(...) usage).
  • Linked to .agents/prompts/tests.md for the full testing guidelines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## Error Handling

- All sentinel errors must be declared in `errors/list.go` using the framework error constructor: `github.com/goravel/framework/errors.New(...)` (or unqualified `New(...)` when inside `package errors`). Do not create ad-hoc `fmt.Errorf` errors for domain errors.

- All sentinel errors must be declared in `errors/list.go` using the framework error constructor: `github.com/goravel/framework/errors.New(...)` (or unqualified `New(...)` when inside `package errors`). Do not create ad-hoc `fmt.Errorf` errors for domain errors.
- Tag errors with a module via `.SetModule(errors.ModuleXxx)` when returning from a service provider or internal package.
- Use format verbs in error messages and supply dynamic parts via `.Args(...)` — never interpolate directly into the `New` string.
@hwbrzzl
hwbrzzl merged commit 22dc71f into master Apr 10, 2026
21 checks passed
@hwbrzzl
hwbrzzl deleted the bowen/add-copilot-instructions branch April 10, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants