Files
qbit-mobile-scanners/scripts/PSScriptAnalyzerSettings.psd1
james.maesandCodex 0b53f342e5 fix(quality): enforce scanner server source standards
Complete copyright and source layout corrections, analyze optional PowerShell tools, add privacy-safe structured failure diagnostics, and close a test-stream ownership gap.

Validation: enabled Checkstyle and clean compilation with 39 server, 6 HTTP demo and 18 optional Record Files cases passing in an isolated coherent API1.10 snapshot. Production and physical acceptance gates remain explicit.

Co-Authored-By: Codex <noreply@openai.com>
2026-11-01 11:21:46 -06:00

60 lines
2.2 KiB
PowerShell

# Copyright (c) 2026 Kingsrook, LLC
# SPDX-License-Identifier: Apache-2.0
# KofTwentyTwo PowerShell analysis (K22-CODE-SH-05). CI runs:
# Invoke-ScriptAnalyzer -Path . -Recurse -Settings ./PSScriptAnalyzerSettings.psd1 -EnableExit
# and `Invoke-Formatter` with the same settings for layout. PowerShell supports the
# Kingsrook layout fully: next-line (Allman) braces and 3-space indentation.
@{
Severity = @('Error', 'Warning', 'Information')
IncludeDefaultRules = $true
ExcludeRules = @()
Rules = @{
PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $false
NewLineAfter = $true
IgnoreOneLineBlock = $true
}
PSPlaceCloseBrace = @{
Enable = $true
NewLineAfter = $true
IgnoreOneLineBlock = $true
NoEmptyLineBefore = $true
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 3
Kind = 'space'
PipelineIndentation = 'IncreaseIndentationForFirstPipeline'
}
PSUseConsistentWhitespace = @{
Enable = $true
CheckInnerBrace = $true
# Kingsrook writes if(...) with no space; the rule cannot require that, so it
# is not checked either way.
CheckOpenParen = $false
CheckOpenBrace = $false
# Kingsrook aligns the `=` of consecutive assignments (PSAlignAssignmentStatement
# below); CheckOperator would then flag every aligned line, so it is off.
CheckOperator = $false
CheckPipe = $true
CheckSeparator = $true
CheckParameter = $true
}
PSAlignAssignmentStatement = @{
Enable = $true
CheckHashtable = $true
}
PSUseCorrectCasing = @{ Enable = $true }
PSAvoidUsingCmdletAliases = @{ Enable = $true }
PSAvoidUsingWriteHost = @{ Enable = $true }
PSProvideCommentHelp = @{
Enable = $true
ExportedOnly = $false
BlockComment = $true
Placement = 'before'
}
}
}