yapf-diff (similar to clang-format-diff) ?
See original GitHub issueI am using clang-format a lot. And it’s very convenient to do so via clang-format-diff script (quick description from https://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py):
ClangFormat Diff Reformatter
============================
This script reads input from a unified diff and reformats all the changed
lines. This is useful to reformat all the lines touched by a specific patch.
Example usage for git/svn users:
git diff -U0 HEAD^ | clang-format-diff.py -p1 -i
svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
It would great to have similar script for yapf. Looks like currently yapf doesn’t have this mode available.
Do you have plans on supporting this?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Code style conventions - Psi4
It is important to keep a consistent formatting of the C++ and Python code to avoid hard-to-read diffs and merge conflicts. clang-format and...
Read more >README.rst - platform/external/yapf - android Git repositories
YAPF takes a different approach. It's based off of 'clang-format', developed by. Daniel Jasper. ... The idea is also similar to the 'gofmt'...
Read more >Open3D style guide — Open3D 0.13.0 documentation
Open3D's CI checks for code formatting based on the style specified in .clang-format for C++ files and .style.yapf for Python files. Please build...
Read more >yapf · PyPI
YAPF takes a different approach. It's based off of 'clang-format', developed by Daniel Jasper. In essence, the algorithm takes the code and reformats...
Read more >File: productivity.md | Debian Sources
To get the most out of ccache, put something like this in `~/.ccache/ccache.conf`: ... Format Python diffs with `yapf-diff.py` Usage is exactly the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I modified the
clang-format-diff.py
to work withyapf
and Python 3: https://gist.github.com/mwek/59aefeefc812dea39c93c068eb30b491Feel free to add this to the repo.
The above now has an apache-2 licence.