Drop exists() check paired with is_dir()/is_file()

Proprietary

Drop path.exists() when it is and-ed with is_dir() or is_file() on the same path, which inherently return False for missing paths. Only fires where the receiver's type resolves to pathlib.Path, and leaves a receiver whose evaluation may have side effects, such as a call, alone, as well as a check holding comments.

org.openrewrite.python.cleanup.RemoveRedundantPathExists
mod run . --recipe=org.openrewrite.python.cleanup.RemoveRedundantPathExists

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.