Repository navigation
Expand file tree
/
Copy pathPSScriptAnalyzerSettings.psd1
More file actions
62 lines (59 loc) · 2.62 KB
/
Copy pathPSScriptAnalyzerSettings.psd1
File metadata and controls
62 lines (59 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# PSScriptAnalyzerSettings.psd1
# Path: claude-code-config/PSScriptAnalyzerSettings.psd1
#
# PSScriptAnalyzer configuration for the project.
# See: https://github.com/PowerShell/PSScriptAnalyzer
#
# Equivalent of .shellcheckrc for PowerShell scripts.
@{
# Severity levels to report (Error + Warning; skip Information)
Severity = @('Error', 'Warning')
# Rules to exclude (documented false positives for this project type):
#
# PSAvoidUsingWriteHost (includes [Console]::Write/WriteLine):
# This is an interactive TUI setup script with arrow-key menus, cursor
# control, and colored output. [Console]::Write() is the ONLY way to do
# in-place cursor redraws for the TUI. Write-Output would pollute the
# pipeline; Write-Information cannot do cursor positioning.
# See: https://github.com/PowerShell/PSScriptAnalyzer/issues/1118
# https://github.com/PowerShell/PSScriptAnalyzer/issues/267
#
# PSUseShouldProcessForStateChangingFunctions:
# The rule fires purely on verb name (Update-, Set-, New-), not on
# whether the function actually changes system state. Our functions are
# internal helpers called from an interactive TUI that already confirms
# actions. Adding ShouldProcess to every internal helper adds ceremony
# without value.
# See: https://github.com/PowerShell/PSScriptAnalyzer/issues/206
# https://github.com/PowerShell/PSScriptAnalyzer/issues/283
#
ExcludeRules = @(
'PSAvoidUsingWriteHost'
'PSUseShouldProcessForStateChangingFunctions'
)
# setup.ps1 must run under the Windows PowerShell 5.1 a stock Windows opens
# it with, and under PowerShell 7 everywhere. These rules check commands,
# parameters, types and syntax against both, so a 7-only call fails on any OS.
Rules = @{
PSUseCompatibleSyntax = @{
Enable = $true
TargetVersions = @('5.1', '7.0')
}
PSUseCompatibleCommands = @{
Enable = $true
TargetProfiles = @(
'win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework'
'win-4_x64_10.0.18362.0_7.0.0_x64_3.1.2_core'
'ubuntu_x64_18.04_7.0.0_x64_3.1.2_core'
)
}
PSUseCompatibleTypes = @{
Enable = $true
TargetProfiles = @(
'win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework'
'win-4_x64_10.0.18362.0_7.0.0_x64_3.1.2_core'
'ubuntu_x64_18.04_7.0.0_x64_3.1.2_core'
)
}
}
}