1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

move astyle files to docs and add it's README to CONTRIBUTING.md

This commit is contained in:
Gabor Kiss-Vamosi 2018-06-19 10:14:31 +02:00
parent 5ff4125c56
commit 12237142da
6 changed files with 13 additions and 18 deletions

View File

@ -1,18 +0,0 @@
Use the _astylerc config file and the 'astyle' util to format the
project source files in accordance with the project coding style.
At project top level run these commands:
1. To format the .c files:
$ find . -type f -name "*.c" | xargs astyle --options=_astylerc-c
-OR- (to skip creation of backup files)
$ find . -type f -name "*.c" | xargs astyle --options=_astylerc-c -n
2. To format the .h files:
$ find . -type f -name "*.h" | xargs astyle --options=_astylerc-h
-OR- (to skip creation of backup files)
$ find . -type f -name "*.h" | xargs astyle --options=_astylerc-h -n
3. To remove the backup file created by astyle:
$ find . -type f -name "*.bak" -delete # this are *.c backup files
$ find . -type f -name "*.orig" -delete # this are *.h backup files

View File

@ -161,3 +161,14 @@ void lv_label_set_text(lv_obj_t * label, const char * text)
```
Use 4 spaces indentation instead of tab.
You can use **astyle** to format the code. The required config flies are: `docs/astyle_c` and `docs/astyle_h`.
To format the header files:
`$ find . -type f -name "*.c" | xargs astyle --options=docs/astyle_c`
To format the sorce files:
`$ find . -type f -name "*.h" | xargs astyle --options=docs/astyle_h`
Append `-n` to the end to skip creation of backup file or use `$ find . -type f -name "*.bak" -delete` (for source file's backups) and `find . -type f -name "*.orig" -delete` (for header file's backups)

1
docs/astyle_c Normal file
View File

@ -0,0 +1 @@
--style=kr --convert-tabs --indent=spaces=4 --indent-switches --pad-oper --unpad-paren --align-pointer=middle --suffix=.bak --lineend=linux --min-conditional-indent=

1
docs/astyle_h Normal file
View File

@ -0,0 +1 @@
--convert-tabs --indent=spaces=4