Instagram / Fixit

Advanced Python linting framework with auto-fixes and hierarchical configuration that makes it easy to write custom in-repo lint rules.
https://fixit.rtfd.io/en/latest/
Other
666 stars 62 forks source link

fix(compare_singleton_primitives_by_is): compare Name directly instead of QualifiedName #391

Closed llllvvuu closed 10 months ago

llllvvuu commented 12 months ago

Summary

fixes #378 and #375 which are caused by https://github.com/Instagram/LibCST/issues/389.

Qualifying a name will never make something that wasn't already True/False/None into a True/False/None, so it's not necessary.

Test Plan

Added two Valid cases, one of which breaks on HEAD^.

amyreese commented 10 months ago

Thank you!

I modified the fix slightly, so that it still checks for cst.Name, but also still uses the existing set of QualifiedName values.