yapf has very similar command line interface as pyformat but provides one additional one: pass a code via stdin and print result on stdout.
Such a feature makes it very easy for integrating e.g. into vim editor by adding following line into .vimrc file:
autocmd FileType python setlocal equalprg=yapf
and user may format the code of whole file:
or in visual mode (multiple lines selected):
pyformat does not accept file on stdin thus it is not possible to use it in the same style. Adding such feature to pyformat would make use simpler.
yapfhas very similar command line interface aspyformatbut provides one additional one: pass a code via stdin and print result on stdout.Such a feature makes it very easy for integrating e.g. into
vimeditor by adding following line into.vimrcfile:and user may format the code of whole file:
or in visual mode (multiple lines selected):
pyformatdoes not accept file on stdin thus it is not possible to use it in the same style. Adding such feature topyformatwould make use simpler.