This will add a python convenience wrapper for clang-format
. The python code includes a list with tested versions (tested_versions
) which can easily be updated in the future.
[ci skip]
This will add a python convenience wrapper for clang-format
. The python code includes a list with tested versions (tested_versions
) which can easily be updated in the future.
[ci skip]
After looking at the amount of changes clang-format
generates and actually looking at such changes and looking at our release process (releasing 0.10, 0.11, …), I think it doesn’t make sense to apply the formatting in one shot for all the source files.
It only has sense for formatting new files and (maybe) for very stable files, like primites/*
etc.
And as written above, I do not think the wrapper (in fact, -i
and “tested” version check) is needed at all.
@paveljanik I think it doesn’t make sense to apply the formatting in one shot for all the source files.
I think we all agree on this.
@paveljanik I do not think the […] “tested” version check is needed at all.
How would one verify a format PR when different versions produce different output? Also, it may be useful the extend the clang-format.py
to skip git subtrees et al. (c.f. https://github.com/sipa/bitcoin/commit/a1261296e48967b3236053d3435a3f521898df2f#diff-6ca10bb3f43dbe234b1fce27929ce0d4R10 ).
Code review ACK, although I’m not sure I see when this should be used.
Needs mention in contrib/devtools/README.md
I wonder whether a solution could be to include a small snippet of representative unformatted code, and have the wrapper script check whether it results in the expected output?
I like this idea a lot.