Skip to content

Adiabatically turn on `pre-commit`

Javier Duarte requested to merge github/fork/jmduarte/pre-commit into main

Adiabatically turn on pre-commit. The idea is that pre-commit is only run on files touched in a PR. Simultaneously we can open PRs to run pre-commit on files not often updated (or that just aren't touched by any open PRs). Eventually, we can run it on the whole repo.

Changes

  • Add pre-commit config
  • Add clang-format config (@vloncar which style do you prefer? This is basically LLVM style stolen from scikit-hep/boost-historgram)
  • Use p-clang-format to keep pragmas indented at the right level
  • Add pre-commit GitHub action that should only operate on files touched in the PR

Note the con that this may make it harder to review PRs (as a lot of changes will just be style). To be discussed if that's an issue.

To see what it would look like if we ran this on the whole repo in one go, you can check out this branch and do (on Linux):

pre-commit install 
pre-commit run --all-files

I say on Linux, because there seems to be some sed issue with OSX.

Merge request reports

Loading