summaryrefslogtreecommitdiff
path: root/other/astyle/README.md
blob: e86cc40fd394ed38afc4d25cd180135654c2ff2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
This directory can house various tools and utilities.

# How to use astyle

## Manually

### For all files

Run from ``toxcore`` directory:
```bash
astyle --options=./other/astyle/astylerc ./toxcore/*.c ./toxcore/*.h ./testing/*.c ./toxav/*.c ./toxav/*.h ./other/*.c ./other/bootstrap_daemon/*.c ./toxencryptsave/*.c ./toxencryptsave/*.h ./auto_tests/*.c
```

### For selected file

Run from ``toxcore`` directory, e.g. for [``tox.h``](/toxcore/tox.h) file:
```bash
astyle --options=./other/astyle/astylerc ./toxcore/tox.h
```


## Automatically, as pre-commit hook (*NIX only)

Copy [``astylerc``](/other/astyle/astylerc) to ``toxcore/.git/hooks``



# Why

``astylerc`` - this file can be used in the pre-commit hook to try its best at making the code conform to the coding style of toxcore.

Furthermore, it is being used to format ``tox.h`` after using ``apidsl`` to generate it.