mirror of
https://github.com/microsoft/WSL.git
synced 2026-04-19 03:53:00 -05:00
* docs: overhaul Copilot instructions with coding conventions and prompt files Major update to .github/copilot-instructions.md: - Add coding conventions (naming, error handling, RAII, strings, headers, synchronization, localization, telemetry, formatting, IDL/COM, config) - Add test authoring summary pointing to detailed test.md prompt - Add namespace-to-directory map for top-level namespaces - Add key source files list (defs.h, WslTelemetry.h, wslc.idl, etc.) - Replace clang-format references with .\FormatSource.ps1 - Consolidate duplicate timing info into single reference table New files: - .github/copilot/review.md: Review prompt focused on high-risk areas (ABI breaks, missing localization, resource safety) - .github/copilot/test.md: Test generation prompt with TAEF patterns - .github/copilot/commit.md: Commit message guidelines - .editorconfig: Editor settings for non-C++ files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: address PR review feedback - Scope precomp.h guidance to Windows components (Linux doesn't use it) - Fix review.md reference to .github/copilot-instructions.md - Restore clang-format as Linux formatting option alongside FormatSource.ps1 - Note FormatSource.ps1 requires cmake . first - Fix en-us -> en-US casing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1.2 KiB
1.2 KiB
Code Review Guidelines for WSL
When reviewing code, enforce the conventions in .github/copilot-instructions.md. Focus especially on these high-risk areas:
ABI Safety (Critical)
- Flag new methods added to existing COM interfaces without a new versioned interface/IID
- Flag changed struct layouts in IDL files
- Flag changes to
WSLPluginHooksV1orWSLPluginAPIV1structs (public API)
Resource Safety
- Flag raw
CloseHandle(),delete,free(), or manual resource cleanup — require WIL smart pointers - Flag missing
NON_COPYABLE()/NON_MOVABLE()on classes that hold resources - Flag lock usage without
_Guarded_by_()SAL annotations
User-Facing Changes
- Flag hardcoded English strings — require
Localization::MessageXxx()and Resources.resw entry - Flag new
.wslconfigsettings without corresponding Resources.resw localization string - Flag silent fallback on invalid config values — require
EMIT_USER_WARNING()
Error Handling
- Flag bare
if (FAILED(hr))— require WIL macros - Flag silently swallowed errors — require
CATCH_LOG()orLOG_IF_FAILED() - Flag telemetry events missing privacy data tags