This is required and accepted for congregations by all the four sunni madhhabs as stated by al-Kandahlawi in his commentary on al-Muwatta' - even if I hardly see it in practice in Turkish mosques here in Germany - the basis for this are ahadith such as:
The Prophet (ﷺ) said: Set the rows in order, stand shoulder to shoulder, close the gaps, be pliant in the hands of your brethren, and do not leave openings for the devil. If anyone joins up a row, Allah will join him up, but if anyone breaks a row, Allah will cut him off. (Sunan abi Dawod)
The Prophet (ﷺ) said, "Straighten your rows for I see you from behind my back." Anas added, "Everyone of us used to put his shoulder with the shoulder of his companion and his foot with the foot of his companion." (Sahih al-Bukhari
the Messenger of Allah (ﷺ) paid attention to the people and said three times; straighten your rows (in prayer); by Allah, you must straighten your rows, or Allah will certainly put your faces in contrary directions. I then saw that every person stood in prayer keeping his shoulder close to that of the other, and his knee close to that of the other, and his ankle close to that of the other. (Sunan abi Dawod)
And from the practice of the sahabah as stated:
Uthman ibn Affan used to say in khutbas, and he would seldom omit it if he was giving the khutba, "When the imam stands delivering the khutba on the day of jumua, listen and pay attention, for there is the same portion for someone who pays attention but cannot hear as for someone who pays attention and hears. And when the iqama of the prayer is called, straighten your rows and make your shoulders adjacent to each other, because the straightening of the rows is part of the completion of the prayer." Then he would not say the takbir until some men who had been entrusted with straightening the rows came and told him that they were straight. Then he would say the takbir. (al-Muwatta')
The consensus is to stay shoulder by shoulder and keep the rows straight and complete, and only have the last row incomplete if any. While staying feet by feet isn't (as ibn Hajar explained the correct interpretation of the statement from Sahih al-Bukhari and therefore means doing the highest effort to keep the rows straight).
Some more reference islamqa #21502.