Skip to content

Survive a single-file PSUseCorrectCasing failure - #21

Merged
thisjustin816 merged 1 commit into
mainfrom
fix/casing-workaround-single-file
Sep 1, 2026
Merged

thisjustin816 merged 1 commit into
mainfrom
fix/casing-workaround-single-file

Conversation

@thisjustin816

@thisjustin816 thisjustin816 commented Sep 1, 2026

Copy link
Copy Markdown
Owner

The casing workaround assumed PSScriptAnalyzer's command-metadata resolution only fails during a recursive multi-file analysis, so it ran the rule per file and let any failure terminate the run. The failure also strikes single files - PSScriptAnalyzer 1.25.0 throws "Unable to cast FunctionMemberAst to FunctionDefinitionAst" on some constructs, reproducibly on one real build script - and one such file killed the entire analysis, reporting nothing for any file. No PSScriptAnalyzer fix to absorb instead: 1.25.0 is current on the gallery.

  • A per-file casing failure is now a warning naming the file and the underlying error; analysis continues, and the recursive pass still covers that file with every rule except casing.
  • The removal note on Invoke-PSModuleAnalyzer no longer claims the upstream bug is recursive-only.
  • New test: one file's casing crash warns, the other file's casing pass and the recursive pass still run.

The casing workaround assumed PSScriptAnalyzer's command-metadata
resolution only fails during a recursive multi-file analysis, so it ran
the rule per file and let any failure terminate the run. The failure also
strikes single files - PSScriptAnalyzer 1.25.0 throws "Unable to cast
FunctionMemberAst to FunctionDefinitionAst" on some constructs,
reproducibly on one real build script - and one such file killed the
entire analysis, reporting nothing for any file. No PSScriptAnalyzer fix
to absorb instead: 1.25.0 is current on the gallery.

- A per-file casing failure is now a warning naming the file and the
  underlying error; analysis continues, and the recursive pass still
  covers that file with every rule except casing.
- The removal note on Invoke-PSModuleAnalyzer no longer claims the
  upstream bug is recursive-only.
- New test: one file's casing crash warns, the other file's casing pass
  and the recursive pass still run.
- ModuleVersion 4.2.1.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Test Results

83 tests  +1   83 ✅ +1   19s ⏱️ -6s
19 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit e9f6de0. ± Comparison against base commit 96a0704.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Summary
Generated on: 9/1/2026 - 5:26:59 PM
Coverage date: 9/1/2026 - 5:25:18 PM
Parser: JaCoCo
Assemblies: 2
Classes: 12
Files: 12
Line coverage: 92.2% (345 of 374)
Covered lines: 345
Uncovered lines: 29
Coverable lines: 374
Total lines: 1206
Covered branches: 0
Total branches: 0
Method coverage: Feature is only available for sponsors
Tag: 115_33537528055

Coverage

src/Private - 96.1%
Name Line Branch
src/Private 96.1% ****
src/Private/Get-PSModuleAnalyzerSettingsPath 100%
src/Private/Get-PSModuleAnalyzerTargetSettings 100%
src/Private/Get-PSModuleGitMetadata 96%
src/Private/Get-PSModulePublishedManifest 100%
src/Private/Invoke-PSModuleAnalyzerCasingWorkaround 94.8%
src/Private/Resolve-PSModuleGitRemote 93.8%
src/Public - 88.4%
Name Line Branch
src/Public 88.4% ****
src/Public/Build-PSModule 77.9%
src/Public/Export-PSModuleAnalyzerSettings 84.2%
src/Public/Invoke-PSModuleAnalyzer 92.8%
src/Public/New-PSModuleManifest 97.6%
src/Public/Publish-PSModule 100%
src/Public/Test-PSModule 100%

@thisjustin816
thisjustin816 merged commit c101207 into main Sep 1, 2026
4 checks passed
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