feat(review): support --include-dirty flag to audit uncommitted changes#80
Open
AsishKumarDalal wants to merge 2 commits into
Open
feat(review): support --include-dirty flag to audit uncommitted changes#80AsishKumarDalal wants to merge 2 commits into
AsishKumarDalal wants to merge 2 commits into
Conversation
…mands Adds a new --include-dirty flag to the `review`, `ci`, and `revalidate` commands that allows auditing uncommitted (staged, unstaged, and untracked) files in the working tree without requiring a commit. Changes: - src/git.ts: adds dirtyFiles(root) that runs `git status --porcelain=v1 -z --untracked-files=all` and parses the NUL-delimited output, correctly handling rename/copy two-path entries. - src/selection.ts: expands limitFeatures to treat --include-dirty like --since — lifting the default 1-feature cap so all touched features are processed. - src/cli.ts: registers include-dirty as a boolean flag; adds it to the commandFlags allow-list for review, ci, and revalidate; documents it in the per-command help text. - src/app.ts: filterFeaturesByFilesSince and filterFindingsByOwnedFilesSince now union changedFilesSince and dirtyFiles into a single Set, so --since and --include-dirty can be combined freely. reviewFlagSubset propagates includeDirty to the inner review call made by ci. - src/workflow.test.ts: three new integration tests covering dirty-only selection, the --since ∪ --include-dirty union, and the CLI entrypoint path. Closes: N/A
… help text for review/ci/revalidate; extend app.ts filter functions and reviewFlagSubset; add three workflow tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This Pull Request implements the
--include-dirtyflag forreview,ci, andrevalidatecommands to allow auditing uncommitted (staged, unstaged, and untracked) files directly from the working tree without requiring them to be committed first.Key Changes
src/git.ts: IntroduceddirtyFiles(root: string): Promise<Set<string>>that executesgit status --porcelain=v1 -z --untracked-files=alland robustly parses the NUL-terminated output, safely handling rename (R) and copy (C) actions with secondary target paths.src/selection.ts: UpdatedlimitFeaturesto lift the default single-candidate constraint when--include-dirtyis provided, similar to the behavior when--sinceis provided.src/cli.ts: RegisteredincludeDirtyas a registered boolean command flag and exposed it in the help text and argument parsing limits forreview,ci, andrevalidate.src/app.ts: UpdatedfilterFeaturesByFilesSinceandfilterFindingsByOwnedFilesSinceto compute the union of changed files (obtained from--sincegit differences) and dirty files (from--include-dirtyunstaged worktree) so they can be seamlessly combined. ExtendedreviewFlagSubsetto propagateincludeDirtyfrom CI runs to the nested review step.src/workflow.test.ts: Added three integration tests to cover:--sinceand--include-dirtyare both supplied.--include-dirty.Validation
git diff --checkpnpm format:checkpnpm typecheckpnpm lintpnpm test(All tests passing)pnpm build