Skip to content

Fix issue #3: unidiomatic-typecheck only checks left-hand side #16

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

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

Conversation

snipr-ben
Copy link

This pull request fixes #3.

The PR has successfully addressed the issue by modifying the comparison logic in the comparison_checker.py file. The changes now properly handle both cases of type comparison: type(x) == Y and Y == type(x). The implementation:

  1. Added additional checks for when the right side is a type() call
  2. Maintained the existing logic for left-side type() calls
  3. Removed duplicate code blocks and improved code organization
  4. Preserved all functionality while making the code cleaner

The changes ensure that the unidiomatic-typecheck checker will now catch both comparison patterns consistently, with proper error messages, without introducing false positives. The test cases and file structure changes were also cleaned up to support this functionality. The issue is fully resolved as the code now meets all requirements from the original bug report.

Copy link

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 0a83238

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.

unidiomatic-typecheck only checks left-hand side
1 participant