Description
In discussions with @ian-r-rose we realised that many notebooks have an extra cell at the end of the notebook due to execution with the ↲ command, which automatically creates a new cell.
These cells (being empty) have no effect on the output other than to make it look somewhat sloppy when sharing notebooks.
This seems like a common enough use case that it'd be worthwhile having a configurable option that could just create a presave hook that will remove this cell.
Some complications:
If there were more than one cell my assumption would be that it was intentional and so this removal would not be applied.
One UI concern that we might have with this is the possibility that this cell is actively selected/being edited at the time that save is invoked, in which case this shouldn't be executed. Other than that though it doesn't seem like this would create many issues and would make for nicer default output for many people. Because it would be an opt-in solution and always keeps a valid notebook file; there would be no compatibility worries.
NB: I'll work on this later, this was a sidetrack from something else I was doing and it led me down another rabbit hole related to the documentation I link above. I'm just posting this for my further reference.