build: add formatting targets for c and lua files (#19488)

The targets will only format files that have been changed in current
branch compared to the master branch. This includes unstaged, staged and
committed files.

Add following make and cmake targets:
formatc   - format changed c files
formatlua - format changed lua files
format    - run formatc and formatlua

Remove scripts/uncrustify.sh as this deprecates it.
This commit is contained in:
dundargoc
2022-08-02 12:32:57 +02:00
committed by GitHub
parent c223875a65
commit 8ce7e7409f
6 changed files with 95 additions and 15 deletions

View File

@ -218,6 +218,11 @@ You can lint a single file (but this will _not_ exclude legacy errors):
### Style
- You can format files by using:
```
make format
```
This will format changed Lua and C files with all appropriate flags set.
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
```