Files
standards/configs/shell/PSScriptAnalyzerSettings.psd1
james.maesandClaude Fable 5.1 ae174f5495 fix(pr): exempt file-licensed packages, accept the security type, and keep the DCO check robust (#4)
Found while bringing gclo into conformance (KofTwentyTwo/gclo#62).

## What

- `pr.yml`: new `allow-dependencies-licenses` input (package URLs)
passed to `actions/dependency-review-action`, for packages whose nuspec
declares a license *file* (the dependency graph reports `NOASSERTION` /
`LicenseRef-scancode-unknown`). gclo's `LibGit2Sharp`,
`Microsoft.WindowsAppSDK` and `Microsoft.Windows.SDK.BuildTools` fail
`pr / dependency-review` on every change otherwise (see gclo#70).
- `pr.yml`: the title check accepts `security`, which `policies/sdlc.md`
lists as an allowed type; `sdlc.md` gains `style`, which the check
already accepted.
- `pr.yml`: DCO check bug: for a commit whose author email is not linked
to a GitHub account, `.author.login` is null and the TSV field is empty;
bash's tab `IFS` collapses adjacent tabs, the columns shift, and the
check reports "no Signed-off-by" for a commit that has one. The login is
written as `-` now.
- `exceptions/register.md`: EX-0003 (gclo's libgit2
GPL-2.0-with-linking-exception and Windows SDK license terms,
K22-DEP-02) and EX-0004 (gclo's in-repository release workflow until the
shared reusable release workflow exists, K22-CI-30 / K22-REL-04);
EX-0002's "current state" now says gclo ships `SHA256SUMS` and
attestations since v1.0.1-beta.1.
- `configs/shell/PSScriptAnalyzerSettings.psd1`: `CheckOperator` and
`PSAlignAssignmentStatement` contradict each other on every aligned
multi-line hashtable (including this settings file); alignment is the
Kingsrook rule, so `CheckOperator` is off.
- `MAINTAINERS.md`: gclo's adoption status.

## How it was tested

- `actionlint` clean; YAML parses.
- The DCO failure mode and the license failure were both observed on
gclo pull requests today (gclo#68 before the author email was fixed;
gclo#70).
- PSScriptAnalyzer 1.25.0 with the changed settings: gclo's four scripts
report 0 findings; with the original settings the aligned hashtables in
the settings file itself are flagged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: James Maes <james@kof22.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-09 10:55:01 -05:00

57 lines
2.2 KiB
PowerShell

# 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'
}
}
}