Skip to content

Commit a11a390

Browse files
🩹 [Patch]: Add Linter settings + fix documentation structure (#535)
## Description This pull request primarily fixes the documentation of PowerShell functions by adding PowerShell-formatted code blocks to the `.EXAMPLE` sections, due to upgrading from `platyPS` to `Microsoft.PowerShell.PlatyPS`. Additionally, it introduces configuration changes for linters and minor formatting corrections. Documentation improvements: * Added PowerShell-formatted code blocks to the `.EXAMPLE` sections of many function files in `src/functions/*`. This was needed to retain the code blocks in the examples, as `Microsoft.PowerShell.PlatyPS` lets the user configure this. Linter and configuration updates: * Added a `Linter` section to `.github/PSModule.yml` to explicitly disable several validation checks, such as `VALIDATE_BIOME_FORMAT` and `VALIDATE_POWERSHELL`. * Fixed a minor formatting issue in `.github/linters/.markdown-lint.yml` by changing double quotes to single quotes for the `MD026.punctuation` setting. This was also due to `Microsoft.PowerShell.PlatyPS` adding H3 for types which can be same for `.INPUTS` and `.OUTPUTS`. Encoding and formatting corrections: * Added or corrected UTF-8 BOM in some PowerShell files to ensure proper encoding.
1 parent 34c013c commit a11a390

File tree

335 files changed

+1123
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+1123
-56
lines changed

.github/PSModule.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,14 @@ Test:
1919
# Build:
2020
# Docs:
2121
# Skip: true
22+
23+
Linter:
24+
env:
25+
VALIDATE_BIOME_FORMAT: false
26+
VALIDATE_BIOME_LINT: false
27+
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
28+
VALIDATE_JSCPD: false
29+
VALIDATE_JSON_PRETTIER: false
30+
VALIDATE_MARKDOWN_PRETTIER: false
31+
VALIDATE_YAML_PRETTIER: false
32+
VALIDATE_POWERSHELL: false

.github/linters/.markdown-lint.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
###############
99
# Rules by id #
1010
###############
11-
MD004: false # Unordered list style
11+
MD004: false # Unordered list style
1212
MD007:
13-
indent: 2 # Unordered list indentation
13+
indent: 2 # Unordered list indentation
1414
MD013:
15-
line_length: 808 # Line length
16-
MD024: false # no-duplicate-heading, INPUTS and OUTPUTS _can_ be the same item
15+
line_length: 808 # Line length
16+
MD024: false # no-duplicate-heading, INPUTS and OUTPUTS _can_ be the same item
1717
MD026:
18-
punctuation: ".,;:!。,;:" # List of not allowed
19-
MD029: false # Ordered list item prefix
20-
MD033: false # Allow inline HTML
21-
MD036: false # Emphasis used instead of a heading
18+
punctuation: '.,;:!。,;:' # List of not allowed
19+
MD029: false # Ordered list item prefix
20+
MD033: false # Allow inline HTML
21+
MD036: false # Emphasis used instead of a heading
2222

2323
#################
2424
# Rules by tags #
2525
#################
26-
blank_lines: false # Error on blank lines
26+
blank_lines: false # Error on blank lines

src/classes/public/GitHubPermission.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class GitHubPermission : System.IEquatable[Object] {
1+
class GitHubPermission : System.IEquatable[Object] {
22
# The programmatic name of the permission as returned by the GitHub API
33
[string] $Name
44

src/functions/private/Actions/Import-GitHubEventData.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function Import-GitHubEventData {
99
Import data from the event that triggered the workflow.
1010
1111
.EXAMPLE
12+
```powershell
1213
Import-GitHubEventData
14+
```
1315
#>
1416
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
1517
'PSUseShouldProcessForStateChangingFunctions', '',

src/functions/private/Actions/Import-GitHubRunnerData.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
Import data about the runner that is running the workflow.
88
99
.EXAMPLE
10+
```powershell
1011
Import-GitHubRunnerData
12+
```
1113
#>
1214
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
1315
'PSUseShouldProcessForStateChangingFunctions', '',

src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByRepo.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@
1212
`created`, `event`, `head_sha`, `status`.
1313
1414
.EXAMPLE
15+
```powershell
1516
Get-GitHubWorkflowRunByRepo -Owner 'owner' -Repository 'repo'
17+
```
1618
1719
Lists all workflow runs for a repository.
1820
1921
.EXAMPLE
22+
```powershell
2023
Get-GitHubWorkflowRunByRepo -Owner 'owner' -Repository 'repo' -Actor 'octocat' -Branch 'main' -Event 'push' -Status 'success'
24+
```
2125
2226
Lists all workflow runs for a repository with the specified actor, branch, event, and status.
2327

src/functions/private/Actions/Workflow Run/Get-GitHubWorkflowRunByWorkflow.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@
1313
`created`, `event`, `head_sha`, `status`.
1414
1515
.EXAMPLE
16+
```powershell
1617
Get-GitHubWorkflowRunByWorkflow -Owner 'octocat' -Repository 'Hello-World' -ID '42'
18+
```
1719
1820
Gets all workflow runs for the workflow with the ID `42` in the repository `Hello-World` owned by `octocat`.
1921
2022
.EXAMPLE
23+
```powershell
2124
Get-GitHubWorkflowRunByWorkflow -Owner 'octocat' -Repository 'Hello-World' -ID '42' -Actor 'octocat' -Branch 'main' -Event 'push' -Status 'success'
25+
```
2226
2327
Gets all workflow runs for the workflow with the ID `42` in the repository `Hello-World` owned by `octocat` that were triggered by the user
2428
`octocat` on the branch `main` and have the status `success`.

src/functions/private/Apps/GitHub Apps/Add-GitHubKeyVaultJWTSignature.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
The function supports authentication via Azure CLI or Az PowerShell module and returns the signed JWT as a secure string.
99
1010
.EXAMPLE
11+
```powershell
1112
Add-GitHubKeyVaultJWTSignature -UnsignedJWT 'header.payload' -KeyVaultKeyReference 'https://myvault.vault.azure.net/keys/mykey'
13+
```
1214
1315
Output:
1416
```powershell

src/functions/private/Apps/GitHub Apps/Add-GitHubLocalJWTSignature.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
This function handles the RSA signing process and returns the complete signed JWT.
99
1010
.EXAMPLE
11+
```powershell
1112
Add-GitHubLocalJWTSignature -UnsignedJWT 'eyJ0eXAiOi...' -PrivateKey '--- BEGIN RSA PRIVATE KEY --- ... --- END RSA PRIVATE KEY ---'
13+
```
1214
1315
Adds a signature to the unsigned JWT using the provided private key.
1416

src/functions/private/Apps/GitHub Apps/Get-GitHubAppAsAuthenticatedApp.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
to access this endpoint.
1414
1515
.EXAMPLE
16+
```powershell
1617
Get-GitHubAppAsAuthenticatedApp
18+
```
1719
1820
Get the authenticated app.
1921

0 commit comments

Comments
 (0)