8000 python: run docformatter by adammoody · Pull Request #557 · LLNL/scr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

python: run docformatter #557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2023
Merged

python: run docformatter #557

merged 1 commit into from
Oct 20, 2023

Conversation

adammoody
Copy link
Contributor

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:

google/yapf#60

which points to 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

@adammoody adammoody merged commit 5f8a313 into develop Oct 20, 2023
@adammoody adammoody deleted the docformatter branch October 20, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0