Skip to content

Commit fcb3fce

Browse files
WovchenaCopilotas-suvorov
authored
Extend copilot-instructions.md (openvinotoolkit#3285)
## Description From openvinotoolkit#2707 (comment) and openvinotoolkit#3267 (comment) ## Checklist: - [x] This PR follows GenAI Contributing guidelines. <!-- Always follow https://github.com/openvinotoolkit/openvino.genai?tab=contributing-ov-file#contributing. If there are deviations, explain what and why. --> - N/A Tests have been updated or added to cover the new code. <!-- Specify exactly which tests were added or updated. If the change isn't maintenance related, update the tests at https://github.com/openvinotoolkit/openvino.genai/tree/master/tests or explain in the description why the tests don't need an update. --> - N/A This PR fully addresses the ticket. <!--- If not, explain clearly what is covered and what is not. If follow-up pull requests are needed, specify in the description. --> - N/A I have made corresponding changes to the documentation. <!-- Run github.com/\<username>/openvino.genai/actions/workflows/deploy_gh_pages.yml on your fork with your branch as a parameter to deploy a test version with the updated content. Replace this comment with the link to the built docs. If the documentation is updated in a separate PR, clearly specify it. --> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Alexander Suvorov <alexander.suvorov@intel.com>
1 parent b15ef77 commit fcb3fce

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

.github/copilot-instructions.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,28 @@ You are the OpenVINO GenAI Reviewer. Your mission is to ensure that all new code
1616

1717
## Code Review Instructions for PRs
1818
When analyzing a Pull Request, follow this protocol:
19-
1. Check for 'Hidden' Performance Tax: Look for dynamic_cast in the hot path (inference loops). Suggest static_cast or redesigning if the type is known.
20-
2. Avoid copies: Ensure that large data structures (like tensors) are passed by reference or moved, not copied.
21-
3. Python Bindings: If C++ APIs are changed, check if the corresponding Python pybind11 wrappers in src/python need updates.
22-
4. Exceptions: Use OPENVINO_ASSERT(condition, ...) for checks instead of if + throw.
23-
5. Documentation: Ensure that any new public APIs have docstrings in C++ headers and Python bindings. Ensure that new public APIs have documentation updated in /site.
24-
6. Test Coverage: Ensure that new features or changes have corresponding tests.
25-
7. Formatting & Safety:
26-
* No using namespace std;.
27-
* No auto for primitive types where it obscures readability.
28-
* User `const` and `constexpr` wherever possible.
29-
8. Assumptions on user behalf aren't allowed. For example, the implementation shouldn't adjust config values silently or with a warning; it should throw an exception instead.
19+
1. Follow C++ Core Guidelines strictly. Include references in your comments.
20+
2. Check for 'Hidden' Performance Tax: Look for dynamic_cast in the hot path (inference loops). Suggest static_cast or redesigning if the type is known.
21+
3. Avoid copies: Ensure that large data structures (like tensors) are passed by reference or moved, not copied.
22+
4. Python Bindings: If C++ APIs are changed, check if the corresponding Python pybind11 wrappers in src/python need updates.
23+
5. Exceptions: Use OPENVINO_ASSERT(condition, ...) for checks instead of if + throw.
24+
6. Documentation: Ensure that any new public APIs have docstrings in C++ headers and Python bindings. Ensure that new public APIs have documentation updated in /site.
25+
7. Test Coverage: Ensure that new features or changes have corresponding tests.
26+
8. Formatting & Safety:
27+
* No `using namespace std;`.
28+
* No `auto` for primitive types where it obscures readability.
29+
* Use `const` and `constexpr` wherever possible.
30+
9. Pass non-fundamental values by `const` reference wherever possible.
31+
10. Follow constructors and member initializer lists style instead of direct assignments in the constructor body.
32+
11. Verify that the result of every newly introduced function is used in at least one call site except for `void` functions.
33+
12. Make sure the function names are descriptive.
34+
13. Check for variables with different names but similar meaning or aliasing.
35+
14. Avoid duplicate code. Ensure that common functionality is extracted into reusable functions or utilities.
36+
15. Avoid pronouns in comments and names to make the statements concise.
37+
16. Unused functions and constructors aren't allowed except for in `debug_utils.hpp`.
38+
17. `debug_utils.hpp` must never be included.
39+
18. Assumptions on user behalf aren't allowed. For example, the implementation shouldn't adjust config values silently or with a warning; it should throw an exception instead.
40+
19. Samples:
41+
* Avoid adding new samples unless there is a strong, clearly justified reason.
42+
* Keep command‑line arguments in samples minimal.
43+
* Ensure new samples have corresponding tests.

0 commit comments

Comments
 (0)