feat(script): add pre-commit configuration for code formatting (#3092)
* Add initial pre-commit configuration for code formatting * chore: Move --recursive switch from cfg file to script * pre-commit: Update format-source hook to use code-format.cfg Also remove the code-format-per-file.cfg file as it's now unused * docs: Add section about pre-commit
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
--max-continuation-indent=120
|
||||
--mode=c
|
||||
--lineend=linux
|
||||
--recursive
|
||||
--suffix=none
|
||||
--preserve-date
|
||||
--formatted
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import os
|
||||
|
||||
os.system('astyle --options=code-format.cfg "../src/*.c,*.h"')
|
||||
os.system('astyle --options=code-format.cfg "../demos/*.c,*.h"')
|
||||
os.system('astyle --options=code-format.cfg "../examples/*.c,*.h"')
|
||||
os.system('astyle --options=code-format.cfg "../tests/src/test_cases/*.c"')
|
||||
os.system('astyle --options=code-format.cfg --recursive "../src/*.c,*.h"')
|
||||
os.system('astyle --options=code-format.cfg --recursive "../demos/*.c,*.h"')
|
||||
os.system('astyle --options=code-format.cfg --recursive "../examples/*.c,*.h"')
|
||||
os.system('astyle --options=code-format.cfg --recursive "../tests/src/test_cases/*.c"')
|
||||
|
||||
Reference in New Issue
Block a user