-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPSScriptAnalyzerSettings.psd1
More file actions
59 lines (51 loc) · 2.88 KB
/
Copy pathPSScriptAnalyzerSettings.psd1
File metadata and controls
59 lines (51 loc) · 2.88 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
<#
PSScriptAnalyzer configuration for AppxBackup.
The intent is a gate that is worth keeping green. Rules are excluded only where
they are inapplicable to this project by design, and each exclusion carries the
reason. Anything not listed here is expected to pass, so a new finding means a
real problem rather than known noise.
Run via: .\build.ps1 -Task Analyze
#>
@{
IncludeDefaultRules = $true
ExcludeRules = @(
# This module is an interactive operator tool: it reports staged progress,
# colour-coded status and post-failure guidance straight to the console.
# Since PowerShell 5 Write-Host writes to the information stream, so the
# output is still redirectable and capturable via 6>. Rewriting ~350 call
# sites would change the user-facing presentation without making the module
# more correct. Values that callers consume are returned as objects; only
# presentation goes through Write-Host.
'PSAvoidUsingWriteHost'
# Export-AppxDependencies is an exported command and part of the published
# contract, and Resolve-AppxDependencies / Test-AppxPackagingPrerequisites
# are its internal counterparts. Renaming the public command to satisfy a
# naming rule would break every existing caller for no functional gain; the
# private names are kept aligned with it deliberately.
'PSUseSingularNouns'
# Flagged only on private helpers (New-AppxPackageInternal,
# New-AppxBackupZipArchive, New-AppxBackupManifest, Remove-AppxItemWithRetry
# and friends). Confirmation is handled once, at the public entry point that
# the user actually invokes; adding SupportsShouldProcess to internal helpers
# would prompt repeatedly for a single logical operation.
'PSUseShouldProcessForStateChangingFunctions'
# Formatting only, and present on roughly 830 lines of the existing sources.
# See the note below on why this gate stays scoped to correctness.
'PSAvoidTrailingWhitespace'
)
Rules = @{
# The module targets PowerShell 7.4+ on Windows, as declared in the manifest.
PSUseCompatibleSyntax = @{
Enable = $true
TargetVersions = @('7.0')
}
}
# Deliberately NOT enabled: PSPlaceOpenBrace, PSPlaceCloseBrace,
# PSUseConsistentIndentation, PSUseConsistentWhitespace and
# PSAvoidTrailingWhitespace. Turning them on reports over 1600 findings against
# the existing sources. Satisfying them means reformatting the whole codebase,
# which would produce a diff large enough to hide real changes in history and in
# review for no correctness benefit. This gate is scoped to correctness rules so
# that a finding is always worth acting on. Formatting is better addressed as a
# deliberate one-off pass with Invoke-Formatter if the project wants it.
}