(Imām Bukhārī narrates): Abū al-Walīd narrated to us, he said: Shu'bah narrated to us, from Qatādah, from Anas, may Allāh be pleased with him, from the Prophet ﷺ, he said:
Keep your rows straight, because keeping the rows straight is also part of establishing the prayer.
حَدَّثَنَا أَبُو الْوَلِيدِ، قَالَ حَدَّثَنَا شُعْبَةُ، عَنْ قَتَادَةَ، عَنْ أَنَسٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ " سَوُّوا صُفُوفَكُمْ فَإِنَّ تَسْوِيَةَ الصُّفُوفِ مِنْ إِقَامَةِ الصَّلاَةِ ".
Reference: Sahih Al Bukhari 723