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

fix: do not fail when there are no changed files #101

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

gowoons
Copy link
Contributor

@gowoons gowoons commented Aug 7, 2023

Closes #98

@gowoons gowoons force-pushed the fix/do-not-fail-when-no-file-changes branch from 90111ba to 81097f1 Compare August 7, 2023 11:48
@gowoons gowoons marked this pull request as ready for review August 7, 2023 11:49
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

Risk Level 2 - /home/runner/work/code-review-gpt/code-review-gpt/src/common/git/getFilesWithChanges.ts

The exit(0) command is used to terminate the process. This can be risky as it might terminate the process prematurely, especially if there are other operations that need to be completed. Consider throwing an error or returning a specific value to indicate that no files with changes were found, and handle this case in the calling function. For example:

if (fileNames.length === 0) {
  logger.warn(
    \"No files with changes found, you might need to stage your changes.\"
  );
  throw new Error('No files with changes found');
}

This way, the calling function can decide what to do when no files with changes are found.


🚫💻🔄


Powered by Code Review GPT

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

Test results summary:

✅ [PASS] - Test case: Bad variable name
✅ [PASS] - Test case: Exposed secret
✅ [PASS] - Test case: Too many nested loops
✅ [PASS] - Test case: Unawaited Promise

SUMMARY: ✅ PASS: 4 - ⚠️ WARN: 0 - ❌ FAIL: 0


Tests Powered by Code Review GPT

@gowoons gowoons force-pushed the fix/do-not-fail-when-no-file-changes branch from 0faa536 to 9bb8140 Compare August 7, 2023 11:55
@gowoons gowoons merged commit a731a6c into main Aug 7, 2023
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.

[Bug] AADev I don't have a failure when there is no file to review
2 participants