Use pre-commit for formatting
- use
pre-commit
to run formatting checks change C++ formatter to clang-format 16change Python formatter to blackadd flake8 checks and fix the issues
See LHCb!4346 for more context
Note: I discovered that we can use clang-format-8 in pre-commit (it was not possible when I first checked), so I modified this MR to introduce pre-commit in a less intrusive way. We can change the version of clang-format and the Python formatter another time.
Edited by Marco Clemencic