Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CM-30526 - Make Git executable optional #230

Merged
merged 9 commits into from
May 28, 2024

Conversation

MarshalX
Copy link
Collaborator

idea: we don't need to work with git in all cases. for example, path scans could be executed without depending on git. git used to get commit history and so on.

how does it work: GitPython on import tries to find and verify git executable installed in the system. it raises an exception if it can't be found. we can catch this exception and provide a fake git provider, which will throw exceptions only on specific function calls instead of on the module import. all type hints from git module are hidden behind TYPE_CHECKING var

also, these exceptions go via our printers and depend on --output format now (json support for IDE plugins)

elsapet
elsapet previously approved these changes May 27, 2024
cycode/cli/utils/git_proxy.py Outdated Show resolved Hide resolved
Co-authored-by: elsapet <[email protected]>
@MarshalX MarshalX requested a review from elsapet May 28, 2024 09:56
elsapet
elsapet previously approved these changes May 28, 2024
@MarshalX MarshalX merged commit e63c1db into main May 28, 2024
24 checks passed
@MarshalX MarshalX deleted the CM-30526-unhandled-error-when-git-is-not-installed branch May 28, 2024 11:10
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.

2 participants