Replace `isInfixOf` with proper file path check in `predicate`