Closed adammoody closed 1 year ago
The yapf formatter indents docstrings with 2 spaces, which is a bit ugly. After searching for a config change via yapf, I came across this issue:
yapf
https://github.com/google/yapf/issues/60
which points to docformatter:
docformatter
https://pypi.org/project/docformatter/
So we can run yapf to do most formatting, then follow that with docformatter to clean up the docstrings.
Here are the updated set of commands:
python3 -m venv --system-site-packages env source env/bin/activate pip install --upgrade pip pip install yapf pip install --upgrade docformatter yapf -i python/*.py python/*.py.in yapf -i scripts/python/setup.py find scripts/python/scrjob -regex '.*\.py' -print | xargs yapf -i find scripts/python/scrjob -regex '.*\.py\.in' -print | xargs yapf -i find scripts/python/tests -regex '.*\.py' -print | xargs yapf -i docformatter --in-place python/*.py python/*.py.in docformatter --in-place scripts/python/setup.py find scripts/python/scrjob -regex '.*\.py' -print | xargs docformatter --in-place find scripts/python/scrjob -regex '.*\.py\.in' -print | xargs docformatter --in-place find scripts/python/tests -regex '.*\.py' -print | xargs docformatter --in-place
The
yapf
formatter indents docstrings with 2 spaces, which is a bit ugly. After searching for a config change viayapf
, I came across this issue:https://github.com/google/yapf/issues/60
which points to
docformatter
:https://pypi.org/project/docformatter/
So we can run
yapf
to do most formatting, then follow that withdocformatter
to clean up the docstrings.Here are the updated set of commands: