Most municipalities in industrialized countries regularly publish water quality tests and reports. Most areas also have independent testing labs that are used by private citizens to test their well water, so you're always free to double-check the official reports.
Rural areas are the ones who often don't. And industrial farming isn't the only way (literal) shit can contaminate your water supply.