Combine upper and lower bound checks into a single check

Python pattern

Replaces 2 individual bound checks with a single combined bound check.


Apply with the Grit CLI
grit apply combined_bound_check

Two sided bound checks

BEFORE
if x < 10 and x > 5:
    return "Ok"
elif 100 >= my_var and my_var > -5:
    return None
else:
    return (x < get_strict_max() and get_min() <=  x)
AFTER
if 5 < x < 10:
    return "Ok"
elif -5 < my_var <= 100:
    return None
else:
    return (get_min() <= x < get_strict_max())