Closed aprokop closed 7 years ago
Some context: I am thinking of adding a git hook to call format-cpp with every commit. I don't necessarily want to query the build directory at that point, so I want a standalone formatting script (should work as it does not change often).
Python 3.5.2 (and maybe earlier versions too) has SameFileError
, but Python 2.7 does not. So I'm not sure how to separate the errors.
I think in addition the script needs to add an option to run it only on modified git files as the default runtime for DTK is multiple seconds which is not useful for hooks. I think an option would be to provide the script a list of files to run on. I'm not sure how that would work inside git rebase
though.
Look at clang-format-diff
that comes with ClangFormat. It is written in Python. You can find it in the Docker container:
[container]$ less $(which clang-format-diff-3.9)
At the moment, it fails with
I have the following hack in place
but it probably suppresses other useful
Error
s.