Skip to content

Commit cba6b3b

Browse files
Apply no-nested-functions rule to all functions
Move the nested helper guidance from the private-functions section to general layout rules so it clearly applies to all functions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent a903483 commit cba6b3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/docs/Modules/Standards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Layout rules:
4242
- **One declaration per file.** Filename matches the declared symbol exactly, including casing.
4343
- **Group by domain.** Use resource or behaviour groups — not verb folders, not endpoint paths.
4444
- **Mirror public and private domains.** Public command under `src/functions/public/Projects/` has related private helpers under `src/functions/private/Projects/`.
45+
- **No nested functions.** Do not define helper functions inside other functions. Put helper logic in separate private function files under `src/functions/private/<Group>/`.
4546
- **Declare dependencies where they are used.** Use `#Requires -Modules <Name>` at the top of each function file that needs an external module. Do not add `RequiredModules` to `src/manifest.psd1` — the build collects all `#Requires` declarations automatically and writes them into the compiled manifest. Entries in `src/manifest.psd1` are silently ignored for this purpose.
4647
- **Group documentation pages with source.** Place a `<Group>.md` file alongside the function files in each `src/functions/public/<Group>/` folder to provide a category overview in generated documentation.
4748

@@ -57,7 +58,6 @@ Layout rules:
5758
- No pipeline input.
5859
- No defaulting from context — public callers resolve before calling.
5960
- Required inputs declared as mandatory.
60-
- No nested helper functions. If logic needs a helper, create it as a separate private function file under `src/functions/private/<Group>/`.
6161

6262
## SOLID applied
6363

0 commit comments

Comments
 (0)