https://github.com/felixthec/cppff
cpp file formating
https://github.com/felixthec/cppff
Last synced: about 2 months ago
JSON representation
cpp file formating
- Host: GitHub
- URL: https://github.com/felixthec/cppff
- Owner: FelixTheC
- License: apache-2.0
- Created: 2023-08-16T21:19:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-24T06:51:51.000Z (over 1 year ago)
- Last Synced: 2025-02-10T00:44:57.328Z (3 months ago)
- Language: C++
- Size: 200 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cppff
C++ file formatting inspired by some packages for Python## Installation
### Requirements
- [conan > 2.0](https://docs.conan.io/2/tutorial.html) to install the required libraries to run this project.
- CMake >= 3.24
- a compiler with support for C++ 20## Example
### Calling help
```shell
./cppff --helpUsage: cppff [Options]
Options:
--isort [default: 0]
--check [default: 0]
--help Show this message and exit.
```
isort and check are boolean values with a default value `0 = false`### Calling with isort
Imagine your IDE added all dependencies by auto-import in the following order,
or maybe you did it because you added it when the dependency pop-up.
```c++
#include
#include
#include
#include
#include "../include/abc.hpp"
#include "../include/utils.hpp"
#include "utils.hpp"
#include
```
after running `./cppff --isort` the includes will be ordered in the following way
- at first all standard library headers
- all libraries from dependencies or from the same level
- all other files
separated by space
```c++
#include
#include
#include
#include
#include#include "utils.hpp"
#include "../include/abc.hpp"
#include "../include/utils.hpp"
```## Options
- --checkwhen also adding `--check` you will only get an information if the format does not match without touching the original file,
this will be mostly used for CI-Pipelines or in a pre-commit hook- --exclude
ignore multiple file paths separated by `,`
example:
```shell
./cppff --isort --exclude="path/src/abc.cpp,path/include/abc.cpp"
```