Skip to content

Improve type safety of container_exists #12053

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

Merged
merged 1 commit into from
Dec 25, 2024
Merged

Conversation

martinfrancois
Copy link
Contributor

@martinfrancois martinfrancois commented Dec 18, 2024

Motivation

I added type annotations to the container_exists function to improve type safety, facilitate static type checking, and improve developer experience.

Changes

While the code's external behavior remains unchanged, these changes improve the readability and maintainability of the code.

Copy link
Contributor

@localstack-bot localstack-bot left a comment

Choose a reason for hiding this comment

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

Welcome to LocalStack! Thanks for raising your first Pull Request and landing in your contributions. Our team will reach out with any reviews or feedbacks that we have shortly. We recommend joining our Slack Community and share your PR on the #community channel to share your contributions with us. Please make sure you are following our contributing guidelines and our Code of Conduct.

@localstack-bot
Copy link
Contributor

localstack-bot commented Dec 18, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@martinfrancois
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

localstack-bot added a commit that referenced this pull request Dec 18, 2024
@martinfrancois
Copy link
Contributor Author

I unfortunately can't add a label to the PR, can someone please add the label semver: patch? Thanks in advance!

@martinfrancois martinfrancois changed the title Simplify implementation of container_exists Improve implementation of container_exists Dec 20, 2024
@alexrashed alexrashed added the semver: patch Non-breaking changes which can be included in patch releases label Dec 20, 2024
Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Thanks, @martinfrancois for the contribution!
Additional type hints are always great! But to be honest, I am not sure if your change on the return statement really is more readable. 😄
This is obviously quite subjective, and I'm happy to discuss this further, but I don't really see a reason to explicitly change this line and given that there isn't much else to the PR, I am leaning towards closing this PR...

Copy link
Member

@thrau thrau 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 contribution @martinfrancois! agree with @alexrashed here that i don't think the return condition is more readable than before. but i like that were adding type hints!

@martinfrancois martinfrancois changed the title Improve implementation of container_exists Improve type safety of container_exists Dec 20, 2024
@martinfrancois
Copy link
Contributor Author

martinfrancois commented Dec 20, 2024

Hi, @alexrashed and @thrau; you're welcome; thanks a lot for the review! I understand that the way of writing the return condition is indeed a matter of preference. I now dropped the commit with the change to the return condition and left the one with the type safety improvements :)

Copy link
Member

@thrau thrau 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 including our review :-) type hints are always helpful 👍

@thrau thrau merged commit c9ecef3 into localstack:master Dec 25, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants