Skip to content

Respect merged PSM1 formatting scope - #1044

Merged
PrzemyslawKlys merged 1 commit into
mainfrom
fix/merged-formatting-scope
Oct 5, 2026
Merged

PrzemyslawKlys merged 1 commit into
mainfrom
fix/merged-formatting-scope

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

DefaultPSM1 no longer formats a root PSM1 produced by module merging or missing-function inlining. That output uses OnMergePSM1; leaving merge formatting disabled now preserves the merged text and avoids an unrequested formatter pass.

Ordinary staged PSM1 files and project-root files retain their default settings. Explicit merge formatting still takes precedence and runs once. PSD1 selection is unchanged.

This was reproduced while validating the Locksmith2 build upgrade: the wrapper enables DefaultPSM1 but leaves OnMergePSM1 disabled. The correction belongs in the shared pipeline, so no consumer workaround or PSScriptAnalyzer update is required. Consumers need a public PSPublishModule package containing this fix to use it.

Validation: the regression case fails before the change; 28 focused tests pass afterward, including scope selection and existing formatter/merge contracts. Five scope cases also verify settings precedence and preservation of skipped bytes. The native module package builds successfully. Independent read-only review found no actionable defects.

Real before/after builds retain Locksmith's exact merged PSM1 bytes. Locksmith2 retains identical parser tokens after excluding comments, line breaks, continuation markers and end-of-input; both modules import with 1/9 public functions on Core and Desktop. The existing Locksmith2 post-build suite passes 32/32.

Local cached Locksmith2 builds measured 20.89 -> 15.06 seconds and 18.06 -> 12.14 seconds median across two fixed CPU cache domains, with one warmup and three rotated samples per lane/domain using unchanged PSScriptAnalyzer 1.24.0. All 12 measured builds pass artifact validation. An earlier incomplete domain run hit disk exhaustion during an isolated post-build copy; that entire run was excluded and both lanes were rerun after cleanup. These workstation results compare the previous and corrected 3.0 selection logic, and do not establish a general 3.0-versus-2.0 ranking.

@PrzemyslawKlys
PrzemyslawKlys merged commit 8010168 into main Oct 5, 2026
9 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the fix/merged-formatting-scope branch October 5, 2026 12:25
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