Skip to content

Commit 4c10a36

Browse files
🩹 [Patch]: Disable PSUseConsistentWhitespace for modules (#38)
## Description - Split PSSA settings for modules and sourcedcode. - Disable PSUseConsistentWhitespace for modules ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 505a310 commit 4c10a36

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

scripts/helpers/Test-PSModule.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ function Test-PSModule {
3939
Start-LogGroup 'Add test - Common - PSScriptAnalyzer'
4040
$containers = @()
4141
$PSSATestsPath = Join-Path -Path $env:GITHUB_ACTION_PATH -ChildPath 'scripts\tests\PSScriptAnalyzer'
42+
$settingsFileName = if ($testModule) { 'Settings.Module.psd1' } else { 'Settings.SourceCode.psd1' }
43+
$settingsFilePath = Join-Path -Path $PSSATestsPath -ChildPath $settingsFileName
4244
$containerParams = @{
4345
Path = Join-Path $PSSATestsPath 'PSScriptAnalyzer.Tests.ps1'
4446
Data = @{
4547
Path = $Path
46-
SettingsFilePath = Join-Path $PSSATestsPath 'PSScriptAnalyzer.Tests.psd1'
48+
SettingsFilePath = $settingsFilePath
4749
Verbose = $true
4850
}
4951
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@{
2+
Rules = @{
3+
PSAlignAssignmentStatement = @{
4+
Enable = $true
5+
CheckHashtable = $true
6+
}
7+
PSAvoidLongLines = @{
8+
Enable = $true
9+
MaximumLineLength = 150
10+
}
11+
PSAvoidSemicolonsAsLineTerminators = @{
12+
Enable = $true
13+
}
14+
PSPlaceCloseBrace = @{
15+
Enable = $true
16+
NewLineAfter = $false
17+
IgnoreOneLineBlock = $true
18+
NoEmptyLineBefore = $false
19+
}
20+
PSPlaceOpenBrace = @{
21+
Enable = $true
22+
OnSameLine = $true
23+
NewLineAfter = $true
24+
IgnoreOneLineBlock = $true
25+
}
26+
PSProvideCommentHelp = @{
27+
Enable = $true
28+
ExportedOnly = $false
29+
BlockComment = $true
30+
VSCodeSnippetCorrection = $false
31+
Placement = 'begin'
32+
}
33+
PSUseConsistentIndentation = @{
34+
Enable = $true
35+
IndentationSize = 4
36+
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
37+
Kind = 'space'
38+
}
39+
PSUseConsistentWhitespace = @{
40+
Enable = $false
41+
}
42+
}
43+
ExcludeRules = @(
44+
'PSAvoidUsingCmdletAliases',
45+
'PSUseToExportFieldsInManifest'
46+
)
47+
}

0 commit comments

Comments
 (0)