Skip to content

Conversation

@Alan-Jowett
Copy link
Member

Description

This pull request primarily updates code comments throughout several files to improve clarity and consistency. Most changes involve adding missing periods at the end of comments or correcting minor typographical errors. There are no functional code changes or logic modifications included.

Comment improvements and typo corrections:

  • Added missing periods to comments in ebpf_core.c, socket_helper.cpp, sample_ext.c, sample_ext_drv.c, sample_ext_ioctls.h, and resource.h to standardize formatting. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
  • Corrected a spelling error in bpf_code_generator.cpp by changing "seperately" to "separately."

Testing

CI/CD

Documentation

No.

Installation

No.

saxena-anurag
saxena-anurag previously approved these changes Oct 27, 2025
@dthaler
Copy link
Collaborator

dthaler commented Oct 28, 2025

I wonder if we can put something in ./github/copilot-instructions.md to tell copilot to ensure that all comments end in punctuation, and follow the other developer guidelines? I'm guessing that a lot of the uses in PRs that don't follow the guidelines come from copilot.

Alan-Jowett pushed a commit to Alan-Jowett/ebpf-for-windows that referenced this pull request Nov 13, 2025
- Created .github/copilot-instructions.md with detailed guidelines
- Addresses comment formatting requirements (complete sentences with periods)
- Includes coding conventions, naming standards, and project-specific rules
- Covers SAL annotations, error handling patterns, and testing guidelines
- Provides 10-point checklist for code generation best practices
- Helps ensure Copilot generates code that follows project standards
- Responds to suggestion from @dthaler in PR microsoft#4760
@Alan-Jowett
Copy link
Member Author

@dthaler Great suggestion! I've implemented exactly what you requested.

I created a comprehensive .github/copilot-instructions.md file that:

Addresses the comment formatting issue: Explicitly instructs Copilot that "All comments MUST be complete sentences ending with proper punctuation (periods)"

Includes all developer guidelines: Covers naming conventions, coding standards, SAL annotations, error handling patterns, testing requirements, and more

Provides practical guidance: 10-point checklist for code generation, examples of correct/incorrect patterns, and project-specific architecture guidelines

The file is comprehensive and should significantly help ensure that Copilot-generated code follows the eBPF for Windows project standards, including the comment formatting that this PR addresses.

You can see the full implementation in the comment_grammer branch: https://github.com/Alan-Jowett/ebpf-for-windows/blob/comment_grammer/.github/copilot-instructions.md

This should help prevent future PRs from having comment formatting issues and ensure overall better code quality from Copilot contributions! 🚀

shankarseal
shankarseal previously approved these changes Dec 1, 2025
Alan-Jowett pushed a commit to Alan-Jowett/ebpf-for-windows that referenced this pull request Jan 5, 2026
- Created .github/copilot-instructions.md with detailed guidelines
- Addresses comment formatting requirements (complete sentences with periods)
- Includes coding conventions, naming standards, and project-specific rules
- Covers SAL annotations, error handling patterns, and testing guidelines
- Provides 10-point checklist for code generation best practices
- Helps ensure Copilot generates code that follows project standards
- Responds to suggestion from @dthaler in PR microsoft#4760
@Alan-Jowett Alan-Jowett requested a review from Copilot January 7, 2026 16:46
Copy link
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 pull request standardizes comment formatting across the codebase by ensuring all comments are complete sentences ending with periods. The PR also introduces GitHub Copilot instructions documenting the project's comment guidelines.

Key changes:

  • Added periods to incomplete comment sentences throughout multiple files
  • Corrected the spelling error "seperately" to "separately" in bpf_code_generator.cpp
  • Introduced .github/copilot-instructions.md with project coding guidelines

Reviewed changes

Copilot reviewed 64 out of 64 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.github/copilot-instructions.md New file documenting coding conventions and comment guidelines for GitHub Copilot
libs/execution_context/ebpf_core.c Added period to comment about extern variable
tools/bpf2c/bpf_code_generator.cpp Added periods to comments and corrected spelling error
tools/bpf2c/bpf2c.cpp Added period to comment about hash helper IDs
tools/bpf2c/bpf2c_dll.c Added period to comment about WIN32_LEAN_AND_MEAN
tools/netsh/dllmain.c Added periods to comments about verbs, nouns, and struct field descriptions
tools/netsh/resource.h Added period to comment about next default values
tests/unit/wer_report_test_wrapper.cpp Added periods to test case comments
tests/stress/km/stress_tests_km.cpp Added periods to comments and modified struct initializer spacing
tests/sample/unsafe/invalid_maps2.c Added periods to comments about callee indexes
tests/libs/util/socket_helper.cpp Added periods to multiple comments about socket operations
tests/bpf2c_tests/expected/*.c (44 files) Added periods to WIN32_LEAN_AND_MEAN comments in generated test files
undocked/tests/sample/ext/inc/sample_ext_ioctls.h Added period to comment about IOCTL Codes
undocked/tests/sample/ext/drv/sample_ext_drv.c Added periods to comments and consolidated multi-line comment
undocked/tests/sample/ext/drv/sample_ext.c Added periods to comments about NPI provider characteristics

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

Alan Jowett added 3 commits January 7, 2026 08:59
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Alan Jowett and others added 2 commits January 7, 2026 08:59
- Created .github/copilot-instructions.md with detailed guidelines
- Addresses comment formatting requirements (complete sentences with periods)
- Includes coding conventions, naming standards, and project-specific rules
- Covers SAL annotations, error handling patterns, and testing guidelines
- Provides 10-point checklist for code generation best practices
- Helps ensure Copilot generates code that follows project standards
- Responds to suggestion from @dthaler in PR microsoft#4760
Remove duplicate naming convention documentation and reference the canonical source in docs/DevelopmentGuide.md instead. This eliminates maintenance fragility and ensures consistency between the two files.

Addresses feedback from PR review.
…ax in .github/copilot-instructions.md; revert unrelated initializer spacing in tests/stress/km/stress_tests_km.cpp.
@Alan-Jowett
Copy link
Member Author

Addressed review comments:

  • Corrected doxygen annotation guidance in .github/copilot-instructions.md to use @param[in], @param[out], and @param[in,out].
  • Reverted unrelated initializer spacing changes in tests/stress/km/stress_tests_km.cpp.

Pushed to comment_grammer (commit a2f4905). Please take another look.

Copy link
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

Copilot reviewed 64 out of 64 changed files in this pull request and generated no new comments.


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


## What NOT to Do

- **DON'T** use global variables where possible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

- Use `const` and `static` modifiers to scope exposure appropriately.

### Code Structure
- Source lines MUST NOT exceed 120 columns.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants