Skip to content

Commit aa7580e

Browse files
⚙️ [Maintenance]: Update super-linter to v8.4.0 (#128)
This pull request primarily updates PowerShell scripts and workflow configuration to improve code consistency and maintainability. The main changes focus on standardizing string casing and operator usage, correcting minor typos, and updating the GitHub Actions linter version. **PowerShell Script Improvements:** * Standardized the use of `-replace` and `-split` operators to lowercase in several scripts. * Updated the conditional operator from `-NotIn` to `-notin` in `Build-PSModuleManifest.ps1` for proper PowerShell syntax. **Typo and Comment Corrections:** * Fixed typos in comments and attribute justifications, such as changing "compatability" to "compatibility" and "doesnt" to "does not" in `Build-PSModuleManifest.ps1` and `Build-PSModuleRootModule.ps1`. **Workflow Configuration Update:** * Updated the linter action in `.github/workflows/Linter.yml` to use `super-linter` version 8.4.0. **Linter Configuration:** * Added `.codespellrc` configuration file for codespell linter.
1 parent 6e52cf7 commit aa7580e

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

.github/linters/.codespellrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[codespell]
2+
skip = ./.github/linters

.github/workflows/Linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
persist-credentials: false
2626

2727
- name: Lint code base
28-
uses: super-linter/super-linter@d5b0a2ab116623730dd094f15ddc1b6b25bf7b99 # v8.3.2
28+
uses: super-linter/super-linter@12562e48d7059cf666c43a4ecb0d3b5a2b31bd9e # v8.4.0
2929
env:
3030
GITHUB_TOKEN: ${{ github.token }}
3131
VALIDATE_BIOME_FORMAT: false

src/helpers/Build/Add-ContentFromItem.ps1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
# Get the path separator for the current OS
2626
$pathSeparator = [System.IO.Path]::DirectorySeparatorChar
2727

28-
$relativeFolderPath = $Path -Replace $RootPath, ''
29-
$relativeFolderPath = $relativeFolderPath -Replace $file.Extension, ''
28+
$relativeFolderPath = $Path -replace $RootPath, ''
29+
$relativeFolderPath = $relativeFolderPath -replace $file.Extension, ''
3030
$relativeFolderPath = $relativeFolderPath.TrimStart($pathSeparator)
31-
$relativeFolderPath = $relativeFolderPath -Split $pathSeparator | ForEach-Object { "[$_]" }
32-
$relativeFolderPath = $relativeFolderPath -Join ' - '
31+
$relativeFolderPath = $relativeFolderPath -split $pathSeparator | ForEach-Object { "[$_]" }
32+
$relativeFolderPath = $relativeFolderPath -join ' - '
3333

3434
Add-Content -Path $RootModuleFilePath -Force -Value @"
3535
#region $relativeFolderPath
@@ -38,11 +38,11 @@ Write-Debug "[`$scriptName] - $relativeFolderPath - Processing folder"
3838

3939
$files = $Path | Get-ChildItem -File -Force -Filter '*.ps1' | Sort-Object -Property FullName
4040
foreach ($file in $files) {
41-
$relativeFilePath = $file.FullName -Replace $RootPath, ''
42-
$relativeFilePath = $relativeFilePath -Replace $file.Extension, ''
41+
$relativeFilePath = $file.FullName -replace $RootPath, ''
42+
$relativeFilePath = $relativeFilePath -replace $file.Extension, ''
4343
$relativeFilePath = $relativeFilePath.TrimStart($pathSeparator)
44-
$relativeFilePath = $relativeFilePath -Split $pathSeparator | ForEach-Object { "[$_]" }
45-
$relativeFilePath = $relativeFilePath -Join ' - '
44+
$relativeFilePath = $relativeFilePath -split $pathSeparator | ForEach-Object { "[$_]" }
45+
$relativeFilePath = $relativeFilePath -join ' - '
4646

4747
Add-Content -Path $RootModuleFilePath -Force -Value @"
4848
#region $relativeFilePath

src/helpers/Build/Build-PSModuleManifest.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

102102
# Get files on module subfolders, excluding the following folders 'init', 'classes', 'public', 'private'
103103
$skipList = @('init', 'classes', 'functions', 'variables')
104-
$ModuleOutputFolder | Get-ChildItem -Directory | Where-Object { $_.Name -NotIn $skipList } |
104+
$ModuleOutputFolder | Get-ChildItem -Directory | Where-Object { $_.Name -notin $skipList } |
105105
Get-ChildItem -Recurse -File -ErrorAction SilentlyContinue | ForEach-Object { $files.Add($_) }
106106

107107
# Get the relative file path and store it in the manifest
@@ -362,7 +362,7 @@
362362
$tags = $PSData.Keys -contains 'Tags' ? ($PSData.Tags).Count -gt 0 ? $PSData.Tags : $repoLabels : $repoLabels
363363
$tags | ForEach-Object { $manifestTags.Add($_) }
364364
'Windows', 'Linux', 'MacOS' | ForEach-Object { $manifestTags.Add($_) }
365-
# Add tags for compatability mode. https://docs.microsoft.com/en-us/powershell/scripting/developer/module/how-to-write-a-powershell-module-manifest?view=powershell-7.1#compatibility-tags
365+
# Add tags for compatibility mode. https://docs.microsoft.com/en-us/powershell/scripting/developer/module/how-to-write-a-powershell-module-manifest?view=powershell-7.1#compatibility-tags
366366
if ($manifest.CompatiblePSEditions -contains 'Desktop') {
367367
if ($manifestTags -notcontains 'PSEdition_Desktop') {
368368
$manifestTags.Add('PSEdition_Desktop')

src/helpers/Build/Build-PSModuleRootModule.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ $MyInvocation.MyCommand.ScriptBlock.Module.OnRemove = {
134134
Add-Content -Path $rootModuleFile -Force -Value @'
135135
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
136136
'PSAvoidAssignmentToAutomaticVariable', 'IsWindows',
137-
Justification = 'IsWindows doesnt exist in PS5.1'
137+
Justification = 'IsWindows does not exist in PS5.1'
138138
)]
139139
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
140140
'PSUseDeclaredVarsMoreThanAssignments', 'IsWindows',
141-
Justification = 'IsWindows doesnt exist in PS5.1'
141+
Justification = 'IsWindows does not exist in PS5.1'
142142
)]
143143
'@
144144

@@ -212,11 +212,11 @@ Write-Debug "[$scriptName] - [data] - Done"
212212
#region - Add content from *.ps1 files on module root
213213
$files = $ModuleOutputFolder | Get-ChildItem -File -Force -Filter '*.ps1' | Sort-Object -Property FullName
214214
foreach ($file in $files) {
215-
$relativePath = $file.FullName -Replace $ModuleOutputFolder, ''
216-
$relativePath = $relativePath -Replace $file.Extension, ''
215+
$relativePath = $file.FullName -replace $ModuleOutputFolder, ''
216+
$relativePath = $relativePath -replace $file.Extension, ''
217217
$relativePath = $relativePath.TrimStart($pathSeparator)
218-
$relativePath = $relativePath -Split $pathSeparator | ForEach-Object { "[$_]" }
219-
$relativePath = $relativePath -Join ' - '
218+
$relativePath = $relativePath -split $pathSeparator | ForEach-Object { "[$_]" }
219+
$relativePath = $relativePath -join ' - '
220220

221221
Add-Content -Path $rootModuleFile -Force -Value @"
222222
#region $relativePath

0 commit comments

Comments
 (0)