Electron and photon performance measurements with the ATLAS detector using the 2015-2017 LHC proton-proton collision data