Well, I don't know with what criteria those spaces are often put at the end of the lines.
It would be nice to delete them before saving.
Mainly it is due to the version system, which usually detect changes in lines that are the same, except that sooner or later they have those spaces.
Thanks.