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

Do notation style #21

Merged
merged 7 commits into from
Apr 1, 2024
Merged

Do notation style #21

merged 7 commits into from
Apr 1, 2024

Conversation

danielSanchezQ
Copy link
Owner

Added a decorator and a operator for using do-notation style of unwraps as per @AlejandroCabeza idea.

@danielSanchezQ danielSanchezQ added the enhancement New feature or request label Mar 28, 2024
@danielSanchezQ danielSanchezQ self-assigned this Mar 28, 2024
@AlejandroCabeza
Copy link
Collaborator

Might be useful to have a full test with early_return and the decorator.

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (0679497) to head (ce8e164).
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #21   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           13        14    +1     
  Lines          962      1014   +52     
=========================================
+ Hits           962      1014   +52     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

:return: Self if self is Some(T) otherwise
:raises: EarlyReturnException(Empty)
"""
...
Copy link
Collaborator

Choose a reason for hiding this comment

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

add pragma no cover

:return: T if self is Ok(T) otherwise
:raises: EarlyReturnException(Err(e))
"""
...
Copy link
Collaborator

Choose a reason for hiding this comment

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

add pragma no cover


def test_early_return():
@early_return
def __test_it() -> Option[str]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would change the __test_it function to accept a parameter and just use the ~parameter and check if it is empty or Some(10) and we get the 100% coverage back again

Copy link
Owner Author

Choose a reason for hiding this comment

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

Just added the pragma to the line that never reaches.

Copy link
Collaborator

@check69 check69 left a comment

Choose a reason for hiding this comment

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

minor things

Copy link
Collaborator

@AlejandroCabeza AlejandroCabeza left a comment

Choose a reason for hiding this comment

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

lgtm

@danielSanchezQ danielSanchezQ merged commit fcace3a into main Apr 1, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants