I know etiquette about editing has been heavily discussed, both on this meta and on StackExchange-meta but I couldn't find an answer for a particular problem.
I found this answer on Unix&Linux. It has been posted by a new user, and in its original non-edited version, it didn't respect formatting rules and cite an external resource without being self-sufficient. So, I posted a comment saying welcome and giving advice on how to improve the answer. And I also edited the answer to make it closer to the quality standards of StackExchange.
And here is my problem. Should we give new authors the opportunity to improve their answer or just do it ourselves? Of course, it seems better to give authors the time to correct themselves but on the other hand, maybe giving an example is not a bad thing to do? And if we "give time", when does it become appropriate to edit instead of letting the author do so?