The Messenger of Allah ﷺ said, "Straighten your rows, for straightening the row is part of the completeness of the prayer."
حدثنا أبو الوليد الطيالسي وسليمان بن حرب قالا حدثنا شعبة عن قتادة
قال رسول الله ﷺ سووا صفوفكم فإن تسوية الصف من تمام الصلاة
Bukhari narrated it in the Book of Adhan, Chapter on Establishing the Row Being Part of the Completeness of Prayer, hadith 723, from Abu Walid Tayalisi, and Muslim narrated it in the Book of Prayer, Chapter on Straightening the Rows and Establishing Them and the Merit of the First Row and Then the Next, and so on, hadith 433, from the hadith of Shubah, with the same chain.