CESR-lab / ucla-roms

GNU General Public License v3.0
3 stars 8 forks source link

Use pre-commit to automate formatting / indentation etc. #10

Open TomNicholas opened 3 months ago

TomNicholas commented 3 months ago

There's this really nice tool called pre-commit, which can be used to run little checking programs on your code at the moment you hit git commit. For example, you can configure it to run a little script that would ensure all indentation is consistent.

This can be setup up to run locally or via github on each PR. I use it all the time in python projects, but I need to look and see if similar formatting tools exist for fortran code.

It's likely that the first time we add such a tool it will make a significant number of changes to the existing code, as it tidies up all the inconsistent formatting it finds. But none of these changes would make any functional difference.