Add code auto-formatter

  • Pick out and setup a Python autoformatter, maybe a C++ one as well. I've heard good things about Black.
  • 1. Write sharable editor config for the text editors we use
    • Simple stuff like indentation size, converting tabs to spaces
    • ? Automatically run the auto-formatter on file save
  • 2. Write Git hook to automatically run it or check if it has been run
    • Git hook
    • ? Ask user to review what the formatter did
      • If we don't do this, we should probably have the auto-formatter as a separate commit rather than ammending, so that it is easy to undo it in the very unlikely (hopefully impossible) case that it breaks something
    • If possible automatically set commit name to something consistent like "Run auto-formatter", or ideally ammend the previous commit
  • 3. ? Setup a linter

For Python will probably use Black.

Edited by Jeffrey George Fisher