Skip to content

Conversation

@garrettdimon
Copy link
Owner

Summary

  • Add git keywords (staged, unstaged, modified, untracked) for targeting files by git status
  • Implement file targeting so tools with files: config receive specific files
  • Fix output dividers and newline consistency

Changes

Git Keywords

  • rvw staged - files staged for commit
  • rvw unstaged - files with unstaged changes
  • rvw modified - all modified files (staged + unstaged)
  • rvw untracked - new files not yet tracked

File Targeting

Tools with files: configuration now receive the file list:

rvw modified rubocop
# Runs: bundle exec rubocop --parallel --color lib/changed.rb test/changed_test.rb

Configured for: rubocop, reek, fasterer

Output Fixes

  • Changed divider character to avoid confusion with test progress dots
  • Ensured consistent newline behavior

Test plan

  • All tests pass (235 tests, 99.38% coverage)
  • Verified end-to-end with rvw modified rubocop
  • Updated CHANGELOG.md

- Change divider character from middot (·) to horizontal line (─)
  to distinguish from test progress dots
- Ensure batch_summary always ends with newline for consistency
  (fixes trailing % in zsh)
Add three new git file keywords that can be used to filter tools
to run on specific sets of changed files:

- unstaged: files with unstaged changes (git diff --name-only)
- modified: all changed files vs HEAD (git diff --name-only HEAD)
- untracked: new files not yet tracked (git ls-files --others)

These follow the existing staged keyword pattern and are recognized
as reserved keywords in the argument parser.
Extract shared behavior into Git::Base class. Each keyword class
now only defines its OPTIONS constant. Consolidate tests into
single file with command verification for each keyword.

Also add keyword methods to Arguments::Files so keywords translate
to file lists (unstaged, modified, untracked).

Note: File lists are collected but not yet passed to tools - that
requires completing the File Targeting feature.

- Reduces ~140 lines to ~53 lines of implementation
- Reduces ~170 lines to ~63 lines of tests
- Adds command string tests to catch OPTIONS typos
Enable tools to receive specific files when Reviewer is invoked with
file arguments or git keywords. Tools with `files:` config in their
settings now append the file list to their review command.

- Add files_flag, files_separator, supports_files? to Tool::Settings
- Add files parameter to Command::String with files_string builder
- Wire up Command#target_files to pass files from arguments
- Add files config to rubocop, reek, and fasterer in .reviewer.yml
@garrettdimon garrettdimon merged commit 20eb638 into main Dec 24, 2025
5 checks passed
@garrettdimon garrettdimon deleted the feature/git-keywords branch December 24, 2025 20:16
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