Skip to content

Restructure copilot instructions into targeted instruction files#4176

Open
atobiszei wants to merge 3 commits intomainfrom
atobisze_copilot-instructions-restructure
Open

Restructure copilot instructions into targeted instruction files#4176
atobiszei wants to merge 3 commits intomainfrom
atobisze_copilot-instructions-restructure

Conversation

@atobiszei
Copy link
Copy Markdown
Collaborator

  • Slim copilot-instructions.md to project overview + 17 code review rules
  • Add .github/instructions/cpp-headers.instructions.md (applyTo: **/*.hpp)
  • Add .github/instructions/cpp-sources.instructions.md (applyTo: **/*.cpp)
  • Add .github/instructions/bazel-build.instructions.md (applyTo: **/BUILD)
  • Add .github/instructions/build-workflow.instructions.md (description-based)

copilot-instructions.md remains the source of truth for GitHub PR review bot. The .instructions.md files are VS Code-only, activated contextually.

🛠 Summary

JIRA/Issue if applicable.
Describe the changes.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

- Slim copilot-instructions.md to project overview + 17 code review rules
- Add .github/instructions/cpp-headers.instructions.md (applyTo: **/*.hpp)
- Add .github/instructions/cpp-sources.instructions.md (applyTo: **/*.cpp)
- Add .github/instructions/bazel-build.instructions.md (applyTo: **/BUILD)
- Add .github/instructions/build-workflow.instructions.md (description-based)

copilot-instructions.md remains the source of truth for GitHub PR review bot.
The .instructions.md files are VS Code-only, activated contextually.
Copilot AI review requested due to automatic review settings May 4, 2026 12:50
@atobiszei atobiszei requested a review from rasapala May 4, 2026 12:55
Copy link
Copy Markdown
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

This documentation/configuration PR reorganizes the repository’s Copilot guidance for OVMS by moving language- and workflow-specific instructions into .github/instructions while slimming the shared .github/copilot-instructions.md file.

Changes:

  • Reduced .github/copilot-instructions.md to the project overview plus 17 review rules.
  • Added contextual instruction files for C++ headers, C++ sources, Bazel BUILD files, and build/test workflow guidance.
  • Split previously centralized guidance into VS Code-targeted instruction documents.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.github/copilot-instructions.md Slims the main Copilot guidance down to overview + review rules.
.github/instructions/cpp-sources.instructions.md Adds source-file-specific C++ guidance.
.github/instructions/cpp-headers.instructions.md Adds header-file-specific C++ guidance.
.github/instructions/build-workflow.instructions.md Adds Docker/Bazel/Make/test workflow instructions.
.github/instructions/bazel-build.instructions.md Adds Bazel BUILD-file guidance and conventions.

Comment on lines 27 to +31
## Code Review Instructions for PRs

When analyzing a Pull Request, follow this protocol:

### C++ Guidelines & Performance
Comment on lines +111 to +126
Run style checks **sequentially** — fix each step before moving to the next:

1. **clang-format** (formatting):
```bash
make style
```
2. **cpplint** (lint rules):
```bash
make cpplint
```
3. **Spelling**:
```bash
make spell
```

Each step runs via Make. Fix issues from step N before running step N+1 — later steps produce noise if formatting is off.
Comment thread .github/instructions/bazel-build.instructions.md Outdated
Comment on lines +14 to +15
- Use `ovms_test_cc_library` for test utility libraries (adds gtest dep automatically).
- Use `ovms_cc_test` for test binaries.
## Build Target Ownership

- **Every new `.cpp` must belong to its own `ovms_cc_library` target** in a BUILD file. Do not add sources to monolithic targets like `ovms_lib`.
- If a `.cpp` is only used by tests, use `ovms_test_cc_library` instead.
Comment on lines +8 to +12
- **Ban umbrella includes**: never use `openvino/openvino.hpp`, `rapidjson/document.h`, or similar in headers. Include only the specific subheader you need.
- **Forward-declare in headers**: if a header only uses pointers or references to a type, write `class Foo;` instead of `#include "foo.hpp"`. Move the full include to the `.cpp`.
- **Self-contained but minimal**: every header must compile on its own (`#pragma once`, own includes), but must not pull in transitive dependencies callers don't need.
- **No header solely for a typedef or enum**: forward-declare the enum (`enum class Foo;`) or use a lightweight `_fwd.hpp` header.
- **Third-party headers**: wrap in a port layer (`src/port/<dep>_<component>.hpp`) with warning suppression pragmas. Never include third-party headers directly from multiple OVMS headers.
@atobiszei atobiszei requested a review from dkalinowski May 4, 2026 13:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants