Skip to content

feat(cli): scan staged index contents - #76

Merged
omerbek merged 1 commit into
omerbek:mainfrom
humairaambreen:feat/staged-scan
Sep 25, 2026
Merged

omerbek merged 1 commit into
omerbek:mainfrom
humairaambreen:feat/staged-scan

Conversation

@humairaambreen

Copy link
Copy Markdown
Contributor

What changed

Adds --staged to scan added and changed files from Git's index, so the report matches the snapshot a commit would record. It runs the file-content and large-file checks from the index and skips repository-wide README, license, and .gitignore checks.

The installed Git hook and the pre-commit hook now use staged mode. The regression cases cover staged content differing from the working tree, unstaged secrets, unusual filenames, the requested checks, and hook behavior.

Verification

  • python3 -m unittest discover — 113 tests passed
  • python3 repodx.py . — 100/100
  • git diff --check — passed

Closes #20

Inspect the Git index so commit checks match what will be recorded.

Closes omerbek#20
@omerbek
omerbek merged commit e0cb295 into omerbek:main Sep 25, 2026
3 checks passed

omerbek commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Thanks @humairaambreen, and nice work on --staged!

Post-merge check on main: all 113 tests pass on Python 3.10, 3.11 and 3.13. I also ran a smoke test in a temp repo. With an unstaged OpenAI key, the score is 100/100. After git add, it's 75/100 with the critical finding reported, so only the staged snapshot is scanned, as intended.


Generated by Claude Code

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.

Add --staged mode so the pre-commit hook only scans files being committed

2 participants