Skip to content

Commit

Permalink
remove extra spaces, code block lang style, PS style
Browse files Browse the repository at this point in the history
  • Loading branch information
ArieHein committed Jan 13, 2025
1 parent 8dba7f0 commit e46cd18
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
.PARAMETER BodyText
The raw markdown text to write as a comment on the PR.
.PARAMETER BodyFile
The path to the markdown file to write as a comment on the PR. Due to the way GitHub mistreats
The path to the markdown file to write as a comment on the PR. Due to the way GitHub mistreats
soft line breaks as hard line breaks in comments (unlike files), the markdown in a body file is
converted to HTML when writing the comment. From the user perspective, it's a normal comment.
.EXAMPLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
[PSCustomObject]@{
VersionRelativePath = 'foo.md'
Versions = @(
@{ Version = '1.1'; ChangeType = 'N/A' }
@{ Version = '1.2'; ChangeType = 'unchanged' }
@{ Version = '1.3'; ChangeType = 'modified' }
@{ Version = '1.1'; ChangeType = 'N/A' }
@{ Version = '1.2'; ChangeType = 'unchanged' }
@{ Version = '1.3'; ChangeType = 'modified' }
)
}
[PSCustomObject]@{
Expand All @@ -56,7 +56,7 @@
$Summary.ToString()
```
```output
```Output
| Version-Relative Path | 1.1 | 1.2 | 1.3 |
|:-----------------------------|:----------:|:----------:|:----------:|
| `foo.md` | N/A | Unchanged | Modified |
Expand All @@ -70,11 +70,11 @@
- The file `bar/baz.md` was added in all three versions.
The second command creates a new **StringBuilder** object to write the table to.
The third command uses this cmdlet to write a versioned content summary table to `$Summary`.
Because neither **RelativePathWidth** nor **VersionWidth** were passed to the cmdlet, it
calculates the required column withs dynamically.
calculates the required column widths dynamically.
The final command displays the string the third command has built.
#>
function Add-VersionedContentTable {
Expand All @@ -99,7 +99,7 @@ function Add-VersionedContentTable {
}
}
process {
#region Column Widths
#region Column Widths
if (($RelativePathWidth -eq 0) -and ($VersionWidth -eq 0)) {
$RelativePathWidth, $VersionWidth = Get-VersionedContentTableColumnWidth @WidthParams
} elseif ($RelativePathWidth -eq 0) {
Expand All @@ -109,8 +109,8 @@ function Add-VersionedContentTable {
$WidthParams.Add('Version', $true)
$VersionWidth = Get-VersionedContentTableColumnWidth @WidthParams
}
#endregion ColumnWidths
#region Setup the table header
#endregion Column Widths
#region Setup the table header
$null = $Summary.Append("|$(' Version-Relative Path'.PadRight($RelativePathWidth))")
# Retrieve the list of unique versions
$VersionList = $ChangeSet.Versions.Version | Select-Object -Unique
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Format-ConsoleStyle -Text 'hooray!' -DefinedStyle Success
```
The cmdlet returns the string `hooray!` in bright blue and bolded.
The cmdlet returns the string `hooray!` in bright blue and bolded.
#>
function Format-ConsoleStyle {
[CmdletBinding(DefaultParameterSetName='Components')]
Expand Down Expand Up @@ -67,4 +67,4 @@ function Format-ConsoleStyle {
}

end {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Format-GHAConsoleText -Text $Text
```
```output
```Output
This is a very long string with multiple paragraphs. It will certainly
need to be reflowed in a few different places. It's not always easy to
read long lines like this in the console.
Expand Down Expand Up @@ -95,4 +95,4 @@ function Format-GHAConsoleText {
}

end {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.PARAMETER ParameterHandler
Specify one or more parameter handlers, such as those as kept in an action's `Parameters.psd1`
file. Make sure the hashtable in those data files is converted to a **PSCustomObject**.
Parameter handlers have the following properties:
- **Name:** The name of the _input_ parameter to the action. This is
Expand Down Expand Up @@ -75,7 +75,7 @@ function Get-ActionScriptParameter {
process {
$Stringified = $ScriptBlock.Ast.EndBlock.Extent.Text?.Trim()
# Scriptblocks from data files get wrapped in extra curly braces, preventing them
# from being invokable. Normally just the contents shows up when calling ToString()
# from being invocable. Normally just the contents shows up when calling ToString()
# on a scriptblock, so this is one way to tell.
if ($Stringified -match '^\{') {
$NestedBlock = $ScriptBlock.Ast.FindAll($Predicate, $true)
Expand Down Expand Up @@ -144,4 +144,4 @@ function Get-ActionScriptParameter {
end {
$ActionParameters
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Get-GHAConsoleError {
[parameter(ValueFromPipeline)]
[psobject]$InputObject
)

begin {
$Properties = @(
'FullyQualifiedErrorId'
Expand All @@ -50,10 +50,10 @@ function Get-GHAConsoleError {
'ScriptStackTrace'
)
}

process {
Get-Error @PSBoundParameters | Select-Object -Property $Properties
}

end {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
Get-VersionedContentChangeStatus -ChangedContent $Changes | ConvertTo-Json -Depth 3
```
```output
```Output
[
{
"VersionRelativePath": "Microsoft.PowerShell.Core/About/about_Pwsh.md",
Expand Down Expand Up @@ -123,7 +123,7 @@ function Get-VersionedContentChangeStatus {
break
}
}

if ($AddEntry) {
$VersionedContent += [pscustomobject]@{
VersionRelativePath = $VersionRelativePath
Expand Down Expand Up @@ -191,4 +191,4 @@ function Get-VersionedContentChangeStatus {
}

end {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
[PSCustomObject]@{
VersionRelativePath = 'foo.md'
Versions = @(
@{ Version = '1.1'; ChangeType = 'N/A' }
@{ Version = '1.2'; ChangeType = 'unchanged' }
@{ Version = '1.3'; ChangeType = 'modified' }
@{ Version = '1.1'; ChangeType = 'N/A' }
@{ Version = '1.2'; ChangeType = 'unchanged' }
@{ Version = '1.3'; ChangeType = 'modified' }
)
}
[PSCustomObject]@{
Expand All @@ -60,7 +60,7 @@
"Version Column Width: $VersionWidth"
```
```output
```Output
Relative Path Column Width: 30
Version Column Width: 12
```
Expand All @@ -83,9 +83,9 @@
[PSCustomObject]@{
VersionRelativePath = 'foo.md'
Versions = @(
@{ Version = '1.1'; ChangeType = 'N/A' }
@{ Version = '1.2'; ChangeType = 'unchanged' }
@{ Version = '1.3'; ChangeType = 'modified' }
@{ Version = '1.1'; ChangeType = 'N/A' }
@{ Version = '1.2'; ChangeType = 'unchanged' }
@{ Version = '1.3'; ChangeType = 'modified' }
)
}
[PSCustomObject]@{
Expand All @@ -100,10 +100,10 @@
Get-VersionedContentTableColumnWidth -ChangeSet $ChangeSet -RelativePath -DefaultWidth 5
```
```output
```Output
14
```
The first command constructs an arbitrary changeset.
The second command uses this cmdlet to determine the width of the **RelativePath** column for a
Expand Down Expand Up @@ -141,7 +141,7 @@ function Get-VersionedContentTableColumnWidth {
)

process {
#region RelativePath
#region RelativePath
if ($RelativePath -or !$Version) {
# Set the default width for RelativePath unless specified by user
$RelativePathWidth = ($DefaultWidth -lt 1) ? 30 : $DefaultWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
record so a user can understand what was called when the command failed.
.PARAMETER Intent
Specifies what the `gh` command was supposed to do at a high level. This becomes part of the
expection messge.
exception message.
.PARAMETER ErrorID
Specifies an identifier for the error record.
.EXAMPLE
Expand All @@ -32,10 +32,10 @@
New-CliErrorRecord @ErrorInfo
```
```output
Exception :
```Output
Exception :
Type : System.ApplicationException
TargetSite :
TargetSite :
Name : ThrowTerminatingError
DeclaringType : System.Management.Automation.MshCommandRuntime, System.Management.Automation, Version=7.2.4.500, Culture=neutral, PublicKeyToken=31bf3856ad364e35
MemberType : Method
Expand All @@ -46,11 +46,11 @@
Source : System.Management.Automation
HResult : -2146232832
StackTrace :
StackTrace :
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
CategoryInfo : PermissionDenied: (:String) [Test-Authorization.ps1], ApplicationException
FullyQualifiedErrorId : GHA.NotPermittedToTarget,Test-Authorization.ps1
InvocationInfo :
InvocationInfo :
MyCommand : Test-Authorization.ps1
ScriptLineNumber : 1
OffsetInLine : 1
Expand All @@ -74,7 +74,7 @@ function New-CliErrorRecord {
[string]$Intent,
[string]$ErrorID
)

begin {
$AcceptableErrors = @(
@{
Expand All @@ -83,7 +83,7 @@ function New-CliErrorRecord {
}
)
}

process {
foreach ($AcceptableError in $AcceptableErrors) {
if ($ResultString -match $AcceptableError.Pattern) {
Expand All @@ -104,6 +104,6 @@ function New-CliErrorRecord {
$TargetObject
)
}

end {}
}
}
2 changes: 1 addition & 1 deletion .github/actions/.pwsh/module/gha.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@
} # End of PSData hashtable

} # End of PrivateData hashtable
}
}
2 changes: 1 addition & 1 deletion .github/actions/.pwsh/scripts/Add-Expectations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Ensures all open community PRs have an expectations comment.

### __AllParameterSets (default)

```syntax
```Syntax
.\Add-Expectations.ps1
[-Owner] <string>
[-Repo] <string>
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/.pwsh/scripts/Test-Authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ Accept wildcard characters: False
The **TargetBranch** and **TargetPath** parameters are for convenience; GitHub repositories do not
have a built-in way to define permissions for branches or folders except for branch protection,
which isn't enough for this purpose. To ensure this script is effective, use the **branches**
and **paths** settings in the workflow when defining a **pull_request_target** job trigger.
and **paths** settings in the workflow when defining a **pull_request_target** job trigger.
2 changes: 1 addition & 1 deletion .github/actions/.pwsh/scripts/Test-Checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Inspects Markdown to find checklist items and their status

### __AllParameterSets (Default)

```syntax
```Syntax
.\Test-Checklist.ps1
[-Body] <string>
[[-ReferenceUrl] <string>]
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/.pwsh/scripts/readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Action Scripts

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

| Script | Action |
| :----------------------------------------- | :------------------------------------------------- |
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/reporting/stale-content/v1/Parameters.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
}

# Because DaysUntilStale and StaleSinceDate belong to different
# parameter sets, remove DaysUntilStale before adding StaleSinceDate.
# parameter sets, remove DaysUntilStale before adding StaleSinceDate.
if ($Parameters.ContainsKey('DaysUntilStale')) {
$Message = @(
'Specified both days_until_stale and stale_since_date parameters;'
Expand Down Expand Up @@ -133,7 +133,7 @@
}
Process = {
param($Parameters, $Value, $ErrorTarget)

if ([string]::IsNullOrEmpty($Value)) {
return $Parameters
}
Expand All @@ -142,7 +142,7 @@
$Message = @(
'Specified both export_as_csv and upload_artifact parameters;'
'upload_artifact implies export_as_csv, so you do not need to'
'specify both. The stale content report willbe exported as a'
'specify both. The stale content report will be exported as a'
'CSV and uploaded as an artifact in this action.'
) -join ' '
Write-Warning $Message
Expand Down Expand Up @@ -183,7 +183,7 @@
$Message = @(
'Specified both export_as_csv and upload_artifact parameters;'
'upload_artifact implies export_as_csv, so you do not need to'
'specify both. The stale content report willbe exported as a'
'specify both. The stale content report will be exported as a'
'CSV and uploaded as an artifact in this action.'
) -join ' '
Write-Warning $Message
Expand Down Expand Up @@ -241,4 +241,4 @@
}
}
)
}
}
Loading

0 comments on commit e46cd18

Please sign in to comment.