Teach them to commit properly:
1. Run an autoformatter on the file
3. Make desired changes
4. Commit again
The same principle applies to refactoring as well, you want to keep your commits 'atomic' aka containing a single unit of work. Autoformatting and changing the code are two separate units.