[Al- Bukhari and Muslim].
The narration in Muslim is: An-Nu'man bin Bashir (May Allah be pleased with them) said: The Messenger of Allah (ﷺ) directed us to keep our rows as straight as arrows. He continued stressing this until he realized that we had learnt it from him (recognized its significance). One day he came into the mosque and stood up. He was just about to say Takbir (Allah is Greater) when he noticed a man whose chest was projected from the row, so he said, "O slaves of Allah, you must straighten your rows or Allah will certainly put your faces in opposite directions."
وفي رواية لمسلم: أن رسول الله صلى الله عليه وسلم كان يسوي صفوفنا حتى كأنما يسوي بها القداح، حتى رأى أنا قد عقلنا عنه. ثم خرج يومًا فقام حتى كاد يكبر، فرأى رجلا باديا صدره من الصف، فقال "عباد الله لتسون صفوفكم، أو ليخالفن الله بين وجوهكم".
Reference | : Riyad as-Salihin 1089 |
In-book reference | : Book 8, Hadith 99 |