Skip to content

feat(cli): add --include-paths for diff-scoped analysis#5

Closed
pratikspatil024 wants to merge 1 commit intomainfrom
psp-include-paths-diff
Closed

feat(cli): add --include-paths for diff-scoped analysis#5
pratikspatil024 wants to merge 1 commit intomainfrom
psp-include-paths-diff

Conversation

@pratikspatil024
Copy link
Copy Markdown
Member

Summary

Added --include-paths to support diff-scoped analysis within specific files or directories.

This lets users combine:

  • --base <branch> to compute the git diff
  • --include-paths <paths> to restrict that diff to a subtree

Example:

diffguard --base develop --include-paths miner/ .

That now analyzes only changed Go files under miner/, including mutation testing, instead of switching into full-file refactoring mode.

Why

--paths currently means "analyze these files/dirs in full and ignore git diff entirely". That makes --paths and --base a confusing combination, especially for users who want "only the diff vs develop, but only under this subtree".

This change separates those two concepts:

  • --paths: full-file refactoring mode
  • --include-paths: diff-mode path filtering

  Introduce a separate path filter for diff mode so analysis can be
  restricted to changed files under specific directories without
  switching to full-file refactoring mode.

  Also reject the ambiguous --paths + --base combination and document
  the new CLI behavior.
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