Bond polarity, as far as I understand, is a measure of the degree to which shared electron density is distorted, and thus solely depends on the electronegativity difference.
Up until now, I had learnt that the dipole moment (charge on each atom x separation) is used as a measure of the polarity. However, for molecules with a formal charge like CO, even though the shared electron density is distorted towards the more electronegative atom, the dipole moment points in the opposite direction. For other molecules like Ozone, even though there is approximately no distortion of bonding electron density, the formal charges alone result in a dipole moment.
For a general molecule, am I supposed to take into account the formal charges for bond and thus molecule polarity, and it it even a measure of degree of distortion/ionic character at that point?