And you can check the shasum of the binary to see if it actually matches that provided by the developers of the application.
A malicious PKGBUILD, which is what is being talked about, you would see that it downloads a binary that does not come from the developers and so you should not install that.
If the attack happens on the developers repo, not even Linux repository packages would be safe at that point (eg, the xz heist).