It is not necessary, but would be nice if the script run on python3 as well (as opposed to only python2, which is going to be deprecated https://pythonclock.org/)
Details
Diff Detail
Event Timeline
In python2.7:
TypeError: 'encoding' is an invalid keyword argument for this function
So remove it for now.
Sorry, I'm not familiar with this tool. Could you elaborate:
- why is this switch necessary?
- what's expected to be supported with it?
- how do I test it?
why is this switch necessary?
It is not necessary, but would be nice if the script run on python3 as well (as opposed to only python2, which is going to be deprecated https://pythonclock.org/)
what's expected to be supported with it?
I'd assume python2.7 (which is the only supported python2) and everything from python3.4 and upward.
how do I test it?
The clang-format-diff.py is a wrapper around clang-format, to format only a diff. You can get any diff, e.g. the last ten commits to the master branch:
git diff HEAD~10 -U0 | python2 ./tools/clang-format/clang-format-diff.py
(You might have to pass -p1)
Then test that the following options work with both python2 and python3:
-i -v # flags -regex # could be -regex '.*\.h' -iregex # could be -iregex '.*\.H'
Please always upload all patches with the full context (-U99999)
tools/clang-format/clang-format-diff.py | ||
---|---|---|
1 | Why do you need to *switch* the default? |
tools/clang-format/clang-format-diff.py | ||
---|---|---|
1 | +1: I'm not an expert, but IMO python2.7 is more prevalent. |
Why do you need to *switch* the default?
What's wrong with [at least starting with] just making sure it works with both python 2 and 3?