Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eklitzke/clang-format-all
Run clang-format -i on all of the files in your C or C++ project
https://github.com/eklitzke/clang-format-all
clang-format
Last synced: 28 days ago
JSON representation
Run clang-format -i on all of the files in your C or C++ project
- Host: GitHub
- URL: https://github.com/eklitzke/clang-format-all
- Owner: eklitzke
- License: gpl-3.0
- Created: 2016-02-27T01:57:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T11:21:37.000Z (8 months ago)
- Last Synced: 2024-08-04T02:09:53.395Z (4 months ago)
- Topics: clang-format
- Language: Shell
- Size: 17.6 KB
- Stars: 148
- Watchers: 4
- Forks: 38
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- AwesomeCppGameDev - clang-format-all - format -i on all of the files in your C or C++ project (C++)
README
# Format All The Things!
This is a bash script that will run `clang-format -i` on your code.
Features:
* Finds the right path to `clang-format` on Ubuntu/Debian, which encode the
LLVM version in the `clang-format` filename
* Fixes files recursively
* Detects the most common file extensions used by C/C++ projectsBasic usage:
clang-format-all src/
Advanced usage:
clang-format-all project1/ project2/ project3/
**Note:** While `clang-format` is a powerful tool for enforcing a consistent
coding standard, you should be aware that different versions of `clang-format`
may format the same code differently. As one example that I know of, in C++ long
vector or set literals (say, a dozen elements or more) in `clang-format` 3.7 are
generally formatted with one entry per line, but under `clang-format` 3.5 the
same literals may be formatted with multiple entries per line if the entries are
short enough. Therefore if multiple people are contributing to the same project,
you should strive to ensure that they're all using the same version of
`clang-format`.