Skip to content

feat(#22): add ability to review local changes without a PR#129

Merged
scastlara merged 1 commit intomainfrom
review-local
Sep 10, 2025
Merged

feat(#22): add ability to review local changes without a PR#129
scastlara merged 1 commit intomainfrom
review-local

Conversation

@scastlara
Copy link
Collaborator

@scastlara scastlara commented Sep 10, 2025

Now you can review local changes just by passing the path to the git repo to lgtm.
You can also choose what to compare against (main, HEAD, any ranges, etc.).

Example:
Screenshot 2025-09-10 at 12 01 39

closes #22

@github-actions github-actions bot added feature and removed feature labels Sep 10, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 10, 2025

Coverage

Coverage for Python 3.12 •
FileStmtsMissCoverMissing
lgtm_ai
   __main__.py135794%53, 179, 329, 350–351, 353–354
   validators.py761086%25, 34, 89, 96–101, 115
lgtm_ai/base
   schemas.py340100% 
lgtm_ai/config
   handler.py198597%126, 223–224, 270–271
lgtm_ai/git
   __init__.py00100% 
   exceptions.py20100% 
   parser.py52296%85–86
   repository.py500100% 
lgtm_ai/git_client
   github.py1652187%45–46, 59–61, 104–105, 109–113, 115, 140–141, 164, 169, 171–172, 177, 210
   gitlab.py1592087%42–44, 63–64, 88–89, 95–96, 112–114, 123–124, 129–131, 210, 243–244
   schemas.py160100% 
   utils.py16568%16–19, 21
lgtm_ai/review
   context.py1051882%65–67, 71, 96, 128–129, 132–133, 144, 147–148, 156–161
   guide.py35197%38
   reviewer.py61493%97–99, 101
TOTAL177013492% 

Tests Skipped Failures Errors Time
222 0 💤 0 ❌ 0 🔥 9.555s ⏱️

@github-actions
Copy link
Contributor

github-actions bot commented Sep 10, 2025

Coverage

Coverage for Python 3.13 •
FileStmtsMissCoverMissing
lgtm_ai
   __main__.py135794%53, 179, 329, 350–351, 353–354
   validators.py761086%25, 34, 89, 96–101, 115
lgtm_ai/base
   schemas.py340100% 
lgtm_ai/config
   handler.py198597%126, 223–224, 270–271
lgtm_ai/git
   __init__.py00100% 
   exceptions.py20100% 
   parser.py52296%85–86
   repository.py500100% 
lgtm_ai/git_client
   github.py1652187%45–46, 59–61, 104–105, 109–113, 115, 140–141, 164, 169, 171–172, 177, 210
   gitlab.py1592087%42–44, 63–64, 88–89, 95–96, 112–114, 123–124, 129–131, 210, 243–244
   schemas.py160100% 
   utils.py16568%16–19, 21
lgtm_ai/review
   context.py1051882%65–67, 71, 96, 128–129, 132–133, 144, 147–148, 156–161
   guide.py35197%38
   reviewer.py61493%97–99, 101
TOTAL177013492% 

Tests Skipped Failures Errors Time
222 0 💤 0 ❌ 0 🔥 8.629s ⏱️

@scastlara
Copy link
Collaborator Author

/lgtm review

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦉 lgtm Review

Score: Needs Work 🔧

🔍 Summary

Overall, this is a great addition; enabling local reviews is a very useful feature. The implementation is well-structured, introducing a new module for local git repository interactions, and the test coverage for the new logic is commendable.

However, there are a couple of issues that need addressing:

  • The guide command doesn't seem to support local repositories, which will lead to a runtime error if a user tries it. This needs to be either fixed or the option disabled for local paths.
  • There is a broken test in tests/git/test_repository.py due to incorrect model instantiation.
  • I also found a small code quality issue with some dead code.

Once these points are fixed, this PR will be in great shape.

More information
  • Id: ab117b5fbdff4fa3a46c537a7f035ab8
  • Model: gemini-2.5-pro
  • Created at: 2025-09-10T10:30:27.057943+00:00
Usage summary
  • Request count: 2
  • Request tokens: 176,319
  • Response tokens: 10,110
  • Total tokens: 186,429

See the 📚 lgtm-ai repository for more information about lgtm.

@scastlara scastlara force-pushed the review-local branch 2 times, most recently from 8bbf62e to 2eec0ef Compare September 10, 2025 10:36
@scastlara scastlara marked this pull request as ready for review September 10, 2025 10:44
@scastlara scastlara merged commit ad021bb into main Sep 10, 2025
7 checks passed
@scastlara scastlara deleted the review-local branch September 13, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code review local changes without a PR

2 participants