Skip to content

Commit c2f3add

Browse files
Clarify helper visibility decision
Update the no-nested-functions rule to require explicitly deciding whether extracted functions are private internals or public API. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent cba6b3b commit c2f3add

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,7 +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>/`.
45+
- **No nested functions.** Do not define helper functions inside other functions. Extract helper logic to a separate function file and decide whether it belongs in `src/functions/private/<Group>/` (internal-only) or `src/functions/public/<Group>/` (part of the module API).
4646
- **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.
4747
- **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.
4848

0 commit comments

Comments
 (0)