Skip to content

Commit ddd0864

Browse files
committed
chore: ✨ update configuration and documentation
* Added `"snyk.advanced.autoSelectOrganization": true` to `.vscode/settings.json`. * Improved comments in `Get-Dependency.ps1` for clarity. * Removed unnecessary cspell ignore comments from `about_PSDepend.help.txt` and `README.md`. * Updated `cspell.json` to include new words and removed obsolete entries.
1 parent d8254f5 commit ddd0864

5 files changed

Lines changed: 24 additions & 33 deletions

File tree

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
"**/*.code-search": true,
1717
"**/.ruby-lsp": true,
1818
"Output/**": true
19-
}
20-
}
19+
},
20+
"snyk.advanced.autoSelectOrganization": true
21+
}

PSDepend/Public/Get-Dependency.ps1

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function Get-Dependency {
147147
[hashtable]$Credentials
148148
)
149149

150-
# Helper to pick from global psdependoptions, or return a default
150+
# Helper to pick from global PSDependOptions, or return a default
151151
function Get-GlobalOption {
152152
param(
153153
$Options = $PSDependOptions,
@@ -159,12 +159,10 @@ function Get-Dependency {
159159
$Output = $Default
160160
if ($Prefer) {
161161
$Output = $Prefer
162-
}
163-
else {
162+
} else {
164163
try {
165164
$Output = $Options[$Name]
166-
}
167-
catch {
165+
} catch {
168166
$Output = $Default
169167
}
170168
}
@@ -262,7 +260,7 @@ function Get-Dependency {
262260
elseif ( $DependencyHash -is [string] -and
263261
$Dependency -notmatch '/' -and
264262
(-not $DependencyType -or
265-
$DependencyType -eq 'PSGalleryModule')) {
263+
$DependencyType -eq 'PSGalleryModule')) {
266264
[PSCustomObject]@{
267265
PSTypeName = 'PSDepend.Dependency'
268266
DependencyFile = $DependencyFile
@@ -288,7 +286,7 @@ function Get-Dependency {
288286
$Dependency -match '/' -and
289287
$Dependency.split('/').count -eq 2 -and
290288
(-not $DependencyType -or
291-
$DependencyType -eq 'GitHub')) {
289+
$DependencyType -eq 'GitHub')) {
292290
[PSCustomObject]@{
293291
PSTypeName = 'PSDepend.Dependency'
294292
DependencyFile = $DependencyFile
@@ -312,7 +310,7 @@ function Get-Dependency {
312310
elseif ($DependencyHash -is [string] -and
313311
$Dependency -match '/' -and
314312
(-not $DependencyType -or
315-
$DependencyType -eq 'Git')) {
313+
$DependencyType -eq 'Git')) {
316314
[PSCustomObject]@{
317315
PSTypeName = 'PSDepend.Dependency'
318316
DependencyFile = $DependencyFile
@@ -331,8 +329,7 @@ function Get-Dependency {
331329
PSDependOptions = $PSDependOptions
332330
Raw = $null
333331
}
334-
}
335-
else {
332+
} else {
336333
# Parse dependency hash format
337334
# Default type is module, unless it's in a git-style format
338335
if (-not $DependencyHash.DependencyType) {
@@ -343,10 +340,10 @@ function Get-Dependency {
343340
elseif (
344341
# Ugly right? Watch out for split called on hashtable...
345342
($Dependency -match '/' -and -not $Dependency.Name -and
346-
($Dependency -is [string] -and $Dependency.split('/').count -eq 2)
343+
($Dependency -is [string] -and $Dependency.split('/').count -eq 2)
347344
) -or
348345
($DependencyHash.Name -match '/' -and
349-
($DependencyHash -is [string] -and $DependencyHash.split('/').count -eq 2)
346+
($DependencyHash -is [string] -and $DependencyHash.split('/').count -eq 2)
350347
)
351348
) {
352349
$DependencyType = 'GitHub'
@@ -357,13 +354,11 @@ function Get-Dependency {
357354
$DependencyHash.Name -match '/'
358355
) {
359356
$DependencyType = 'Git'
360-
}
361-
else {
357+
} else {
362358
# finally, psgallerymodule
363359
$DependencyType = 'PSGalleryModule'
364360
}
365-
}
366-
else {
361+
} else {
367362
$DependencyType = $DependencyHash.DependencyType
368363
}
369364

@@ -403,8 +398,7 @@ function Get-Dependency {
403398

404399
if ($Credentials.ContainsKey($Name)) {
405400
$credential = $Credentials[$Name]
406-
}
407-
else {
401+
} else {
408402
Write-Warning "No credential found for the specified name $Name. Was the dependency misconfigured?"
409403
}
410404
}
@@ -419,8 +413,7 @@ function Get-Dependency {
419413

420414
if (Test-Path $DependencyPath -PathType Container) {
421415
$DependencyFiles = @( Resolve-DependScripts -Path $DependencyPath -Recurse $Recurse )
422-
}
423-
else {
416+
} else {
424417
$DependencyFiles = @( $DependencyPath )
425418
}
426419
$DependencyFiles = $DependencyFiles | Select-Object -Unique
@@ -434,8 +427,7 @@ function Get-Dependency {
434427
Parse-Dependency -ParamSet $PSCmdlet.ParameterSetName
435428
}
436429
}
437-
}
438-
elseif ($PSCmdlet.ParameterSetName -eq 'Hashtable') {
430+
} elseif ($PSCmdlet.ParameterSetName -eq 'Hashtable') {
439431
$DependencyFile = 'Hashtable'
440432
$ParsedDependencies = foreach ($InputDependency in $InputObject) {
441433
$Dependencies = $InputDependency.Clone()

PSDepend/en-US/about_PSDepend.help.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
TOPIC
22
about_PSDepend
3-
# cspell:ignore projectx
43

54
SHORT DESCRIPTION
65
PSDepend is a module to simplify dependency handling

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[![CI](https://github.com/PowerShellOrg/PSDepend/actions/workflows/ci.yml/badge.svg)](https://github.com/PowerShellOrg/PSDepend/actions/workflows/ci.yml)
22

3-
<!-- cspell:ignore psdepen -->
4-
53
# PSDepend
64

75
PSDepend is a PowerShell dependency handler. Define your dependencies in a simple `.psd1` file and let `Invoke-PSDepend` install them — similar to `pip install -r requirements.txt` or `bundle install`.

cspell.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@
88
],
99
"words": [
1010
"BHPS",
11-
"Creds",
12-
"Flaticon",
1311
"RSAT",
12+
"choco",
13+
"psake",
14+
"nuget",
15+
"PSDepend"
16+
],
17+
"ignoreWords": [
18+
"Creds",
1419
"ContainsKey",
1520
"Padgett",
1621
"PSGALLERY",
1722
"TARGETDIR",
1823
"addtopath",
1924
"buildhelpers",
20-
"choco",
2125
"dotnetsdk",
2226
"gitbook",
2327
"islatest",
24-
"nuget",
2528
"packagesource",
2629
"proga",
2730
"psdependoptions",
2831
"psdeploy",
2932
"psgallerymodule",
3033
"psgallerynuget",
31-
"psake",
3234
"psresourceget",
3335
"providername",
3436
"ramblingcookiemonster",
@@ -37,6 +39,5 @@
3739
"validatescript",
3840
"whatif"
3941
],
40-
"ignoreWords": [],
4142
"import": []
4243
}

0 commit comments

Comments
 (0)