I'm using source code formatter with format editor on file save is checked. It works really well when formatting C/C++ source code. But, it should not format a file that is not C/C++ source code.
format editor on file save
Source code formatter: auto format only know file types.