Skip to content

Commit 22fe4b8

Browse files
committed
Enhance function documentation guidelines by adding requirements for example sections and expanding comment-based help structure
1 parent 6b0b3bc commit 22fe4b8

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

.github/copilot-instructions.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,6 @@ extension. These files shall always be placed in the folder source/Private.
2222
This also applies to functions that are only used within a single public
2323
command.
2424

25-
## Comment-based help
26-
27-
Comment-based help should always be before the function-statement for each
28-
public command and private function, and before the class-statement for each
29-
class-based resource. Comment-based help should always be in the format of
30-
a comment block and at least use the keywords: .SYNOPSIS, .DESCRIPTION,
31-
.PARAMETER, .EXAMPLE, and .NOTES.
32-
33-
Each comment-based help keyword should be indented with 4 spaces and each
34-
keyword's text should be indented 8 spaces.
35-
36-
The text for keyword .DESCRIPTION should be descriptive and must have a
37-
length greater than 40 characters. The .SYNOPSIS keyword text should be
38-
a short description of the public command, private function, or class-based
39-
resource.
40-
41-
A comment-based help must have at least one example, but preferably more
42-
examples to showcase all possible parameter sets and different parameter
43-
combinations.
44-
4525
## Localization
4626

4727
All strings in public commands, private functions and classes should be localized

.github/instructions/dsc-community-style-guidelines.instructions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ function Get-Something
104104
- Include `[CmdletBinding()]` on every function
105105
- Parameter block at top
106106
- Parameter block: `param ()` if empty, else opening/closing parentheses on own lines
107-
- Comment-based help: SYNOPSIS, DESCRIPTION, PARAMETER sections before function/class
108-
- Help indentation: keywords 4 spaces, text 8 spaces
107+
- Comment-based help: SYNOPSIS, DESCRIPTION (40+ chars), PARAMETER, EXAMPLE sections before function/class
108+
- Comment-based help indentation: keywords 4 spaces, text 8 spaces
109+
- Include examples for all parameter sets and combinations
109110
- `[OutputType()]` for functions with output
110111
- All parameters use `[Parameter()]` attribute, mandatory parameters use `[Parameter(Mandatory = $true)]`
111112
- Parameter attributes on separate lines

0 commit comments

Comments
 (0)