-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Description
Issue Description
Test-DependencyPinning.ps1 defines DependencyViolation and ComplianceReport classes inline within the script (~80 lines). Moving these to a dedicated module would improve reusability, enable unit testing of the classes, and follow the pattern established by FrontmatterValidation.psm1.
Additional Context
Current classes in Test-DependencyPinning.ps1:
DependencyViolation- represents a single pinning violation with file, line, type infoComplianceReport- aggregates violations and generates reports in multiple formats
Recommended approach:
- Create
scripts/security/Modules/SecurityClasses.psm1(mirroring thelinting/Modules/pattern) - Move both class definitions to the new module
- Update
Test-DependencyPinning.ps1to useusing moduleimport
Testing:
- Create unit tests for class methods (e.g.,
ComplianceReport.ToSarif(),ToMarkdown()) - Run
npm run lint:pinningto verify no regression - Run existing Pester tests