Skip to content

Commit

Permalink
Adding copilot-instructions (#308)
Browse files Browse the repository at this point in the history
* Experimenting using copilot-instructions.md

Feature info: https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot

* Apply suggestions from code review

Co-authored-by: David Pine <[email protected]>

---------

Co-authored-by: David Pine <[email protected]>
  • Loading branch information
aaronpowell and IEvangelist authored Dec 5, 2024
1 parent a6c8845 commit ac58cc1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Coding Style

- Use spaces for indentation with four-spaces per level, unless it is a csproj file, then use two-spaces per level.
- For integrations use the following namespace rules:
- If the integration is a hosting integration (starts with CommunityToolkit.Aspire.Hosting), extension methods should be placed in `Aspire.Hosting`.
- If the integration is a client integration (starts with CommunityToolkit.Aspire), extension methods should be placed in `Microsoft.Extensions.Hosting`.
- Use file-scoped namespaces.
- All public members require doc comments.
- Prefer type declarations over `var` when the type isn't obvious.

## Sample hosting integration

```csharp
namespace Aspire.Hosting;

public static class SomeProgramExtensions
{
public static IResourceBuilder<SomeProgramResource> AddSomeProgram(
this IDistributedApplicationBuilder builder,
[ResourceName] string name)
{
var resource = new SomeProgramResource(name);
return builder.AddResource(resource);
}
}
```

0 comments on commit ac58cc1

Please sign in to comment.