Skip to content

fix(ci): the PowerShell gate arrives with its sweep, 51 findings to zero - #973

Merged
David-Noble-at-work merged 2 commits into
developfrom
fix/964-ci-lints-neither-markdown
Sep 28, 2026
Merged

David-Noble-at-work merged 2 commits into
developfrom
fix/964-ci-lints-neither-markdown

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Phase 2 of #964. Does not close it -- phases 3 and 4 are lanes 9 and 10 of
noblefactor-ops#232 and land separately.

install.ps1 ships to users and was checked by nothing, while noblefactor-ops has had this gate since
its #218 and personal since its #216. 51 findings to zero.

The count was 51, not 33

The issue says install.ps1 carries 33 findings. That was PSScriptAnalyzer's half. Measured with
Test-PowerShell.ps1, the gate CI actually runs:

Count Rule Source
30 PSAvoidUsingWriteHost analyzer
9 function has no [CmdletBinding()] the gate's own check
4 function has no param() block the gate's own check
3 missing #!/usr/bin/env pwsh the gate's own check
2 script has no param() block the gate's own check
1 each PSReviewUnusedParameter, PSUseBOMForUnicodeEncodedFile, PSUseSingularNouns analyzer

The gate's four own checks are 18 of the 51. Measuring a gate with a different tool than the one that
will run it is how it turns out to cost more than it was scoped for.

The gate is three steps of quality-gate, not a job of its own

The plan said "a PowerShell job on ubuntu-latest, modeled on noblefactor-ops's." That was wrong for
this repository, and the plan records the correction rather than rewording the box.

This repository's ruleset requires exactly one check, quality-gate. A separate job could not block
a merge whatever it reported -- which ci.yaml already says of the test job beside it:

A gate nobody has watched refuse anything is a claim, not a gate.

personal#216 could use a separate job because that repository's ruleset admits one.

Test-PowerShell.ps1 and PSScriptAnalyzerSettings.psd1 are the organization's, so the script runs out
of a pinned .base checkout rather than being copied here, and the rule set cannot drift between the
three repositories.

This run is the gate's own proof. CI has never linted PowerShell here. If the .base arrangement or
the file discovery is wrong, it fails in this run rather than passing silently.

install.ps1

The 30 Write-Host calls go to the streams PowerShell already has -- Write-Information for
progress, Write-Warning for warnings, Write-Error for failures. Write-Host went to none of them
and cannot be captured, so a user whose install failed could not pipe the run to a file or paste a log,
which for an installer run under irm | iex is exactly when a log matters. Separate streams also let a
caller silence warnings and keep progress, which one stream carrying text prefixes cannot offer.

Write-Fatal keeps its exit 1, deliberately. The script sets $ErrorActionPreference = 'Stop',
under which a bare Write-Error throws and that exit never runs -- which would change how the installer
terminates, and how it terminates is #965, another lane's work. -ErrorAction Continue puts the
message on the error stream and leaves the exit path exactly as it found it.

The color is not replaced. $PSStyle is PowerShell 7.2 and later, and this script must run on
Windows PowerShell 5.1 -- what a fresh Windows machine has, which is why #948 landed it. ANSI is not
reliable there either. Write-Warning and Write-Error label their own output, so info: and
success: are the only prefixes left.

The rest: nine functions gain [CmdletBinding()], four gain param(), and three gain [OutputType]
because promoting a function to advanced brings PSUseOutputTypeCorrectly with it. Get-ApiHeaders
becomes Get-ApiHeader with its call sites. An em dash in a comment goes, rather than the byte-order
mark the rule would otherwise want and which #209 forbids.

-Prefix is suppressed, not deleted. It is read by Main -- defaulted to ~/.local, made the bin
directory, passed to self install -- across a dynamic-scope boundary the analyzer cannot see. Deleting
it would have silently dropped a documented flag.

The two test fixtures are fixed, not excluded

Ruled 2026-09-28: everything is linted, always, no exception without a compelling argument. The
argument that a fixture represents content we do not control, and stops doing so in house style, was
weighed and is not compelling enough to cut a hole in the gate. Both keep doing their job -- the
layer-journey and migrate suites pass unchanged -- and the migrate fixture says in its own comment that
it stands for what a user migrates from.

What this unblocks

devlore-cli#949's lanes 11 and 21 -- #950 and #965 -- both edit install.ps1 and are held for this
work. Its lane 13 waits on lane 11. Once this merges they are free, and install.ps1 is gated, so
whatever they add to it has to keep it clean.

Time

