Skip to content

Commit 352412b

Browse files
benhillisBen Hillismattkur
authored
ci: add .github/copilot-instructions.md (#1658)
This change adds a copilot-instructions.md file which will be used by @copilot to give more context on how to develop for the openvmm repo. See: https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/agents/copilot-coding-agent/best-practices-for-using-copilot-to-work-on-tasks --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Co-authored-by: Matt LaFayette (Kurjanowicz) <mattkur@microsoft.com>
1 parent 3b7f9c1 commit 352412b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/copilot-instructions.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This is a Rust based repository. Please follow these guidelines when contributing:
2+
3+
## Code Standards
4+
5+
### Required Before Each Commit
6+
- Run `cargo xtask fmt --fix` before committing any changes to ensure proper code formatting.
7+
- This will ensure all source code and generated pipeline files maintain consistent style and content.
8+
- Cross-compile by targeting `x86_64` and `aarch64` processors, and Windows and Linux environments.
9+
10+
## Key Guidelines
11+
1. Follow Rust best practices and idiomatic patterns.
12+
2. Maintain existing code structure and organization.
13+
3. Write unit tests for new functionality.
14+
4. Document public APIs and complex logic. Suggest changes to the `Guide/` folder when appropriate.
15+
16+
## Domain-specific Guidelines
17+
Both OpenVMM and OpenHCL processes data from untrusted sources. OpenHCL runs in a constrained environment.
18+
19+
When possible:
20+
1. Avoid `unsafe` code.
21+
2. Avoid taking new external dependencies, or those that can significantly increase binary size.
22+
23+
## Testing
24+
The OpenVMM project contains several types of tests.
25+
- **Unit tests** are spread throughout crates, and are marked by a `#[cfg(test)]` code block.
26+
- **VMM tests** are integration tests. These are found in the `vmm_tests` folder, and use the code in `petri` as a framework to help create Hyper-V and OpenVMM based VMs.
27+
- **Fuzz tests** are nondeterminstic, and are used to ensure that the code does not panic across trust boundaries.
28+
29+
Whenever possible, thoroughly test the code with unit tests. Add a test case to the VMM tests if there is an interesting integration point.

0 commit comments

Comments
 (0)