The ideal magnetohydrodynamic stability is investigated of localized interchange modes in a large-aspect ratio tokamak plasma. The resulting stability criterion includes the effects of toroidal rotation and rotation shear and contains various well-known limiting cases. The analysis allows for a general adiabatic index, resulting in a stabilizing contribution from the convective effect. A further stabilizing effect from rotation exists when the angular frequency squared decreases radially more rapidly than the density. Flow shear, however, also decreases the stabilizing effect of magnetic shear through the Kelvin-Helmholtz mechanism. Numerical simulations reveal the merits and limitations of the performed local analysis.