Skip to content

Fix directory scanning of batch, fish, and PowerShell module scripts - #18

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
KingEmma7:fix/scan-script-extensions
Sep 10, 2026
Merged

Fix directory scanning of batch, fish, and PowerShell module scripts#18
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
KingEmma7:fix/scan-script-extensions

Conversation

@KingEmma7

Copy link
Copy Markdown
Contributor

Fix directory scanning of batch, fish, and PowerShell module scripts

What does this PR do?

Fixes #15. Directory scans now include .bat, .cmd, .fish, and .psm1 files through the existing extension filter. Previously these files were silently omitted.

Adds a regression covering all four extensions at the root and in a nested directory, in lowercase and uppercase, with existing supported files and unrelated .bin files as controls. It also checks that the newly collected scripts produce findings. Bumps the patch version to 0.1.4 and documents the fix in the changelog.

Checklist

  • Tests pass (node --test)
  • Updated docs / README if behavior changed (documented in README.md and CHANGELOG.md)
  • Added a CHANGELOG.md entry
  • Followed the existing code style

Notes

Prepared with OpenAI Codex assistance, including implementation, regression tests, and this draft.

Validation on macOS (final revision: Node v20.19.5 and v18.18.0):

  • Before the source fix: 14 tests passed and the new regression failed, showing all 16 new-extension variants omitted.
  • After the fix: all 15 tests passed with node --test on Node 20 and Node 18. The earlier revision also passed npm test on Node 24.
  • Clean and malicious fixtures returned exactly 0 and 1 respectively with --fail-on high, for text, JSON, and SARIF output. JSON and SARIF parsed successfully; findings matched clean/flagged expectations.
  • All 16 added-extension variants were also checked through the CLI; JSON and SARIF reported exactly the expected paths.
  • Package dry run contained the expected eight runtime/documentation files and no test or review artifacts.
  • git diff --check passed.

Fixture scripts were read as scanner input, never executed. Node 20 checks ran locally on macOS; GitHub-hosted Linux CI has not run.

@royalpinto007
royalpinto007 merged commit e060334 into AgentPostmortem:main Sep 10, 2026
1 check 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.

collectFiles ignores .bat/.cmd/.fish/.psm1 scripts in directory walks

2 participants