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

Fixed status code 1 issue with backward compatibility #1459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samyakOO7
Copy link
Collaborator

Fixed status code 1 issue while running backward compatibility check when no spec files change is found

Copy link
Member

@harikrishnan83 harikrishnan83 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Can you please look into my comment?

@@ -92,7 +92,10 @@ abstract class BackwardCompatibilityCheckBaseCommand : Callable<Unit> {
).filter {
File(it).exists() && File(it).isValidSpec()
}.toSet().also {
if(it.isEmpty()) exitWithMessage("No specs were changed, skipping the check.")
it.takeIf { it.isEmpty() }?.run {
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, why do we have to switch to takeIf? Can we not make the if(it.isEmpty()) condition body a block body and just put the logger line and exitProcess with 0?

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