feat: --diff mode for changed files - #81
Conversation
- Added `output_diff` configuration option (defaults to `llms-diff.txt`). - Implemented `src/llmstxt_gen/diff.py` to get changed files using `git diff --name-only`. - Added `render_diff` in `src/llmstxt_gen/renderer.py` to emit a partial view with a blockquote and no cross-module sections. - Updated `src/llmstxt_gen/writer.py` to support writing the diff output. - Updated `src/llmstxt_gen/cli.py` to include the `--diff` flag in the `generate` command. - Added tests in `tests/test_diff.py`. Note: In the current Typer/Click environment, `--diff` may require an explicit ref (e.g., `--diff HEAD`) as the optional value flag wasn't behaving as expected in tests. Co-authored-by: wuzzzzaah <1645504+wuzzzzaah@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Introduced `output_diff` in `LlmsTxtConfig` (defaulting to `llms-diff.txt`). - Created `src/llmstxt_gen/diff.py` for identifying git-changed files. - Refactored `src/llmstxt_gen/renderer.py` to support partial diff views with appropriate blockquotes. - Updated `src/llmstxt_gen/writer.py` and `src/llmstxt_gen/cli.py` to integrate the `--diff` flag. - Added comprehensive tests in `tests/test_diff.py`. Note: The `--diff` flag requires an explicit git ref argument (e.g., `--diff HEAD`) due to current CLI library constraints regarding optional value flags. Co-authored-by: wuzzzzaah <1645504+wuzzzzaah@users.noreply.github.com>
…045) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
I have implemented the
--diffmode forllmstxt-gen generate.Key changes:
output_difftoLlmsTxtConfiginsrc/llmstxt_gen/config.py.src/llmstxt_gen/diff.pywhich executesgit diff --name-onlyto identify files changed since a given ref. It handles errors if git is missing or the ref is invalid.src/llmstxt_gen/renderer.pyto extract_render_module_detailsand addedrender_diff. The diff output includes the required partial view blockquote and omits global sections like environment variables and dependency graphs.src/llmstxt_gen/writer.pyto write the diff content to the configured file.--diffoption to thegeneratecommand insrc/llmstxt_gen/cli.py. When active, it filters modules to only those changed in git and emits only the diff file.tests/test_diff.pycovering success and error cases for both the git helper and the CLI command.I encountered a minor issue where
typer.Option(flag_value="HEAD")did not allow a bare--diffflag without an argument in the test environment. The implementation currently works correctly when a ref is provided (e.g.,llmstxt-gen generate --diff HEADorllmstxt-gen generate --diff main).Fixes #61
PR created automatically by Jules for task 14303334631618151660 started by @wuzzzzaah