2021-04-02 19:31:33 +01:00
|
|
|
# autopep8
|
|
|
|
|
|
|
|
> Format Python code according to the PEP 8 style guide.
|
|
|
|
> More information: <https://github.com/hhatto/autopep8>.
|
|
|
|
|
2021-04-10 20:30:31 +01:00
|
|
|
- Format a file to stdout, with a custom maximum line length:
|
2021-04-02 19:31:33 +01:00
|
|
|
|
|
|
|
`autopep8 {{path/to/file.py}} --max-line-length {{length}}`
|
|
|
|
|
|
|
|
- Format a file, displaying a diff of the changes:
|
|
|
|
|
|
|
|
`autopep8 --diff {{path/to/file}}`
|
|
|
|
|
2022-04-25 17:21:44 +01:00
|
|
|
- Format a file in-place and save the changes:
|
2021-04-02 19:31:33 +01:00
|
|
|
|
|
|
|
`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}}`
|