Skip to content

Commit 65435d2

Browse files
Update .psscriptanalyzer.psd1
Signed-off-by: LUIZ HAMILTON ROBERTO DA SILVA <[email protected]>
1 parent df17ce2 commit 65435d2

1 file changed

Lines changed: 48 additions & 31 deletions

File tree

.psscriptanalyzer.psd1

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,64 @@
1-
# .psscriptanalyzer.psd1
21
@{
3-
# Reduce noise: only show Error + Warning by default
4-
IncludeDefaultRules = $true
5-
Severity = @('Error','Warning')
2+
# Goal: high-signal findings only (quality/security). No style noise.
3+
# This settings file is intended for "report-only" CI runs.
64

7-
# Focused include list: high-signal rules
5+
# Do NOT include the full default ruleset (too noisy for large repos)
6+
IncludeDefaultRules = $false
7+
8+
# Only report these severities
9+
Severity = @('Error','Warning')
10+
11+
# Curated high-signal rules (quality/security)
812
IncludeRules = @(
13+
# Security / execution safety
914
'PSAvoidUsingInvokeExpression',
15+
16+
# Reliability / observability
1017
'PSAvoidUsingEmptyCatchBlock',
11-
'PSAvoidGlobalVars',
12-
'PSUseShouldProcessForStateChangingFunctions',
18+
19+
# Professional output (avoid Write-Host in tooling)
1320
'PSAvoidUsingWriteHost',
21+
22+
# Maintainability / correctness
1423
'PSAvoidUsingCmdletAliases',
15-
'PSUseConsistentIndentation',
16-
'PSUseConsistentWhitespace'
24+
25+
# Safety for state-changing functions (WhatIf/Confirm)
26+
'PSUseShouldProcessForStateChangingFunctions'
1727
)
1828

1929
Rules = @{
20-
# --- High-signal rules kept as Warning/Error (default severities) ---
21-
PSAvoidUsingInvokeExpression = @{ Enable = $true }
22-
PSAvoidUsingEmptyCatchBlock = @{ Enable = $true }
23-
PSAvoidGlobalVars = @{ Enable = $true }
24-
PSUseShouldProcessForStateChangingFunctions = @{ Enable = $true }
25-
PSAvoidUsingWriteHost = @{ Enable = $true }
26-
PSAvoidUsingCmdletAliases = @{ Enable = $true }
27-
28-
# --- Style rules: keep enabled but downgrade to Information (noise control) ---
29-
PSUseConsistentIndentation = @{
30-
Enable = $true
31-
Severity = 'Information'
32-
Kind = 'space'
33-
IndentationSize = 4
34-
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
30+
PSAvoidUsingInvokeExpression = @{
31+
Enable = $true
32+
}
33+
34+
PSAvoidUsingEmptyCatchBlock = @{
35+
Enable = $true
36+
}
37+
38+
PSAvoidUsingWriteHost = @{
39+
Enable = $true
40+
}
41+
42+
PSAvoidUsingCmdletAliases = @{
43+
Enable = $true
44+
}
45+
46+
PSUseShouldProcessForStateChangingFunctions = @{
47+
Enable = $true
3548
}
3649

50+
# Explicitly disable style rules (noise)
3751
PSUseConsistentWhitespace = @{
38-
Enable = $true
39-
Severity = 'Information'
40-
CheckInnerBrace = $true
41-
CheckOpenBrace = $true
42-
CheckOpenParen = $true
43-
CheckOperator = $true
44-
CheckSeparator = $true
52+
Enable = $false
53+
}
54+
55+
PSUseConsistentIndentation = @{
56+
Enable = $false
57+
}
58+
59+
# Explicitly disable common GUI/script-state noise (optional but recommended for your goal)
60+
PSAvoidGlobalVars = @{
61+
Enable = $false
4562
}
4663
}
4764
}

0 commit comments

Comments
 (0)