Skip to content

Commit 3476087

Browse files
authored
remove extra spaces, code block lang style, PS style (#11665)
1 parent befe02a commit 3476087

21 files changed

+74
-74
lines changed

.github/actions/.pwsh/module/functions/api/Add-PullRequestComment.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
.PARAMETER BodyText
1717
The raw markdown text to write as a comment on the PR.
1818
.PARAMETER BodyFile
19-
The path to the markdown file to write as a comment on the PR. Due to the way GitHub mistreats
19+
The path to the markdown file to write as a comment on the PR. Due to the way GitHub mistreats
2020
soft line breaks as hard line breaks in comments (unlike files), the markdown in a body file is
2121
converted to HTML when writing the comment. From the user perspective, it's a normal comment.
2222
.EXAMPLE

.github/actions/.pwsh/module/functions/utility/Add-VersionedContentTable.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
[PSCustomObject]@{
3838
VersionRelativePath = 'foo.md'
3939
Versions = @(
40-
@{ Version = '1.1'; ChangeType = 'N/A' }
41-
@{ Version = '1.2'; ChangeType = 'unchanged' }
42-
@{ Version = '1.3'; ChangeType = 'modified' }
40+
@{ Version = '1.1'; ChangeType = 'N/A' }
41+
@{ Version = '1.2'; ChangeType = 'unchanged' }
42+
@{ Version = '1.3'; ChangeType = 'modified' }
4343
)
4444
}
4545
[PSCustomObject]@{
@@ -56,7 +56,7 @@
5656
$Summary.ToString()
5757
```
5858
59-
```output
59+
```Output
6060
| Version-Relative Path | 1.1 | 1.2 | 1.3 |
6161
|:-----------------------------|:----------:|:----------:|:----------:|
6262
| `foo.md` | N/A | Unchanged | Modified |
@@ -70,11 +70,11 @@
7070
- The file `bar/baz.md` was added in all three versions.
7171
7272
The second command creates a new **StringBuilder** object to write the table to.
73-
73+
7474
The third command uses this cmdlet to write a versioned content summary table to `$Summary`.
7575
Because neither **RelativePathWidth** nor **VersionWidth** were passed to the cmdlet, it
76-
calculates the required column withs dynamically.
77-
76+
calculates the required column widths dynamically.
77+
7878
The final command displays the string the third command has built.
7979
#>
8080
function Add-VersionedContentTable {
@@ -99,7 +99,7 @@ function Add-VersionedContentTable {
9999
}
100100
}
101101
process {
102-
#region Column Widths
102+
#region Column Widths
103103
if (($RelativePathWidth -eq 0) -and ($VersionWidth -eq 0)) {
104104
$RelativePathWidth, $VersionWidth = Get-VersionedContentTableColumnWidth @WidthParams
105105
} elseif ($RelativePathWidth -eq 0) {
@@ -109,8 +109,8 @@ function Add-VersionedContentTable {
109109
$WidthParams.Add('Version', $true)
110110
$VersionWidth = Get-VersionedContentTableColumnWidth @WidthParams
111111
}
112-
#endregion ColumnWidths
113-
#region Setup the table header
112+
#endregion Column Widths
113+
#region Setup the table header
114114
$null = $Summary.Append("|$(' Version-Relative Path'.PadRight($RelativePathWidth))")
115115
# Retrieve the list of unique versions
116116
$VersionList = $ChangeSet.Versions.Version | Select-Object -Unique

.github/actions/.pwsh/module/functions/utility/Format-ConsoleStyle.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Format-ConsoleStyle -Text 'hooray!' -DefinedStyle Success
2828
```
2929
30-
The cmdlet returns the string `hooray!` in bright blue and bolded.
30+
The cmdlet returns the string `hooray!` in bright blue and bolded.
3131
#>
3232
function Format-ConsoleStyle {
3333
[CmdletBinding(DefaultParameterSetName='Components')]
@@ -67,4 +67,4 @@ function Format-ConsoleStyle {
6767
}
6868

6969
end {}
70-
}
70+
}

.github/actions/.pwsh/module/functions/utility/Format-GHAConsoleText.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Format-GHAConsoleText -Text $Text
2323
```
2424
25-
```output
25+
```Output
2626
This is a very long string with multiple paragraphs. It will certainly
2727
need to be reflowed in a few different places. It's not always easy to
2828
read long lines like this in the console.
@@ -95,4 +95,4 @@ function Format-GHAConsoleText {
9595
}
9696

9797
end {}
98-
}
98+
}

.github/actions/.pwsh/module/functions/utility/Get-ActionScriptParameter.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
.PARAMETER ParameterHandler
88
Specify one or more parameter handlers, such as those as kept in an action's `Parameters.psd1`
99
file. Make sure the hashtable in those data files is converted to a **PSCustomObject**.
10-
10+
1111
Parameter handlers have the following properties:
1212
1313
- **Name:** The name of the _input_ parameter to the action. This is
@@ -75,7 +75,7 @@ function Get-ActionScriptParameter {
7575
process {
7676
$Stringified = $ScriptBlock.Ast.EndBlock.Extent.Text?.Trim()
7777
# Scriptblocks from data files get wrapped in extra curly braces, preventing them
78-
# from being invokable. Normally just the contents shows up when calling ToString()
78+
# from being invocable. Normally just the contents shows up when calling ToString()
7979
# on a scriptblock, so this is one way to tell.
8080
if ($Stringified -match '^\{') {
8181
$NestedBlock = $ScriptBlock.Ast.FindAll($Predicate, $true)
@@ -144,4 +144,4 @@ function Get-ActionScriptParameter {
144144
end {
145145
$ActionParameters
146146
}
147-
}
147+
}

.github/actions/.pwsh/module/functions/utility/Get-GHAConsoleError.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Get-GHAConsoleError {
3131
[parameter(ValueFromPipeline)]
3232
[psobject]$InputObject
3333
)
34-
34+
3535
begin {
3636
$Properties = @(
3737
'FullyQualifiedErrorId'
@@ -50,10 +50,10 @@ function Get-GHAConsoleError {
5050
'ScriptStackTrace'
5151
)
5252
}
53-
53+
5454
process {
5555
Get-Error @PSBoundParameters | Select-Object -Property $Properties
5656
}
57-
57+
5858
end {}
59-
}
59+
}

.github/actions/.pwsh/module/functions/utility/Get-VersionedContentChangeStatus.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
Get-VersionedContentChangeStatus -ChangedContent $Changes | ConvertTo-Json -Depth 3
4848
```
4949
50-
```output
50+
```Output
5151
[
5252
{
5353
"VersionRelativePath": "Microsoft.PowerShell.Core/About/about_Pwsh.md",
@@ -123,7 +123,7 @@ function Get-VersionedContentChangeStatus {
123123
break
124124
}
125125
}
126-
126+
127127
if ($AddEntry) {
128128
$VersionedContent += [pscustomobject]@{
129129
VersionRelativePath = $VersionRelativePath
@@ -191,4 +191,4 @@ function Get-VersionedContentChangeStatus {
191191
}
192192

193193
end {}
194-
}
194+
}

.github/actions/.pwsh/module/functions/utility/Get-VersionedContentTableColumnWidth.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
[PSCustomObject]@{
4242
VersionRelativePath = 'foo.md'
4343
Versions = @(
44-
@{ Version = '1.1'; ChangeType = 'N/A' }
45-
@{ Version = '1.2'; ChangeType = 'unchanged' }
46-
@{ Version = '1.3'; ChangeType = 'modified' }
44+
@{ Version = '1.1'; ChangeType = 'N/A' }
45+
@{ Version = '1.2'; ChangeType = 'unchanged' }
46+
@{ Version = '1.3'; ChangeType = 'modified' }
4747
)
4848
}
4949
[PSCustomObject]@{
@@ -60,7 +60,7 @@
6060
"Version Column Width: $VersionWidth"
6161
```
6262
63-
```output
63+
```Output
6464
Relative Path Column Width: 30
6565
Version Column Width: 12
6666
```
@@ -83,9 +83,9 @@
8383
[PSCustomObject]@{
8484
VersionRelativePath = 'foo.md'
8585
Versions = @(
86-
@{ Version = '1.1'; ChangeType = 'N/A' }
87-
@{ Version = '1.2'; ChangeType = 'unchanged' }
88-
@{ Version = '1.3'; ChangeType = 'modified' }
86+
@{ Version = '1.1'; ChangeType = 'N/A' }
87+
@{ Version = '1.2'; ChangeType = 'unchanged' }
88+
@{ Version = '1.3'; ChangeType = 'modified' }
8989
)
9090
}
9191
[PSCustomObject]@{
@@ -100,10 +100,10 @@
100100
Get-VersionedContentTableColumnWidth -ChangeSet $ChangeSet -RelativePath -DefaultWidth 5
101101
```
102102
103-
```output
103+
```Output
104104
14
105105
```
106-
106+
107107
The first command constructs an arbitrary changeset.
108108
109109
The second command uses this cmdlet to determine the width of the **RelativePath** column for a
@@ -141,7 +141,7 @@ function Get-VersionedContentTableColumnWidth {
141141
)
142142

143143
process {
144-
#region RelativePath
144+
#region RelativePath
145145
if ($RelativePath -or !$Version) {
146146
# Set the default width for RelativePath unless specified by user
147147
$RelativePathWidth = ($DefaultWidth -lt 1) ? 30 : $DefaultWidth

.github/actions/.pwsh/module/functions/utility/New-CliErrorRecord.ps1

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
record so a user can understand what was called when the command failed.
1717
.PARAMETER Intent
1818
Specifies what the `gh` command was supposed to do at a high level. This becomes part of the
19-
expection messge.
19+
exception message.
2020
.PARAMETER ErrorID
2121
Specifies an identifier for the error record.
2222
.EXAMPLE
@@ -32,10 +32,10 @@
3232
New-CliErrorRecord @ErrorInfo
3333
```
3434
35-
```output
36-
Exception :
35+
```Output
36+
Exception :
3737
Type : System.ApplicationException
38-
TargetSite :
38+
TargetSite :
3939
Name : ThrowTerminatingError
4040
DeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.2.4.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
4141
MemberType : Method
@@ -46,11 +46,11 @@
4646
4747
Source : System.Management.Automation
4848
HResult : -2146232832
49-
StackTrace :
49+
StackTrace :
5050
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
5151
CategoryInfo : PermissionDenied: (:String) [Test-Authorization.ps1], ApplicationException
5252
FullyQualifiedErrorId : GHA.NotPermittedToTarget,Test-Authorization.ps1
53-
InvocationInfo :
53+
InvocationInfo :
5454
MyCommand : Test-Authorization.ps1
5555
ScriptLineNumber : 1
5656
OffsetInLine : 1
@@ -74,7 +74,7 @@ function New-CliErrorRecord {
7474
[string]$Intent,
7575
[string]$ErrorID
7676
)
77-
77+
7878
begin {
7979
$AcceptableErrors = @(
8080
@{
@@ -83,7 +83,7 @@ function New-CliErrorRecord {
8383
}
8484
)
8585
}
86-
86+
8787
process {
8888
foreach ($AcceptableError in $AcceptableErrors) {
8989
if ($ResultString -match $AcceptableError.Pattern) {
@@ -104,6 +104,6 @@ function New-CliErrorRecord {
104104
$TargetObject
105105
)
106106
}
107-
107+
108108
end {}
109-
}
109+
}

.github/actions/.pwsh/module/gha.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@
101101
} # End of PSData hashtable
102102

103103
} # End of PrivateData hashtable
104-
}
104+
}

.github/actions/.pwsh/scripts/Add-Expectations.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Ensures all open community PRs have an expectations comment.
88

99
### __AllParameterSets (default)
1010

11-
```syntax
11+
```Syntax
1212
.\Add-Expectations.ps1
1313
[-Owner] <string>
1414
[-Repo] <string>

.github/actions/.pwsh/scripts/Test-Authorization.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ Accept wildcard characters: False
178178
The **TargetBranch** and **TargetPath** parameters are for convenience; GitHub repositories do not
179179
have a built-in way to define permissions for branches or folders except for branch protection,
180180
which isn't enough for this purpose. To ensure this script is effective, use the **branches**
181-
and **paths** settings in the workflow when defining a **pull_request_target** job trigger.
181+
and **paths** settings in the workflow when defining a **pull_request_target** job trigger.

.github/actions/.pwsh/scripts/Test-Checklist.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Inspects Markdown to find checklist items and their status
88

99
### __AllParameterSets (Default)
1010

11-
```syntax
11+
```Syntax
1212
.\Test-Checklist.ps1
1313
[-Body] <string>
1414
[[-ReferenceUrl] <string>]

.github/actions/.pwsh/scripts/readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Action Scripts
22

3-
This folder contains the scripts used by the GitHub Actions (GHA). Each script is used by a different
4-
action:
3+
This folder contains the scripts used by the GitHub Actions (GHA). Each script is used by a
4+
different action:
55

66
| Script | Action |
77
| :----------------------------------------- | :------------------------------------------------- |

.github/actions/reporting/stale-content/v1/Parameters.psd1

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
}
106106

107107
# Because DaysUntilStale and StaleSinceDate belong to different
108-
# parameter sets, remove DaysUntilStale before adding StaleSinceDate.
108+
# parameter sets, remove DaysUntilStale before adding StaleSinceDate.
109109
if ($Parameters.ContainsKey('DaysUntilStale')) {
110110
$Message = @(
111111
'Specified both days_until_stale and stale_since_date parameters;'
@@ -133,7 +133,7 @@
133133
}
134134
Process = {
135135
param($Parameters, $Value, $ErrorTarget)
136-
136+
137137
if ([string]::IsNullOrEmpty($Value)) {
138138
return $Parameters
139139
}
@@ -142,7 +142,7 @@
142142
$Message = @(
143143
'Specified both export_as_csv and upload_artifact parameters;'
144144
'upload_artifact implies export_as_csv, so you do not need to'
145-
'specify both. The stale content report willbe exported as a'
145+
'specify both. The stale content report will be exported as a'
146146
'CSV and uploaded as an artifact in this action.'
147147
) -join ' '
148148
Write-Warning $Message
@@ -183,7 +183,7 @@
183183
$Message = @(
184184
'Specified both export_as_csv and upload_artifact parameters;'
185185
'upload_artifact implies export_as_csv, so you do not need to'
186-
'specify both. The stale content report willbe exported as a'
186+
'specify both. The stale content report will be exported as a'
187187
'CSV and uploaded as an artifact in this action.'
188188
) -join ' '
189189
Write-Warning $Message
@@ -241,4 +241,4 @@
241241
}
242242
}
243243
)
244-
}
244+
}

0 commit comments

Comments
 (0)