Marker UTC Elapsed
opened (first commit) 2026-09-28T21:37:37Z —
submitted (PR opened) 2026-09-28T21:58:07Z 0.3 h after opened
merged 2026-09-28T22:10:37Z 0.2 h after submitted; 0.6 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

The plan for #964, committed before the work, and the #721 charter's retired status word with it.

ci.yaml runs make vet-all, star lint go, make lint-all and star lint shell. It never runs
star lint all, markdown, go-style or copyright, and it has no PowerShell step although install.ps1
ships to users. make check runs none of them.

The count is 51, not the 33 the issue states. Measured with Test-PowerShell.ps1, the gate CI would
actually run rather than PSScriptAnalyzer alone: 30 PSAvoidUsingWriteHost, 9 missing
[CmdletBinding()], 4 missing param(), 3 missing shebang, 2 script-level param(), and one each of
PSReviewUnusedParameter, PSUseBOMForUnicodeEncodedFile and PSUseSingularNouns. Four of those checks
are the gate's own and account for 18 of the 51.

Three pull requests, one plan, because the pieces have different blockers. The PowerShell gate and
install.ps1 go first: devlore-cli#949's lanes 11 and 21 both edit install.ps1 and are held for it.

Starlark is not buildifier's to cover. Ruled 2026-09-28: buildifier is being replaced, and #721 is
the replacement. Every defect that shipped in the docker package was syntactically valid Starlark
that buildifier parses without complaint.

Markdown is measured and the answer is that there is no policy to measure against: 36,857 findings
over 464 files, 25,318 of them line-length, against markdownlint's defaults, because no
configuration exists anywhere. Phase 3 writes one in the base layer.

lint-starlark.md restated its status in the body as `charter`, which is not one of the five and was
retired by noblefactor-ops#219. A status in two places is a second copy that drifts, so the body no
longer carries one.
install.ps1 ships to users and was checked by nothing, while noblefactor-ops has had this gate since
its #218 and personal since its #216. Phase 2 of #964.

The gate runs as three steps of quality-gate, not as a job of its own. This repository's ruleset
requires exactly one check, quality-gate, so a separate job could not block a merge whatever it
reported -- which ci.yaml already says of the test job beside it: "A gate nobody has watched refuse
anything is a claim, not a gate." personal#216 could use a separate job because that repository's
ruleset admits one.

Test-PowerShell.ps1 and PSScriptAnalyzerSettings.psd1 are the organization's, so the script runs out
of a pinned .base checkout rather than being copied here, and the rule set cannot drift between the
three repositories.

install.ps1, 47 findings:

  - 30 Write-Host calls go to the stream PowerShell already has for each level: Write-Information
    for progress, Write-Warning for warnings, Write-Error for failures. Write-Host went to none of
    them and cannot be captured, so a user whose install failed could not pipe the run to a file or
    paste a log -- which for an installer run under irm | iex is exactly when a log matters.
    Separate streams also let a caller silence warnings and keep progress, which one stream carrying
    text prefixes cannot offer.
  - Write-Fatal keeps its exit 1 and uses -ErrorAction Continue to do so. The script sets
    $ErrorActionPreference = Stop, under which a bare Write-Error throws and the exit never runs --
    which would change how the installer terminates, and that is #965, another lane's work. This
    commit puts the message on the error stream and leaves the exit path as it found it.
  - The color is not replaced. $PSStyle is 7.2 and later and this script must run on Windows
    PowerShell 5.1, what a fresh Windows machine has (#948). Write-Warning and Write-Error label
    their own output, so info: and success: are the only prefixes left.
  - Nine functions gain [CmdletBinding()], four gain param(), and three gain [OutputType] because
    promoting a function to advanced brings PSUseOutputTypeCorrectly with it.
  - Get-ApiHeaders becomes Get-ApiHeader, with its call sites.
  - An em dash in a comment goes rather than the byte-order mark PSUseBOMForUnicodeEncodedFile would
    otherwise want, which #209 forbids.
  - Prefix is suppressed, not deleted. It is read by Main -- defaulted to ~/.local, made the bin
    directory, passed to self install -- across a dynamic-scope boundary the analyzer cannot see.
    Deleting it would silently drop a documented flag.

The two .ps1 test fixtures are fixed rather than excluded. Ruled 2026-09-28: everything is linted,
always, no exception without a compelling argument. Both keep doing their job -- the layer-journey
and migrate suites pass unchanged.

The gate reports 3 checked, 0 with findings.
@David-Noble-at-work
David-Noble-at-work merged commit 0cf3041 into develop Sep 28, 2026
13 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/964-ci-lints-neither-markdown branch September 28, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant