autopep8: add page (#5645)

This commit is contained in:
Florian B
2021-04-02 20:31:33 +02:00
committed by GitHub
parent 80c2d46b46
commit 4a7fab0b97
2 changed files with 40 additions and 0 deletions

20
pages/common/autopep8.md Normal file
View File

@@ -0,0 +1,20 @@
# autopep8
> Format Python code according to the PEP 8 style guide.
> More information: <https://github.com/hhatto/autopep8>.
- Format a file to stdout, with a custom maximium line length:
`autopep8 {{path/to/file.py}} --max-line-length {{length}}`
- Format a file, displaying a diff of the changes:
`autopep8 --diff {{path/to/file}}`
- Format a file in-pace and save the changes:
`autopep8 --in-place {{path/to/file.py}}`
- Recursively format all files in a directory in-place and save changes:
`autopep8 --in-place --recursive {{path/to/directory}}`