autopep8 vs clang-format
autopep8
github.comclang-format
clang.llvm.orgSide by side
| Figure | autopep8 | clang-format |
|---|---|---|
| Price from | — | — |
| Free plan | — | — |
| Free trial | — | — |
| Open source | — | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| API | Yes | — |
| Plans published | 0 | 0 |
| Spec score · Code formatters | 7.6 (#9) | 7.7 (#8) |
| Spec score · Code Formatting Tools | 7.6 (#19) | 7.6 (#20) |
| Configuration | It supports configuration through pyproject.toml, setup.cfg, tox.ini, .pep8, and .flake8 files. | Formatting styles can be set with command-line options or project-level .clang-format or _clang-format files. |
| License | PyPI identifies the project license as MIT License. | LLVM releases are distributed under the Apache-2.0 license with LLVM exceptions, which the download page describes as OSI-approved. |
| Limit | By default, autopep8 makes whitespace changes only; some fixes that can alter code meaning require the `--aggressive` option. | Formatting a line range or byte range can only be used with one input file. |
| Purpose | autopep8 automatically formats Python code to conform to the PEP 8 style guide. | ClangFormat is a set of tools built on LibFormat for formatting source code, available as a standalone tool and through editor integrations. |
In their own words
clang-format
clang-format has no write-up on Specifiction yet; its figures are above.