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

Add visit_IfExp and tests #207

Merged
merged 2 commits into from
May 22, 2020
Merged

Conversation

AgathiyanB
Copy link
Contributor

Add 'visit_IfExp' method

Description

Added 'visit_IfExp' method and changed the '_handle_conditional_node' method adding cases for the new method. Tests for the new method have also been added.

Related Issue

#178

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation in the README file.
  • I have updated the documentation accordingly.
  • I have added an entry in CHANGELOG.md.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@coveralls
Copy link

coveralls commented May 21, 2020

Pull Request Test Coverage Report for Build 742

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.009%) to 98.974%

Totals Coverage Status
Change from base Build 740: 0.009%
Covered Lines: 579
Relevant Lines: 585

💛 - Coveralls

@jendrikseipp
Copy link
Owner

Thanks for the PR!

@RJ722 could you review the code, please?

Copy link
Contributor

@RJ722 RJ722 left a comment

Choose a reason for hiding this comment

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

Just a minor nit. Otherwise, it's good to go from my side! Thanks @AgathiyanB!

foo if False else bar
"""
)
check_unreachable(v, 1, 1, "ternary")
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's end with a newline here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've amended the commit and pushed it with the newline a the end of the file now. Will that have amended this PR as well or should this be fine?

Copy link
Contributor

Choose a reason for hiding this comment

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

Working, wonderful!

Copy link
Owner

@jendrikseipp jendrikseipp left a comment

Choose a reason for hiding this comment

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

The code looks great! I only have two minor comments.

CHANGELOG.md Outdated
@@ -1,5 +1,6 @@
# Unreleased

* Detect unreachable code in conditional expressions (#178)
Copy link
Owner

Choose a reason for hiding this comment

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

If you like, please add your name or username inside the brackets and end the sentence with a dot.

v.scan(
"""\
foo if True else bar
"""
Copy link
Owner

Choose a reason for hiding this comment

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

For both new tests, you can use a normal string on a single line (so that each function body uses two lines).

@AgathiyanB
Copy link
Contributor Author

Sorry, there was a merge conflict in CHANGLELOG.md, I think it should be resolved now.

@jendrikseipp jendrikseipp merged commit 7d4b70d into jendrikseipp:master May 22, 2020
@jendrikseipp
Copy link
Owner

Thanks!

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.

None yet

4 participants